25using ::apollo::drivers::canbus::Byte;
34 static const uint32_t PERIOD = 20 * 1000;
40 chassis->mutable_vehicle_mode_command_105()->set_turn_light_ctrl(
41 turn_light_ctrl(bytes, length));
42 chassis->mutable_vehicle_mode_command_105()->set_vin_req(
43 vin_req(bytes, length));
44 chassis->mutable_vehicle_mode_command_105()->set_drive_mode_ctrl(
45 drive_mode_ctrl(bytes, length));
46 chassis->mutable_vehicle_mode_command_105()->set_steer_mode_ctrl(
47 steer_mode_ctrl(bytes, length));
48 chassis->mutable_vehicle_mode_command_105()->set_checksum_105(
49 checksum_105(bytes, length));
53 set_p_turn_light_ctrl(data, turn_light_ctrl_);
54 set_p_vin_req(data, vin_req_);
55 set_p_drive_mode_ctrl(data, drive_mode_ctrl_);
56 set_p_steer_mode_ctrl(data, steer_mode_ctrl_);
58 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
59 set_p_checksum_105(data, checksum_105_);
74 checksum_105_ = checksum_105;
81void Vehiclemodecommand105::set_p_checksum_105(uint8_t* data,
83 checksum_105 = ProtocolData::BoundedValue(0, 255, checksum_105);
86 Byte to_set(data + 7);
87 to_set.set_value(x, 0, 8);
92 turn_light_ctrl_ = turn_light_ctrl;
102void Vehiclemodecommand105::set_p_turn_light_ctrl(
105 int x = turn_light_ctrl;
107 Byte to_set(data + 2);
108 to_set.set_value(x, 0, 2);
121void Vehiclemodecommand105::set_p_vin_req(
125 Byte to_set(data + 3);
126 to_set.set_value(x, 0, 1);
131 drive_mode_ctrl_ = drive_mode_ctrl;
140void Vehiclemodecommand105::set_p_drive_mode_ctrl(
143 int x = drive_mode_ctrl;
145 Byte to_set(data + 1);
146 to_set.set_value(x, 0, 3);
151 steer_mode_ctrl_ = steer_mode_ctrl;
161void Vehiclemodecommand105::set_p_steer_mode_ctrl(
164 int x = steer_mode_ctrl;
166 Byte to_set(data + 0);
167 to_set.set_value(x, 0, 3);
171Vehiclemodecommand105::turn_light_ctrl(
const std::uint8_t* bytes,
172 int32_t length)
const {
174 int32_t x = t0.get_byte(0, 2);
182 const std::uint8_t* bytes, int32_t length)
const {
184 int32_t x = t0.get_byte(0, 1);
192Vehiclemodecommand105::drive_mode_ctrl(
const std::uint8_t* bytes,
193 int32_t length)
const {
195 int32_t x = t0.get_byte(0, 3);
203Vehiclemodecommand105::steer_mode_ctrl(
const std::uint8_t* bytes,
204 int32_t length)
const {
206 int32_t x = t0.get_byte(0, 3);
213int Vehiclemodecommand105::checksum_105(
const std::uint8_t* bytes,
214 int32_t length)
const {
216 int32_t x = t0.get_byte(0, 8);
Vehiclemodecommand105 * set_drive_mode_ctrl(Vehicle_mode_command_105::Drive_mode_ctrlType drive_mode_ctrl)
Vehiclemodecommand105 * set_steer_mode_ctrl(Vehicle_mode_command_105::Steer_mode_ctrlType steer_mode_ctrl)
uint32_t GetPeriod() const override
void Parse(const std::uint8_t *bytes, int32_t length, Devkit *chassis) const override
void UpdateData(uint8_t *data) override
Vehiclemodecommand105 * set_vin_req(Vehicle_mode_command_105::Vin_reqType vin_req)
Vehiclemodecommand105 * set_turn_light_ctrl(Vehicle_mode_command_105::Turn_light_ctrlType turn_light_ctrl)
Vehiclemodecommand105 * set_checksum_105(int checksum_105)
@ DRIVE_MODE_CTRL_THROTTLE_PADDLE_DRIVE
@ STEER_MODE_CTRL_STANDARD_STEER
@ TURN_LIGHT_CTRL_TURNLAMP_OFF
@ VIN_REQ_VIN_REQ_DISABLE