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.";
42 ADEBUG <<
"control lateral error e check turn off.";
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.";
53 ADEBUG <<
"control lateral error w check turn off.";
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.";
75 ADEBUG <<
"control heading error e check turn off.";
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.";
86 ADEBUG <<
"control heading error w check turn off.";
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.";
108 ADEBUG <<
"control station error e check turn off.";
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.";
119 ADEBUG <<
"control station error w check turn off.";
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.";
140 ADEBUG <<
"control speed error e check turn off.";
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.";
150 ADEBUG <<
"control speed error w check turn off.";
static ControlCheckStatus check_station_error(const SafetyCheckConf &conf, double *station_error)
static ControlCheckStatus check_heading_error(const SafetyCheckConf &conf, double *heading_error)
static ControlCheckStatus check_speed_error(const SafetyCheckConf &conf, double *speed_error)
static ControlCheckStatus check_lateral_error(const SafetyCheckConf &conf, double *lateral_error)
Math-related util functions.
Defines the ControlChecker class.
T Clamp(const T value, T bound1, T bound2)
Clamp a value between two bounds.
optional bool use_heading_error_w_check
optional bool use_speed_error_e_check
optional bool use_lateral_error_e_check
optional bool use_speed_error_w_check
optional SafetyCheckThreshold check_threshold
optional bool use_lateral_error_w_check
optional bool use_heading_error_e_check
optional bool use_station_error_e_check
optional bool use_station_error_w_check
optional double max_heading_error_e
optional double max_lateral_error_e
optional double max_heading_error_w
optional double max_lateral_error_w
optional double max_speed_error_w
optional double max_speed_error_e
optional double max_station_error_w
optional double max_station_error_e