22 #include "modules/canbus/proto/canbus_conf.pb.h" 23 #include "modules/canbus/proto/chassis.pb.h" 24 #include "modules/canbus/proto/vehicle_parameter.pb.h" 31 #include "modules/common/proto/error_code.pb.h" 32 #include "modules/control/proto/control_cmd.pb.h" 44 ::apollo::common::ErrorCode
Init(
45 const VehicleParameter& params,
46 CanSender<::apollo::canbus::ChassisDetail>*
const can_sender,
47 MessageManager<::apollo::canbus::ChassisDetail>*
const message_manager)
50 bool Start()
override;
68 FRIEND_TEST(DevkitControllerTest, UpdateDrivingMode);
72 void Emergency()
override;
73 ::apollo::common::ErrorCode EnableAutoMode()
override;
74 ::apollo::common::ErrorCode DisableAutoMode()
override;
75 ::apollo::common::ErrorCode EnableSteeringOnlyMode()
override;
76 ::apollo::common::ErrorCode EnableSpeedOnlyMode()
override;
79 void Gear(Chassis::GearPosition state)
override;
84 void Brake(
double acceleration)
override;
88 void Throttle(
double throttle)
override;
92 void Acceleration(
double acc)
override;
96 void Steer(
double angle)
override;
101 void Steer(
double angle,
double angle_spd)
override;
104 void SetEpbBreak(const ::apollo::control::ControlCommand& command)
override;
105 void SetBeam(const ::apollo::control::ControlCommand& command)
override;
106 void SetHorn(const ::apollo::control::ControlCommand& command)
override;
107 void SetTurningSignal(
108 const ::apollo::control::ControlCommand& command)
override;
110 void ResetProtocol();
111 bool CheckChassisError();
114 void SecurityDogThreadFunc();
115 virtual bool CheckResponse(
const int32_t flags,
bool need_wait);
116 void set_chassis_error_mask(
const int32_t mask);
117 int32_t chassis_error_mask();
118 Chassis::ErrorCode chassis_error_code();
119 void set_chassis_error_code(
const Chassis::ErrorCode& error_code);
130 std::unique_ptr<std::thread> thread_;
131 bool is_chassis_error_ =
false;
133 std::mutex chassis_error_code_mutex_;
134 Chassis::ErrorCode chassis_error_code_ = Chassis::NO_ERROR;
136 std::mutex chassis_mask_mutex_;
137 int32_t chassis_error_mask_ = 0;
Definition: brake_command_101.h:26
Definition: gear_command_103.h:26
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
bool Start() override
start the vehicle controller.
virtual common::ErrorCode SetDrivingMode(const Chassis::DrivingMode &driving_mode)
set vehicle to appointed driving mode.
Definition: devkit_controller.h:38
Definition: park_command_104.h:26
Definition: steering_command_102.h:26
FRIEND_TEST(DevkitControllerTest, SetDrivingMode)
The class of VehicleController.
Chassis chassis() override
calculate and return the chassis.
This is the interface class of vehicle controller. It defines pure virtual functions, and also some implemented common functions.
Definition: vehicle_controller.h:53
virtual ~DevkitController()
void Stop() override
stop the vehicle controller.
DevkitController()
Definition: devkit_controller.h:40
::apollo::common::ErrorCode Init(const VehicleParameter ¶ms, CanSender<::apollo::canbus::ChassisDetail > *const can_sender, MessageManager<::apollo::canbus::ChassisDetail > *const message_manager) override
Definition: throttle_command_100.h:26