A proportional-integral-derivative controller for speed and steering using defualt integral hold
更多...
#include <control_checker.h>
A proportional-integral-derivative controller for speed and steering using defualt integral hold
在文件 control_checker.h 第 39 行定义.
◆ ~ControlChecker()
| virtual apollo::control::ControlChecker::~ControlChecker |
( |
| ) |
|
|
virtualdefault |
initialize pid controller
- 参数
-
| pid_conf | configuration for pid controller |
◆ check_heading_error()
在文件 control_checker.cc 第 59 行定义.
59 {
60
61
62
63 double max_heading_error_E = conf.check_threshold().max_heading_error_e();
64 double max_heading_error_W = conf.check_threshold().max_heading_error_w();
65
66 if (conf.use_heading_error_e_check()) {
67 if (std::fabs(*heading_error) > max_heading_error_E) {
68 ADEBUG <<
"[Error] heading error is not reliable due to: |" << *heading_error <<
"| > "
69 << max_heading_error_E;
70 *heading_error =
common::math::Clamp(*heading_error, -max_heading_error_E, max_heading_error_E);
71 ADEBUG <<
"[Error] control heading e failed.";
73 }
74 } else {
75 ADEBUG <<
"control heading error e check turn off.";
76 }
77
78 if (conf.use_heading_error_w_check()) {
79 if (std::fabs(*heading_error) > max_heading_error_W) {
80 ADEBUG <<
"[Warning] heading error is not reliable due to: |" << *heading_error <<
"| > "
81 << max_heading_error_W;
82 ADEBUG <<
"[Warning] control heading w failed.";
84 }
85 } else {
86 ADEBUG <<
"control heading error w check turn off.";
87 }
88
90}
T Clamp(const T value, T bound1, T bound2)
Clamp a value between two bounds.
◆ check_lateral_error()
在文件 control_checker.cc 第 26 行定义.
26 {
27
28
29
30 double max_lateral_error_E = conf.check_threshold().max_lateral_error_e();
31 double max_lateral_error_W = conf.check_threshold().max_lateral_error_w();
32
33 if (conf.use_lateral_error_e_check()) {
34 if (std::fabs(*lateral_error) > max_lateral_error_E) {
35 ADEBUG <<
"[Error] lateral error is not reliable due to: |" << *lateral_error <<
"| > "
36 << max_lateral_error_E;
37 *lateral_error =
common::math::Clamp(*lateral_error, -max_lateral_error_E, max_lateral_error_E);
38 ADEBUG <<
"[Error] control lateral e failed.";
40 }
41 } else {
42 ADEBUG <<
"control lateral error e check turn off.";
43 }
44
45 if (conf.use_lateral_error_w_check()) {
46 if (std::fabs(*lateral_error) > max_lateral_error_W) {
47 ADEBUG <<
"[Warning] lateral error is not reliable due to: |" << *lateral_error <<
"| > "
48 << max_lateral_error_W;
49 ADEBUG <<
"[Warning] control lateral w failed.";
51 }
52 } else {
53 ADEBUG <<
"control lateral error w check turn off.";
54 }
55
57}
◆ check_speed_error()
在文件 control_checker.cc 第 125 行定义.
125 {
126
127
128
129 double max_speed_error_E = conf.check_threshold().max_speed_error_e();
130 double max_speed_error_W = conf.check_threshold().max_speed_error_w();
131
132 if (conf.use_speed_error_e_check()) {
133 if (fabs(*speed_error) > max_speed_error_E) {
134 ADEBUG <<
"[Error] speed error is not reliable due to: |" << *speed_error <<
"| > " << max_speed_error_E;
136 ADEBUG <<
"[Error] control speed e failed.";
138 }
139 } else {
140 ADEBUG <<
"control speed error e check turn off.";
141 }
142
143 if (conf.use_speed_error_w_check()) {
144 if (fabs(*speed_error) > max_speed_error_W) {
145 ADEBUG <<
"[Warning] speed error is not reliable due to: |" << *speed_error <<
"| > " << max_speed_error_W;
146 ADEBUG <<
"[Warning] control speed w failed.";
148 }
149 } else {
150 ADEBUG <<
"control speed error w check turn off.";
151 }
152
154}
◆ check_station_error()
在文件 control_checker.cc 第 92 行定义.
92 {
93
94
95
96 double max_station_error_E = conf.check_threshold().max_station_error_e();
97 double max_station_error_W = conf.check_threshold().max_station_error_w();
98
99 if (conf.use_station_error_e_check()) {
100 if (std::fabs(*station_error) > max_station_error_E) {
101 ADEBUG <<
"[Error] station error is not reliable due to: |" << *station_error <<
"| > "
102 << max_station_error_E;
103 *station_error =
common::math::Clamp(*station_error, -max_station_error_E, max_station_error_E);
104 ADEBUG <<
"[Error] control station e failed.";
106 }
107 } else {
108 ADEBUG <<
"control station error e check turn off.";
109 }
110
111 if (conf.use_station_error_w_check()) {
112 if (std::fabs(*station_error) > max_station_error_W) {
113 ADEBUG <<
"[Warning] station error is not reliable due to: |" << *station_error <<
"| > "
114 << max_station_error_W;
115 ADEBUG <<
"[Warning] control station w failed.";
117 }
118 } else {
119 ADEBUG <<
"control station error w check turn off.";
120 }
121
123}
该类的文档由以下文件生成: