103 void Stop()
override;
109 std::string
Name()
const override;
112 bool LoadParams(ParamsPipeline *params_pipeline);
116 const double preview_time,
118 const double vehicle_speed,
126 void SetDigitalFilterPitchAngle();
132 bool SetCurrentParam(
133 const std::string param_config_name,
134 LonBasedPidPlusControllerConf ¤t_lon_based_pidcontroller_conf);
136 bool ChooseCurrentParam(
138 const double vehicle_speed,
139 LonBasedPidPlusControllerConf ¤t_lon_based_pidcontroller_conf);
141 bool SetCurrentCalibrationTable(
142 const std::string calibration_table_config_name,
145 bool ChooseCurrentCalibrationTable(
calibration_table ¤t_calibration_table_conf);
157 void CalcultePidParams(
const double &speed,
PidPlusConf &pid_plus_conf);
160 void ResetNewFullStop();
168 std::unique_ptr<Interpolation2D> control_interpolation_;
170 std::unique_ptr<TrajectoryAnalyzer> trajectory_analyzer_;
173 bool controller_initialized_ =
false;
175 double previous_acceleration_ = 0.0;
176 double previous_acceleration_reference_ = 0.0;
184 FILE *speed_log_file_ =
nullptr;
189 std::vector<std::pair<std::string, calibration_table>> calibration_table_list_;
190 double previous_calibration_table_size_ = 0.0;
191 std::string current_calibration_table_config_name_ =
"";
193 ParamsPipeline params_pipeline_;
194 std::vector<std::pair<std::string, LonBasedPidPlusControllerConf>> params_list_;
195 LonBasedPidPlusControllerConf lon_based_pidcontroller_conf_;
196 LonBasedPidPlusControllerConf current_lon_based_pidcontroller_conf_;
197 std::string current_param_config_name_ =
"";
202 bool is_stop_by_pedestrian_ =
false;
203 bool is_stop_by_pedestrian_previous_ =
false;
204 double start_time_ = 0.0;
205 double wait_time_diff_ = 0.0;
207 bool is_full_stop_previous_ =
false;
208 double is_full_stop_start_time_ = 0.0;
209 int is_full_stop_wait_time_diff_ = 0;
211 bool epb_on_change_switch_ =
true;
212 bool epb_off_change_switch_ =
true;
213 int epb_change_count_ = 0;
216 double standstill_narmal_acceleration_ = 0.0;
217 double stop_gain_acceleration_ = 0.0;
218 double max_path_remain_when_stopped_ = 0.0;
219 bool parking_release_ =
false;
221 double dec_hold_on_slope_ = 0.0;
222 bool is_slipping_ =
false;
223 bool enable_stop_control_ =
false;
224 double stop_dec_square_error_ = 0.0;
225 double acc_control_rate_ = 0.0;
226 double previous_acc_output_ = 0.0;
228 bool previous_is_full_stop_ =
false;
229 bool form_go_to_full_stop_ =
false;
230 bool begin_end_brake_ =
false;
232 double fullstop_in_brake_ = 0.0;
233 int fullstop_window_count_ = 0;
234 double hillup_fullstop_brake_rate_ = 0.0;
236 double reference_spd_ = 0.0;
237 double reference_spd_cmd_ = 0.0;
239 bool from_finish_to_else_ =
false;
240 bool previous_is_finish_ =
false;
241 bool is_need_restart_pedestrian_init_time_ =
true;
243 double openspace_speed_control_throttle_cmd_ = 0.0;
244 double openspace_speed_control_brake_cmd_ = 0.0;
245 int openspace_count_ = 0;
247 double current_trajectory_timestamp_ = -1.0;
248 double pre_trajectory_timestamp_ = -1.0;
250 double last_speed_ = 0.0;
common::Status ComputeControlCommand(const localization::LocalizationEstimate *localization, const canbus::Chassis *chassis, const planning::ADCTrajectory *trajectory, control::ControlCommand *cmd) override
compute brake / throttle values based on current vehicle status and target trajectory