27 #include "gtest/gtest_prod.h" 31 #include "modules/canbus/proto/canbus_conf.pb.h" 32 #include "modules/canbus/proto/chassis.pb.h" 33 #include "modules/canbus/proto/chassis_detail.pb.h" 34 #include "modules/canbus/proto/vehicle_parameter.pb.h" 35 #include "modules/common/proto/error_code.pb.h" 36 #include "modules/control/proto/control_cmd.pb.h" 64 common::ErrorCode
Init(
65 const VehicleParameter ¶ms,
66 CanSender<::apollo::canbus::ChassisDetail> *
const can_sender,
67 MessageManager<::apollo::canbus::ChassisDetail> *
const message_manager)
74 bool Start()
override;
89 FRIEND_TEST(LincolnControllerTest, UpdateDrivingMode);
93 void Emergency()
override;
94 common::ErrorCode EnableAutoMode()
override;
95 common::ErrorCode DisableAutoMode()
override;
96 common::ErrorCode EnableSteeringOnlyMode()
override;
97 common::ErrorCode EnableSpeedOnlyMode()
override;
100 void Gear(Chassis::GearPosition state)
override;
105 void Brake(
double acceleration)
override;
109 void Throttle(
double throttle)
override;
113 void Acceleration(
double acc)
override;
117 void Steer(
double angle)
override;
122 void Steer(
double angle,
double angle_spd)
override;
125 void SetEpbBreak(
const control::ControlCommand &command)
override;
126 void SetBeam(
const control::ControlCommand &command)
override;
127 void SetHorn(
const control::ControlCommand &command)
override;
128 void SetTurningSignal(
const control::ControlCommand &command)
override;
130 void ResetProtocol();
131 bool CheckChassisError();
132 bool CheckSafetyError(
const canbus::ChassisDetail &chassis);
135 void SecurityDogThreadFunc();
136 virtual bool CheckResponse(
const int32_t flags,
bool need_wait);
137 void set_chassis_error_mask(
const int32_t mask);
138 int32_t chassis_error_mask();
139 Chassis::ErrorCode chassis_error_code();
140 void set_chassis_error_code(
const Chassis::ErrorCode &error_code);
147 Gear66 *gear_66_ =
nullptr;
151 std::unique_ptr<std::thread> thread_;
152 bool is_chassis_error_ =
false;
154 std::mutex chassis_error_code_mutex_;
155 Chassis::ErrorCode chassis_error_code_ = Chassis::NO_ERROR;
157 std::mutex chassis_mask_mutex_;
158 int32_t chassis_error_mask_ = 0;
160 bool received_vin_ =
false;
162 canbus::Chassis::GearPosition gear_tmp_;
the class of Brake60 (for lincoln vehicle)
one of the protocol data of lincoln vehicle
Definition: steering_64.h:40
the class of Turnsignal68 (for lincoln vehicle)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
one of the protocol data of lincoln vehicle
Definition: throttle_62.h:40
virtual common::ErrorCode SetDrivingMode(const Chassis::DrivingMode &driving_mode)
set vehicle to appointed driving mode.
common::ErrorCode Init(const VehicleParameter ¶ms, CanSender<::apollo::canbus::ChassisDetail > *const can_sender, MessageManager<::apollo::canbus::ChassisDetail > *const message_manager) override
initialize the lincoln vehicle controller.
the class of Steering64 (for lincoln vehicle)
Chassis chassis() override
calculate and return the chassis.
one of the protocol data of lincoln vehicle
Definition: brake_60.h:40
the class of Throttle62 (for lincoln vehicle)
The class of VehicleController.
bool Start() override
start the vehicle controller.
one of the protocol data of lincoln vehicle
Definition: gear_66.h:40
This is the interface class of vehicle controller. It defines pure virtual functions, and also some implemented common functions.
Definition: vehicle_controller.h:53
one of the protocol data of lincoln vehicle
Definition: turnsignal_68.h:40
FRIEND_TEST(LincolnControllerTest, SetDrivingMode)
the class of Gear66 (for lincoln vehicle)
void Stop() override
stop the vehicle controller.
this class implements the vehicle controller for lincoln vehicle.
Definition: lincoln_controller.h:58