101 std::string
Name()
const override;
105 bool LoadParams(ParamsPipeline *params_pipeline);
108 void SetDigitalFilterPitchAngle();
110 void InitControlCalibrationTable();
111 bool CheckSlope(
double vehicle_pitch);
113 AntiSlipControlTaskConf::VehicleMoveState CheckAccGainPoint(
114 double path_remain_threshold,
117 bool DetectHillStartCondition(
120 const double ¤t_speed);
121 void CalculateHillStartACCAndBrakeRate(
125 bool DetectQuitHillStart(
ControlCommand *cmd,
const double ¤t_speed);
128 void ResetHillStart();
129 void ResetHillUpStop();
131 void ResetDetectObstacleFlags();
134 bool SetCurrentParam(
const std::string param_config_name, AntiSlipControlTaskConf &antislip_control_task_conf_);
135 bool ChooseCurrentParam(
137 AntiSlipControlTaskConf &antislip_control_task_conf_);
139 std::string current_param_config_name_ =
"";
145 ParamsPipeline params_pipeline_;
146 std::vector<std::pair<std::string, AntiSlipControlTaskConf>> params_list_;
150 AntiSlipControlTaskConf antislip_control_task_conf_;
151 std::unique_ptr<Interpolation2D> control_interpolation_;
152 std::unique_ptr<Interpolation1D> slope_pitch_acc_interpolation_;
154 double max_path_remain_when_stopped_ = 0.0;
155 bool vehicle_start_up_ =
false;
156 double start_path_remian_ = 0.0;
157 bool previous_park_brake_ =
false;
158 bool is_brake_hold_ =
false;
159 bool enable_acc_gain_ =
false;
161 bool in_hill_start_condition_ =
false;
162 bool in_normal_start_condition_ =
false;
163 double quit_hill_start_speed_ = 0.0;
164 int preview_length_ = 0;
166 int min_speed_preview_length_ = 0;
167 double min_speed_preview_ = 0.0;
169 double hill_start_acc_gain_rate_ = 0.0;
170 double hill_start_brake_dec_rate_ = 0.0;
172 int hill_start_window_ = 0;
173 int hill_start_acc_count_ = 0;
174 int hill_start_brake_count_ = 0;
176 double previous_hill_start_acc_ = 0.0;
177 double previous_hill_start_brake_ = 0.0;
178 double hill_start_first_acc_ = 0.0;
180 double normal_start_tartget_acc_ = 0.0;
181 int normal_start_gain_count_ = 0;
182 int normal_start_maintain_count_ = 0;
183 double normal_start_acc_gain_rate_ = 0.0;
185 bool previous_is_auto_ =
false;
186 bool from_else_to_auto_ =
false;
188 bool previous_is_full_stop_ =
false;
189 bool form_go_to_full_stop_ =
false;
190 bool begin_end_brake_ =
false;
192 double fullstop_in_brake_ = 0.0;
193 int fullstop_window_count_ = 0;
194 double hillup_fullstop_brake_rate_ = 0.0;
196 int unusual_stop_count_ = 0;
197 bool on_obstacle_ =
false;
198 int quit_obstacle_count_ = 0;
199 double in_obstacle_throttle_ = 0.0;
200 double previous_obs_throttle_ = 0.0;
201 int min_throttle_count_ = 0;
202 int speed_stable_count_ = 0;
204 double previous_downhill_go_brk_ = 0.0;
206 bool uphill_too_fast_ =
false;
207 bool only_use_brk_downhill_ =
false;
208 bool erase_brk_in_go_ =
false;
209 bool erase_brk_in_end_ =
false;
210 int gear_drive_count_ = 0;
212 double pre_cali_down_hill_ = 0.0;
214 double slope_start_acc_ = 0.0;
215 std::string anti_stage_ =
"none";
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