Apollo 10.0
自动驾驶开放平台
vcu_report_505.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;
32 void Parse(const std::uint8_t* bytes, int32_t length,
33 Demo* chassis) const override;
34
35 private:
36 // config detail: {'bit': 36, 'enum': {0:
37 // 'VEHICLE_MODE_STATE_MANUAL_REMOTE_MODE', 1: 'VEHICLE_MODE_STATE_AUTO_MODE',
38 // 2: 'VEHICLE_MODE_STATE_EMERGENCY_MODE', 3:
39 // 'VEHICLE_MODE_STATE_STANDBY_MODE'}, 'is_signed_var': False, 'len': 2,
40 // 'name': 'Vehicle_Mode_State', 'offset': 0.0, 'order': 'motorola',
41 // 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
42 // 'enum'}
44 const std::uint8_t* bytes, const int32_t length) const;
45
46 // config detail: {'bit': 58, 'description': 'describle the vehicle AEB mode
47 // whether was set', 'enum': {0: 'AEB_MODE_DISABLE', 1: 'AEB_MODE_ENABLE'},
48 // 'is_signed_var': False, 'len': 1, 'name': 'AEB_Mode', 'offset': 0.0,
49 // 'order': 'motorola', 'physical_range': '[0|1]', 'physical_unit': '',
50 // 'precision': 1.0, 'type': 'enum'}
51 Vcu_report_505::Aeb_modeType aeb_mode(const std::uint8_t* bytes,
52 const int32_t length) const;
53
54 // config detail: {'bit': 11, 'enum': {0: 'BRAKE_LIGHT_ACTUAL_BRAKELIGHT_OFF',
55 // 1: 'BRAKE_LIGHT_ACTUAL_BRAKELIGHT_ON'}, 'is_signed_var': False, 'len': 1,
56 // 'name': 'Brake_Light_Actual', 'offset': 0.0, 'order': 'motorola',
57 // 'physical_range': '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type':
58 // 'enum'}
60 const std::uint8_t* bytes, const int32_t length) const;
61
62 // config detail: {'bit': 57, 'enum': {0: 'TURN_LIGHT_ACTUAL_TURNLAMPSTS_OFF',
63 // 1: 'TURN_LIGHT_ACTUAL_LEFT_TURNLAMPSTS_ON', 2:
64 // 'TURN_LIGHT_ACTUAL_RIGHT_TURNLAMPSTS_ON', 3:
65 // 'TURN_LIGHT_ACTUAL_HAZARD_WARNING_LAMPSTS_ON'}, 'is_signed_var': False,
66 // 'len': 2, 'name': 'Turn_Light_Actual', 'offset': 0.0, 'order': 'motorola',
67 // 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
68 // 'enum'}
70 const std::uint8_t* bytes, const int32_t length) const;
71
72 // config detail: {'bit': 47, 'is_signed_var': False, 'len': 8, 'name':
73 // 'Chassis_errcode', 'offset': 0.0, 'order': 'motorola', 'physical_range':
74 // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
75 int chassis_errcode(const std::uint8_t* bytes, const int32_t length) const;
76
77 // config detail: {'bit': 39, 'enum': {0:
78 // 'DRIVE_MODE_STS_THROTTLE_PADDLE_DRIVE_MODE', 1:
79 // 'DRIVE_MODE_STS_SPEED_DRIVE_MODE'}, 'is_signed_var': False, 'len': 3,
80 // 'name': 'Drive_Mode_STS', 'offset': 0.0, 'order': 'motorola',
81 // 'physical_range': '[0|7]', 'physical_unit': '', 'precision': 1.0, 'type':
82 // 'enum'}
83 Vcu_report_505::Drive_mode_stsType drive_mode_sts(const std::uint8_t* bytes,
84 const int32_t length) const;
85
86 // config detail: {'bit': 10, 'enum': {0:
87 // 'STEER_MODE_STS_STANDARD_STEER_MODE', 1:
88 // 'STEER_MODE_STS_NON_DIRECTION_STEER_MODE', 2:
89 // 'STEER_MODE_STS_SYNC_DIRECTION_STEER_MODE'}, 'is_signed_var': False, 'len':
90 // 3, 'name': 'Steer_Mode_STS', 'offset': 0.0, 'order': 'motorola',
91 // 'physical_range': '[0|7]', 'physical_unit': '', 'precision': 1.0, 'type':
92 // 'enum'}
93 Vcu_report_505::Steer_mode_stsType steer_mode_sts(const std::uint8_t* bytes,
94 const int32_t length) const;
95
96 // config detail: {'bit': 33, 'enum': {0: 'FRONTCRASH_STATE_NO_EVENT', 1:
97 // 'FRONTCRASH_STATE_CRASH_EVENT'}, 'is_signed_var': False, 'len': 1, 'name':
98 // 'FrontCrash_State', 'offset': 0.0, 'order': 'motorola', 'physical_range':
99 // '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
101 const std::uint8_t* bytes, const int32_t length) const;
102
103 // config detail: {'bit': 34, 'enum': {0: 'BACKCRASH_STATE_NO_EVENT', 1:
104 // 'BACKCRASH_STATE_CRASH_EVENT'}, 'is_signed_var': False, 'len': 1, 'name':
105 // 'BackCrash_State', 'offset': 0.0, 'order': 'motorola', 'physical_range':
106 // '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
108 const std::uint8_t* bytes, const int32_t length) const;
109
110 // config detail: {'bit': 32, 'description': 'describe the vehicle e-brake
111 // command whether was triggered by AEB', 'enum': {0:
112 // 'AEB_BRAKE_STATE_INACTIVE', 1: 'AEB_BRAKE_STATE_ACTIVE'}, 'is_signed_var':
113 // False, 'len': 1, 'name': 'AEB_Brake_State', 'offset': 0.0, 'order':
114 // 'motorola', 'physical_range': '[0|0]', 'physical_unit': '',
115 // 'precision': 1.0, 'signal_type': 'command', 'type': 'enum'}
117 const std::uint8_t* bytes, const int32_t length) const;
118
119 // config detail: {'bit': 7, 'is_signed_var': True, 'len': 12, 'name': 'ACC',
120 // 'offset': 0.0, 'order': 'motorola', 'physical_range': '[-10|10]',
121 // 'physical_unit': 'm/s^2', 'precision': 0.01, 'type': 'double'}
122 double acc(const std::uint8_t* bytes, const int32_t length) const;
123
124 // config detail: {'bit': 23, 'description': 'speed', 'is_signed_var': True,
125 // 'len': 16, 'name': 'SPEED', 'offset': 0.0, 'order': 'motorola',
126 // 'physical_range': '[-32.768|32.767]', 'physical_unit': 'm/s', 'precision':
127 // 0.001, 'signal_type': 'speed', 'type': 'double'}
128 double speed(const std::uint8_t* bytes, const int32_t length) const;
129};
130
131} // namespace demo
132} // namespace canbus
133} // namespace apollo
void Parse(const std::uint8_t *bytes, int32_t length, Demo *chassis) const override
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData