30#include "modules/common_msgs/config_msgs/vehicle_config.pb.h"
31#include "modules/control/controllers/lat_based_lqr_plus_controller/proto/lat_based_lqr_plus_controller_conf.pb.h"
32#include "modules/control/control_task_base_extend/proto/params_pipeline.pb.h"
33#include "modules/control/control_component/proto/check_status.pb.h"
104 void Stop()
override;
110 std::string
Name()
const override;
113 bool LoadParams(ParamsPipeline *params_pipeline);
116 const std::string param_config_name,
117 LatBaseLqrPlusControllerConf ¤t_lat_based_lqr_plus_controller_conf);
120 LatBaseLqrPlusControllerConf ¤t_lat_based_lqr_plus_controller_conf,
138 const double linear_v,
140 const enum ChooseRefTrajectoryPoint &choose_track_point,
147 const double linear_v,
148 const double angular_v,
149 const double linear_a,
152 const enum ChooseRefTrajectoryPoint &choose_point,
155 bool InitControlConf(
const LatBaseLqrPlusControllerConf ¤t_lat_based_lqr_plus_controller_conf);
156 bool UpdateControlConf(
const LatBaseLqrPlusControllerConf ¤t_lat_based_lqr_plus_controller_conf);
165 void UpdateAHCParam(
const double &heading_err,
const double &speed);
172 const double lookahead_station,
173 const double lookback_station,
177 const double linear_v,
184 const double lateral_error,
185 const double heading_error,
192 const uint8_t window_size,
194 const double threshold,
195 std::vector<double> *arr,
196 int32_t *current_sign);
208 std::vector<std::pair<std::string, LatBaseLqrPlusControllerConf>>
params_list_;
The DigitalFilter class is used to pass signals with a frequency lower than a certain cutoff frequenc...
The MeanFilter class is used to smoothen a series of noisy numbers, such as sensor data or the output...
A general class to denote the return status of an API call.
LQR-Based lateral controller, to compute steering target.
Eigen::MatrixXd matrix_a_coeff_
double lookback_station_low_speed_
Eigen::MatrixXd matrix_b_
void LateralSafetyCheck(SimpleLateralDebug *debug, SimpleLateralPlusDebug *debug_info)
std::unique_ptr< Interpolation1D > heading_err_interpolation_
Eigen::MatrixXd matrix_k_
double AHC_compensated_value_
uint32_t lateral_error_w_count_
MracController mrac_controller_
double AHC_prev_compensated_value_
LatBaseLqrPlusControllerConf current_lat_based_lqr_plus_controller_conf_
Eigen::MatrixXd matrix_r_
void UpdateState(SimpleLateralDebug *debug, SimpleLateralPlusDebug *debug_info, const canbus::Chassis *chassis)
std::deque< double > AHC_container_
void UpdateLookForwardPointError(const double lookahead_station, const double lookback_station, const double pose_x, const double pose_y, const double theta, const double linear_v, const common::TrajectoryPoint &ref_point, const TrajectoryAnalyzerExtend &trajectory_analyzer, SimpleLateralDebug *debug, SimpleLateralPlusDebug *debug_info)
double previous_ref_heading_acceleration_
double pre_steering_position_
bool InitControlConf(const LatBaseLqrPlusControllerConf ¤t_lat_based_lqr_plus_controller_conf)
void ComputeTrackLateralErrors(const double x, const double y, const double theta, const double linear_v, const TrajectoryAnalyzerExtend &trajectory_analyzer, const enum ChooseRefTrajectoryPoint &choose_track_point, SimpleLateralPlusDebug *lat_debug)
LeadlagPlusController leadlag_controller_
double lookahead_station_low_speed_
double previous_lateral_acceleration_
LatPlusController()
constructor
std::vector< std::pair< std::string, LatBaseLqrPlusControllerConf > > params_list_
double CalculateTempAHCValue(const double &speed)
std::string current_param_config_name_
ReverseLogicStage::ReverseStageType now_reverse_stage_
bool enable_look_ahead_back_control_
std::unique_ptr< Interpolation1D > lat_err_interpolation_
Eigen::MatrixXd matrix_bd_
double AHC_compensating_value_
bool is_need_cover_turn_out_lane_com_length_
void ResetLateralSafetyCheck()
double ref_curvature_last_
bool LoadParams(ParamsPipeline *params_pipeline)
double query_relative_time_
void EnhanceQParamsAlternate(const double lateral_error, const double heading_error, const planning::ADCTrajectory *planning_published_trajectory, const SimpleLongitudinalDebug *previous_lon_debug, SimpleLateralDebug *debug, SimpleLateralPlusDebug *debug_info)
TrajectoryAnalyzerExtend trajectory_analyzer_
int reverse_handle_count_
virtual ~LatPlusController()
destructor
common::VehicleParam vehicle_param_
uint32_t lateral_error_e_count_
common::DigitalFilter digital_filter_
void ProcessLogs(const SimpleLateralDebug *debug, const canbus::Chassis *chassis)
Eigen::MatrixXd matrix_adc_
double ComputeFeedForward(double ref_curvature)
Eigen::MatrixXd matrix_q_
bool ChooseCurrentParam(LatBaseLqrPlusControllerConf ¤t_lat_based_lqr_plus_controller_conf, const planning::ADCTrajectory *planning_published_trajectory)
double lookback_station_high_speed_
common::Status Init(std::shared_ptr< DependencyInjector > injector) override
initialize Lateral Controller
double minimum_speed_protection_
double com_length_turbulence_
double steer_single_direction_max_degree_
double previous_ref_heading_rate_
double previous_heading_rate_
void UpdateMatrixCompound()
bool is_in_large_curvature_
Eigen::MatrixXd matrix_q_updated_
Eigen::MatrixXd matrix_state_
ParamsPipeline params_pipeline_
void UpdateDrivingOrientation()
double AHC_prev_output_value_
Eigen::MatrixXd matrix_bdc_
bool enable_enhance_qparam_
double driving_orientation_
double AutoCompensatedHeadingValue(const double &speed)
std::ofstream steer_log_file_
bool SetCurrentParam(const std::string param_config_name, LatBaseLqrPlusControllerConf ¤t_lat_based_lqr_plus_controller_conf)
bool IsDrivingStraight(const canbus::Chassis *chassis, double ref_curvature)
void ResetComLengthFromTurbulence()
common::MeanFilter heading_error_filter_
bool use_new_look_ahead_back_
Eigen::MatrixXd matrix_a_
void UpdateAHCParam(const double &heading_err, const double &speed)
const canbus::Chassis * chassis_
std::shared_ptr< DependencyInjector > injector_
double previous_lateral_error_lqr_input_
double current_trajectory_timestamp_
double com_turbulence_change_
double previous_heading_acceleration_
bool UpdateControlConf(const LatBaseLqrPlusControllerConf ¤t_lat_based_lqr_plus_controller_conf)
bool AHC_is_compensating_
bool CheckContinousErrors(const uint8_t window_size, const double error, const double threshold, std::vector< double > *arr, int32_t *current_sign)
void Stop() override
stop Lateral controller
std::vector< double > lateral_lr_errors_
enum ChooseRefTrajectoryPoint choose_ref_point_
std::string Name() const override
Lateral controller name
bool is_lat_preview_in_straight_
const int basic_state_size_
void ComputeLateralErrors(const double x, const double y, const double theta, const double linear_v, const double angular_v, const double linear_a, const TrajectoryAnalyzerExtend &trajectory_analyzer, const canbus::Chassis *chassis, const enum ChooseRefTrajectoryPoint &choose_point, SimpleLateralDebug *debug, SimpleLateralPlusDebug *lat_debug)
double init_vehicle_heading_
common::MeanFilter lateral_error_filter_
double com_length_previous_
uint8_t check_continous_errors_window_
double previous_heading_error_lqr_input_
double com_change_turbulence_add_
common::Status Reset() override
reset Lateral Controller
LatBaseLqrPlusControllerConf lat_based_lqr_plus_controller_conf_
double lookahead_station_high_speed_
Eigen::MatrixXd matrix_ad_
common::Status ComputeControlCommand(const localization::LocalizationEstimate *localization, const canbus::Chassis *chassis, const planning::ADCTrajectory *trajectory, ControlCommand *cmd) override
compute steering target based on current vehicle status and target trajectory
bool is_need_cover_turbulence_com_length_
A mrac controller for actuation system (throttle/brake and steering)
process point query and conversion related to trajectory
Defines the ControlChecker class.
Defines the Controller base class.
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
Defines the DigitalFilter class.
Functions to generate coefficients for digital filter.
Defines the MeanFilter class.