Apollo 10.0
自动驾驶开放平台
vehicle_mode_command_105.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2019 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/devkit/proto/devkit.pb.h"
20
22
23namespace apollo {
24namespace canbus {
25namespace devkit {
26
28 ::apollo::canbus::Devkit> {
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 Devkit* chassis) const override;
38
39 void UpdateData(uint8_t* data) override;
40
41 void Reset() override;
42
43 // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
44 // 'CheckSum_105', 'offset': 0.0, 'order': 'motorola', 'physical_range':
45 // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
46 Vehiclemodecommand105* set_checksum_105(int checksum_105);
47
48 // config detail: {'bit': 17, 'enum': {0: 'TURN_LIGHT_CTRL_TURNLAMP_OFF', 1:
49 // 'TURN_LIGHT_CTRL_LEFT_TURNLAMP_ON', 2: 'TURN_LIGHT_CTRL_RIGHT_TURNLAMP_ON',
50 // 3: 'TURN_LIGHT_CTRL_HAZARD_WARNING_LAMPSTS_ON'}, 'is_signed_var': False,
51 // 'len': 2, 'name': 'Turn_Light_CTRL', 'offset': 0.0, 'order': 'motorola',
52 // 'physical_range': '[0|7]', 'physical_unit': '', 'precision': 1.0, 'type':
53 // 'enum'}
56
57 // config detail: {'bit': 24, 'enum': {0: 'VIN_REQ_VIN_REQ_DISABLE', 1:
58 // 'VIN_REQ_VIN_REQ_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name':
59 // 'VIN_Req', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|1]',
60 // 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
63
64 // config detail: {'bit': 10, 'enum': {0:
65 // 'DRIVE_MODE_CTRL_THROTTLE_PADDLE_DRIVE', 1: 'DRIVE_MODE_CTRL_SPEED_DRIVE'},
66 // 'is_signed_var': False, 'len': 3, 'name': 'Drive_Mode_CTRL', 'offset': 0.0,
67 // 'order': 'motorola', 'physical_range': '[0|7]', 'physical_unit': '',
68 // 'precision': 1.0, 'type': 'enum'}
71
72 // config detail: {'bit': 2, 'enum': {0: 'STEER_MODE_CTRL_STANDARD_STEER', 1:
73 // 'STEER_MODE_CTRL_NON_DIRECTION_STEER', 2:
74 // 'STEER_MODE_CTRL_SYNC_DIRECTION_STEER'}, 'is_signed_var': False, 'len': 3,
75 // 'name': 'Steer_Mode_CTRL', 'offset': 0.0, 'order': 'motorola',
76 // 'physical_range': '[0|7]', 'physical_unit': '', 'precision': 1.0, 'type':
77 // 'enum'}
80
81 private:
82 // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
83 // 'CheckSum_105', 'offset': 0.0, 'order': 'motorola', 'physical_range':
84 // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
85 void set_p_checksum_105(uint8_t* data, int checksum_105);
86
87 // config detail: {'bit': 17, 'enum': {0: 'TURN_LIGHT_CTRL_TURNLAMP_OFF', 1:
88 // 'TURN_LIGHT_CTRL_LEFT_TURNLAMP_ON', 2: 'TURN_LIGHT_CTRL_RIGHT_TURNLAMP_ON',
89 // 3: 'TURN_LIGHT_CTRL_HAZARD_WARNING_LAMPSTS_ON'}, 'is_signed_var': False,
90 // 'len': 2, 'name': 'Turn_Light_CTRL', 'offset': 0.0, 'order': 'motorola',
91 // 'physical_range': '[0|7]', 'physical_unit': '', 'precision': 1.0, 'type':
92 // 'enum'}
93 void set_p_turn_light_ctrl(
94 uint8_t* data,
96
97 // config detail: {'bit': 24, 'enum': {0: 'VIN_REQ_VIN_REQ_DISABLE', 1:
98 // 'VIN_REQ_VIN_REQ_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name':
99 // 'VIN_Req', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|1]',
100 // 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
101 void set_p_vin_req(uint8_t* data,
103
104 // config detail: {'bit': 10, 'enum': {0:
105 // 'DRIVE_MODE_CTRL_THROTTLE_PADDLE_DRIVE', 1: 'DRIVE_MODE_CTRL_SPEED_DRIVE'},
106 // 'is_signed_var': False, 'len': 3, 'name': 'Drive_Mode_CTRL', 'offset': 0.0,
107 // 'order': 'motorola', 'physical_range': '[0|7]', 'physical_unit': '',
108 // 'precision': 1.0, 'type': 'enum'}
109 void set_p_drive_mode_ctrl(
110 uint8_t* data,
112
113 // config detail: {'bit': 2, 'enum': {0: 'STEER_MODE_CTRL_STANDARD_STEER', 1:
114 // 'STEER_MODE_CTRL_NON_DIRECTION_STEER', 2:
115 // 'STEER_MODE_CTRL_SYNC_DIRECTION_STEER'}, 'is_signed_var': False, 'len': 3,
116 // 'name': 'Steer_Mode_CTRL', 'offset': 0.0, 'order': 'motorola',
117 // 'physical_range': '[0|7]', 'physical_unit': '', 'precision': 1.0, 'type':
118 // 'enum'}
119 void set_p_steer_mode_ctrl(
120 uint8_t* data,
122
123 // report the command
125 const std::uint8_t* bytes, const int32_t length) const;
126
127 Vehicle_mode_command_105::Vin_reqType vin_req(const std::uint8_t* bytes,
128 const int32_t length) const;
129
131 const std::uint8_t* bytes, const int32_t length) const;
132
134 const std::uint8_t* bytes, const int32_t length) const;
135
136 int checksum_105(const std::uint8_t* bytes, const int32_t length) const;
137
138 private:
139 int checksum_105_;
144};
145
146} // namespace devkit
147} // namespace canbus
148} // namespace apollo
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)
void Parse(const std::uint8_t *bytes, int32_t length, Devkit *chassis) const 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)
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData