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" 48 ::apollo::common::ErrorCode
Init(
49 const VehicleParameter& params,
50 CanSender<::apollo::canbus::ChassisDetail>*
const can_sender,
51 MessageManager<::apollo::canbus::ChassisDetail>*
const message_manager)
54 bool Start()
override;
73 void Emergency()
override;
74 ::apollo::common::ErrorCode EnableAutoMode()
override;
75 ::apollo::common::ErrorCode DisableAutoMode()
override;
76 ::apollo::common::ErrorCode EnableSteeringOnlyMode()
override;
77 ::apollo::common::ErrorCode EnableSpeedOnlyMode()
override;
80 void Gear(Chassis::GearPosition state)
override;
85 void Brake(
double acceleration)
override;
89 void Throttle(
double throttle)
override;
93 void Acceleration(
double acc)
override;
97 void Steer(
double angle)
override;
102 void Steer(
double angle,
double angle_spd)
override;
105 void SetEpbBreak(const ::apollo::control::ControlCommand& command)
override;
106 void SetBeam(const ::apollo::control::ControlCommand& command)
override;
107 void SetHorn(const ::apollo::control::ControlCommand& command)
override;
108 void SetTurningSignal(
109 const ::apollo::control::ControlCommand& command)
override;
111 void ResetProtocol();
112 bool CheckChassisError();
115 void SecurityDogThreadFunc();
116 virtual bool CheckResponse(
const int32_t flags,
bool need_wait);
117 void set_chassis_error_mask(
const int32_t mask);
118 int32_t chassis_error_mask();
119 Chassis::ErrorCode chassis_error_code();
120 void set_chassis_error_code(
const Chassis::ErrorCode& error_code);
132 std::unique_ptr<std::thread> thread_;
133 bool is_chassis_error_ =
false;
135 std::mutex chassis_error_code_mutex_;
136 Chassis::ErrorCode chassis_error_code_ = Chassis::NO_ERROR;
138 std::mutex chassis_mask_mutex_;
139 int32_t chassis_error_mask_ = 0;
Definition: global_cmd_69.h:26
FRIEND_TEST(GemControllerTest, SetDrivingMode)
Definition: brake_cmd_6b.h:26
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
::apollo::common::ErrorCode Init(const VehicleParameter ¶ms, CanSender<::apollo::canbus::ChassisDetail > *const can_sender, MessageManager<::apollo::canbus::ChassisDetail > *const message_manager) override
virtual common::ErrorCode SetDrivingMode(const Chassis::DrivingMode &driving_mode)
set vehicle to appointed driving mode.
Definition: shift_cmd_65.h:26
Definition: accel_cmd_67.h:26
Chassis chassis() override
calculate and return the chassis.
Definition: gem_controller.h:42
The class of VehicleController.
Definition: steering_cmd_6d.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
GemController()
Definition: gem_controller.h:44
bool Start() override
start the vehicle controller.
Definition: turn_cmd_63.h:26
void Stop() override
stop the vehicle controller.