Apollo 10.0
自动驾驶开放平台
vehicle_mode_command_105.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include "modules/canbus_vehicle/demo/proto/demo.pb.h"
20
22
23namespace apollo {
24namespace canbus {
25namespace demo {
26
28 : public ::apollo::drivers::canbus::ProtocolData<::apollo::canbus::Demo> {
29 public:
30 static const int32_t ID;
31
33
34 uint32_t GetPeriod() const override;
35
36 void Parse(const std::uint8_t* bytes, int32_t length,
37 Demo* chassis) const override;
38
39 void UpdateData_Heartbeat(uint8_t* data) override;
40
41 void UpdateData(uint8_t* data) override;
42
43 void Reset() override;
44
45 // config detail: {'bit': 7, 'is_signed_var': False, 'len': 4, 'name':
46 // 'Heartbeat_105', 'offset': 0.0, 'order': 'motorola', 'physical_range':
47 // '[0|15]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
48 Vehiclemodecommand105* set_heartbeat_105(int heartbeat_105);
49
50 // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
51 // 'CheckSum_105', 'offset': 0.0, 'order': 'motorola', 'physical_range':
52 // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
53 Vehiclemodecommand105* set_checksum_105(int checksum_105);
54
55 // config detail: {'bit': 17, 'enum': {0: 'TURN_LIGHT_CTRL_TURNLAMP_OFF', 1:
56 // 'TURN_LIGHT_CTRL_LEFT_TURNLAMP_ON', 2: 'TURN_LIGHT_CTRL_RIGHT_TURNLAMP_ON',
57 // 3: 'TURN_LIGHT_CTRL_HAZARD_WARNING_LAMPSTS_ON'}, 'is_signed_var': False,
58 // 'len': 2, 'name': 'Turn_Light_CTRL', 'offset': 0.0, 'order': 'motorola',
59 // 'physical_range': '[0|7]', 'physical_unit': '', 'precision': 1.0, 'type':
60 // 'enum'}
63
64 // config detail: {'bit': 24, 'enum': {0: 'VIN_REQ_VIN_REQ_DISABLE', 1:
65 // 'VIN_REQ_VIN_REQ_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name':
66 // 'VIN_Req', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|1]',
67 // 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
70
71 // config detail: {'bit': 10, 'enum': {0:
72 // 'DRIVE_MODE_CTRL_THROTTLE_PADDLE_DRIVE', 1: 'DRIVE_MODE_CTRL_SPEED_DRIVE'},
73 // 'is_signed_var': False, 'len': 3, 'name': 'Drive_Mode_CTRL', 'offset': 0.0,
74 // 'order': 'motorola', 'physical_range': '[0|7]', 'physical_unit': '',
75 // 'precision': 1.0, 'type': 'enum'}
78
79 // config detail: {'bit': 2, 'enum': {0: 'STEER_MODE_CTRL_STANDARD_STEER', 1:
80 // 'STEER_MODE_CTRL_NON_DIRECTION_STEER', 2:
81 // 'STEER_MODE_CTRL_SYNC_DIRECTION_STEER'}, 'is_signed_var': False, 'len': 3,
82 // 'name': 'Steer_Mode_CTRL', 'offset': 0.0, 'order': 'motorola',
83 // 'physical_range': '[0|7]', 'physical_unit': '', 'precision': 1.0, 'type':
84 // 'enum'}
87
88 private:
89 // config detail: {'bit': 7, 'is_signed_var': False, 'len': 4, 'name':
90 // 'Heartbeat_105', 'offset': 0.0, 'order': 'motorola', 'physical_range':
91 // '[0|15]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
92 void set_p_heartbeat_105(uint8_t* data, int heartbeat_105);
93
94 // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
95 // 'CheckSum_105', 'offset': 0.0, 'order': 'motorola', 'physical_range':
96 // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
97 void set_p_checksum_105(uint8_t* data, int checksum_105);
98
99 // config detail: {'bit': 17, 'enum': {0: 'TURN_LIGHT_CTRL_TURNLAMP_OFF', 1:
100 // 'TURN_LIGHT_CTRL_LEFT_TURNLAMP_ON', 2: 'TURN_LIGHT_CTRL_RIGHT_TURNLAMP_ON',
101 // 3: 'TURN_LIGHT_CTRL_HAZARD_WARNING_LAMPSTS_ON'}, 'is_signed_var': False,
102 // 'len': 2, 'name': 'Turn_Light_CTRL', 'offset': 0.0, 'order': 'motorola',
103 // 'physical_range': '[0|7]', 'physical_unit': '', 'precision': 1.0, 'type':
104 // 'enum'}
105 void set_p_turn_light_ctrl(
106 uint8_t* data,
108
109 // config detail: {'bit': 24, 'enum': {0: 'VIN_REQ_VIN_REQ_DISABLE', 1:
110 // 'VIN_REQ_VIN_REQ_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name':
111 // 'VIN_Req', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|1]',
112 // 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
113 void set_p_vin_req(uint8_t* data,
115
116 // config detail: {'bit': 10, 'enum': {0:
117 // 'DRIVE_MODE_CTRL_THROTTLE_PADDLE_DRIVE', 1: 'DRIVE_MODE_CTRL_SPEED_DRIVE'},
118 // 'is_signed_var': False, 'len': 3, 'name': 'Drive_Mode_CTRL', 'offset': 0.0,
119 // 'order': 'motorola', 'physical_range': '[0|7]', 'physical_unit': '',
120 // 'precision': 1.0, 'type': 'enum'}
121 void set_p_drive_mode_ctrl(
122 uint8_t* data,
124
125 // config detail: {'bit': 2, 'enum': {0: 'STEER_MODE_CTRL_STANDARD_STEER', 1:
126 // 'STEER_MODE_CTRL_NON_DIRECTION_STEER', 2:
127 // 'STEER_MODE_CTRL_SYNC_DIRECTION_STEER'}, 'is_signed_var': False, 'len': 3,
128 // 'name': 'Steer_Mode_CTRL', 'offset': 0.0, 'order': 'motorola',
129 // 'physical_range': '[0|7]', 'physical_unit': '', 'precision': 1.0, 'type':
130 // 'enum'}
131 void set_p_steer_mode_ctrl(
132 uint8_t* data,
134
135 int heartbeat_105(const std::uint8_t* bytes, const int32_t length) const;
136
137 int checksum_105(const std::uint8_t* bytes, const int32_t length) const;
138
140 const std::uint8_t* bytes, const int32_t length) const;
141
142 Vehicle_mode_command_105::Vin_reqType vin_req(const std::uint8_t* bytes,
143 const int32_t length) const;
144
146 const std::uint8_t* bytes, const int32_t length) const;
147
149 const std::uint8_t* bytes, const int32_t length) const;
150
151 private:
152 int heartbeat_105_;
153 int checksum_105_;
158};
159
160} // namespace demo
161} // namespace canbus
162} // namespace apollo
Vehiclemodecommand105 * set_heartbeat_105(int heartbeat_105)
Vehiclemodecommand105 * set_vin_req(Vehicle_mode_command_105::Vin_reqType vin_req)
Vehiclemodecommand105 * set_steer_mode_ctrl(Vehicle_mode_command_105::Steer_mode_ctrlType steer_mode_ctrl)
Vehiclemodecommand105 * set_turn_light_ctrl(Vehicle_mode_command_105::Turn_light_ctrlType turn_light_ctrl)
Vehiclemodecommand105 * set_checksum_105(int checksum_105)
void Parse(const std::uint8_t *bytes, int32_t length, Demo *chassis) const override
Vehiclemodecommand105 * set_drive_mode_ctrl(Vehicle_mode_command_105::Drive_mode_ctrlType drive_mode_ctrl)
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData