22 #include "gtest/gtest_prod.h" 26 #include "modules/canbus/proto/canbus_conf.pb.h" 27 #include "modules/canbus/proto/chassis.pb.h" 28 #include "modules/canbus/proto/chassis_detail.pb.h" 29 #include "modules/canbus/proto/vehicle_parameter.pb.h" 30 #include "modules/common/proto/error_code.pb.h" 31 #include "modules/control/proto/control_cmd.pb.h" 54 ::apollo::common::ErrorCode
Init(
55 const VehicleParameter& params,
56 CanSender<::apollo::canbus::ChassisDetail>*
const can_sender,
57 MessageManager<::apollo::canbus::ChassisDetail>*
const message_manager)
60 bool Start()
override;
75 FRIEND_TEST(LexusControllerTest, UpdateDrivingMode);
79 void Emergency()
override;
80 ::apollo::common::ErrorCode EnableAutoMode()
override;
81 ::apollo::common::ErrorCode DisableAutoMode()
override;
82 ::apollo::common::ErrorCode EnableSteeringOnlyMode()
override;
83 ::apollo::common::ErrorCode EnableSpeedOnlyMode()
override;
86 void Gear(Chassis::GearPosition state)
override;
91 void Brake(
double acceleration)
override;
95 void Throttle(
double throttle)
override;
99 void Acceleration(
double acc)
override;
103 void Steer(
double angle)
override;
108 void Steer(
double angle,
double angle_spd)
override;
111 void SetEpbBreak(const ::apollo::control::ControlCommand& command)
override;
112 void SetBeam(const ::apollo::control::ControlCommand& command)
override;
113 void SetHorn(const ::apollo::control::ControlCommand& command)
override;
114 void SetTurningSignal(
115 const ::apollo::control::ControlCommand& command)
override;
117 void ResetProtocol();
118 bool CheckChassisError();
121 void SecurityDogThreadFunc();
122 virtual bool CheckResponse(
const int32_t flags,
bool need_wait);
123 void set_chassis_error_mask(
const int32_t mask);
124 int32_t chassis_error_mask();
125 Chassis::ErrorCode chassis_error_code();
126 void set_chassis_error_code(
const Chassis::ErrorCode& error_code);
144 std::unique_ptr<std::thread> thread_;
145 bool is_chassis_error_ =
false;
147 std::mutex chassis_error_code_mutex_;
148 Chassis::ErrorCode chassis_error_code_ = Chassis::NO_ERROR;
150 std::mutex chassis_mask_mutex_;
151 int32_t chassis_error_mask_ = 0;
void Stop() override
stop the vehicle controller.
FRIEND_TEST(LexusControllerTest, SetDrivingMode)
Definition: brake_cmd_104.h:26
Definition: dash_controls_right_rpt_210.h:26
Definition: headlight_cmd_118.h:26
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Chassis chassis() override
calculate and return the chassis.
Definition: shift_cmd_128.h:26
Definition: steering_cmd_12c.h:26
Definition: parking_brake_cmd_124.h:26
Definition: lexus_controller.h:50
virtual ~LexusController()
virtual common::ErrorCode SetDrivingMode(const Chassis::DrivingMode &driving_mode)
set vehicle to appointed driving mode.
Definition: turn_cmd_130.h:26
Definition: horn_cmd_11c.h:26
bool Start() override
start the vehicle controller.
The class of VehicleController.
Definition: wiper_cmd_134.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
::apollo::common::ErrorCode Init(const VehicleParameter ¶ms, CanSender<::apollo::canbus::ChassisDetail > *const can_sender, MessageManager<::apollo::canbus::ChassisDetail > *const message_manager) override
Definition: accel_cmd_100.h:26
Definition: hazard_lights_cmd_114.h:26