@@ -60,6 +60,35 @@ struct ValidationParams
60
60
double nominal_latency_threshold;
61
61
};
62
62
63
+ /* *
64
+ * @class AccelerationValidator
65
+ * @brief Validates deviation between output acceleration and measured acceleration.
66
+ */
67
+ class AccelerationValidator
68
+ {
69
+ public:
70
+ explicit AccelerationValidator (rclcpp::Node & node)
71
+ {
72
+ e_offset =
73
+ autoware_utils::get_or_declare_parameter<double >(node, " thresholds.acc_error_offset" );
74
+ e_scale = autoware_utils::get_or_declare_parameter<double >(node, " thresholds.acc_error_scale" );
75
+ const double acc_lpf_gain =
76
+ autoware_utils::get_or_declare_parameter<double >(node, " acc_lpf_gain" );
77
+ desired_acc_lpf.setGain (acc_lpf_gain);
78
+ measured_acc_lpf.setGain (acc_lpf_gain);
79
+ };
80
+
81
+ bool validate (
82
+ const Odometry & kinematic_state, const Control & control_cmd,
83
+ const AccelWithCovarianceStamped & loc_acc);
84
+
85
+ private:
86
+ double e_offset;
87
+ double e_scale;
88
+ autoware::signal_processing::LowpassFilter1d desired_acc_lpf{0.0 };
89
+ autoware::signal_processing::LowpassFilter1d measured_acc_lpf{0.0 };
90
+ };
91
+
63
92
/* *
64
93
* @class ControlValidator
65
94
* @brief Validates control commands by comparing predicted trajectories against reference
@@ -146,32 +175,6 @@ class ControlValidator : public rclcpp::Node
146
175
*/
147
176
void display_status ();
148
177
149
- class AccelerationValidator
150
- {
151
- public:
152
- void setup_parameters (rclcpp::Node & node)
153
- {
154
- e_offset =
155
- autoware_utils::get_or_declare_parameter<double >(node, " thresholds.acc_error_offset" );
156
- e_scale =
157
- autoware_utils::get_or_declare_parameter<double >(node, " thresholds.acc_error_scale" );
158
- const auto acc_lpf_gain =
159
- autoware_utils::get_or_declare_parameter<double >(node, " acc_lpf_gain" );
160
- desired_acc_lpf.setGain (acc_lpf_gain);
161
- measured_acc_lpf.setGain (acc_lpf_gain);
162
- };
163
-
164
- bool validate (
165
- const Odometry & kinematic_state, const Control & control_cmd,
166
- const AccelWithCovarianceStamped & loc_acc);
167
-
168
- private:
169
- double e_offset;
170
- double e_scale;
171
- autoware::signal_processing::LowpassFilter1d desired_acc_lpf{0.0 };
172
- autoware::signal_processing::LowpassFilter1d measured_acc_lpf{0.0 };
173
- } acceleration_validator;
174
-
175
178
/* *
176
179
* @brief Set the diagnostic status
177
180
* @param stat Diagnostic status wrapper
@@ -203,6 +206,7 @@ class ControlValidator : public rclcpp::Node
203
206
ValidationParams validation_params_; // for thresholds
204
207
autoware::signal_processing::LowpassFilter1d vehicle_vel_{0.0 };
205
208
autoware::signal_processing::LowpassFilter1d target_vel_{0.0 };
209
+ AccelerationValidator acceleration_validator{*this };
206
210
207
211
bool hold_velocity_error_until_stop_{false };
208
212
0 commit comments