24 #include "modules/canbus/proto/canbus_conf.pb.h" 25 #include "modules/canbus/proto/chassis.pb.h" 26 #include "modules/canbus/proto/vehicle_parameter.pb.h" 27 #include "modules/common/proto/error_code.pb.h" 28 #include "modules/control/proto/control_cmd.pb.h" 46 ::apollo::common::ErrorCode
Init(
47 const VehicleParameter& params,
48 CanSender<::apollo::canbus::ChassisDetail>*
const can_sender,
49 MessageManager<::apollo::canbus::ChassisDetail>*
const message_manager)
52 bool Start()
override;
66 FRIEND_TEST(ZhongyunControllerTest, UpdateDrivingMode);
70 void Emergency()
override;
71 ::apollo::common::ErrorCode EnableAutoMode()
override;
72 ::apollo::common::ErrorCode DisableAutoMode()
override;
73 ::apollo::common::ErrorCode EnableSteeringOnlyMode()
override;
74 ::apollo::common::ErrorCode EnableSpeedOnlyMode()
override;
77 void Gear(Chassis::GearPosition state)
override;
82 void Brake(
double acceleration)
override;
86 void Throttle(
double throttle)
override;
90 void Acceleration(
double acc)
override;
94 void Steer(
double angle)
override;
99 void Steer(
double angle,
double angle_spd)
override;
102 void SetEpbBreak(const ::apollo::control::ControlCommand& command)
override;
103 void SetBeam(const ::apollo::control::ControlCommand& command)
override;
104 void SetHorn(const ::apollo::control::ControlCommand& command)
override;
105 void SetTurningSignal(
106 const ::apollo::control::ControlCommand& command)
override;
108 void ResetProtocol();
109 bool CheckChassisError();
112 void SecurityDogThreadFunc();
113 virtual bool CheckResponse(
const int32_t flags,
bool need_wait);
114 void set_chassis_error_mask(
const int32_t mask);
115 int32_t chassis_error_mask();
116 Chassis::ErrorCode chassis_error_code();
117 void set_chassis_error_code(
const Chassis::ErrorCode& error_code);
128 std::unique_ptr<std::thread> thread_;
129 bool is_chassis_error_ =
false;
131 std::mutex chassis_error_code_mutex_;
132 Chassis::ErrorCode chassis_error_code_ = Chassis::NO_ERROR;
134 std::mutex chassis_mask_mutex_;
135 int32_t chassis_error_mask_ = 0;
ZhongyunController()
Definition: zhongyun_controller.h:42
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: torque_control_a3.h:26
Definition: zhongyun_controller.h:40
Definition: parking_control_a5.h:26
virtual ~ZhongyunController()
Definition: steering_control_a2.h:26
virtual common::ErrorCode SetDrivingMode(const Chassis::DrivingMode &driving_mode)
set vehicle to appointed driving mode.
bool Start() override
start the vehicle controller.
Chassis chassis() override
calculate and return the chassis.
The class of VehicleController.
Definition: brake_control_a4.h:26
This is the interface class of vehicle controller. It defines pure virtual functions, and also some implemented common functions.
Definition: vehicle_controller.h:53
Definition: gear_control_a1.h:26
::apollo::common::ErrorCode Init(const VehicleParameter ¶ms, CanSender<::apollo::canbus::ChassisDetail > *const can_sender, MessageManager<::apollo::canbus::ChassisDetail > *const message_manager) override
void Stop() override
stop the vehicle controller.
FRIEND_TEST(ZhongyunControllerTest, SetDrivingMode)