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