Apollo 10.0
自动驾驶开放平台
ecu_status_1_515.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/ch/proto/ch.pb.h"
21
22namespace apollo {
23namespace canbus {
24namespace ch {
25
27 ::apollo::canbus::Ch> {
28 public:
29 static const int32_t ID;
31 void Parse(const std::uint8_t* bytes, int32_t length,
32 Ch* chassis) const override;
33
34 private:
35 // config detail: {'bit': 0, 'description': 'Current speed (Steering status)',
36 // 'is_signed_var': True, 'len': 16, 'name': 'SPEED', 'offset': 0.0, 'order':
37 // 'intel', 'physical_range': '[-327.68|327.67]', 'physical_unit': 'm/s',
38 // 'precision': 0.01, 'type': 'double'}
39 double speed(const std::uint8_t* bytes, const int32_t length) const;
40
41 // config detail: {'bit': 16, 'description': 'Current acceleration (Steering
42 // status)', 'is_signed_var': True, 'len': 16, 'name': 'ACC_SPEED', 'offset':
43 // 0.0, 'order': 'intel', 'physical_range': '[0|0]', 'physical_unit': 'm/s^2',
44 // 'precision': 0.001, 'type': 'double'}
45 double acc_speed(const std::uint8_t* bytes, const int32_t length) const;
46
47 // config detail: {'bit': 32, 'description': 'Current Auto-mode state (Chassis
48 // status)', 'enum': {0: 'CTRL_STS_OUT_OF_CONTROL', 1:
49 // 'CTRL_STS_UNDER_CONTROL'}, 'is_signed_var': False, 'len': 8, 'name':
50 // 'CTRL_STS', 'offset': 0.0, 'order': 'intel', 'physical_range': '[0|1]',
51 // 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
52 Ecu_status_1_515::Ctrl_stsType ctrl_sts(const std::uint8_t* bytes,
53 const int32_t length) const;
54
55 // config detail: {'bit': 40, 'description': 'Current chassis state (Chassis
56 // status)', 'is_signed_var': False, 'len': 8, 'name': 'CHASSIS_STS',
57 // 'offset': 0.0, 'order': 'intel', 'physical_range': '[0|255]',
58 // 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
59 int chassis_sts(const std::uint8_t* bytes, const int32_t length) const;
60
61 // config detail: {'bit': 48, 'description': 'Chassis error code (Chassis
62 // status)', 'is_signed_var': False, 'len': 16, 'name': 'CHASSIS_ERR',
63 // 'offset': 0.0, 'order': 'intel', 'physical_range': '[0|65535]',
64 // 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
65 int chassis_err(const std::uint8_t* bytes, const int32_t length) const;
66
67 // config detail: {'bit': 48, 'description': 'Chassis error code (Chassis
68 // status)', 'enum': {0: 'CHASSIS_ADS_ERR_NOMAL', 1:
69 // 'CHASSIS_ADS_ERR_ADS_CAN_LOST', 2: 'CHASSIS_ADS_ERR_ADS_CAN_RECOVERY'},
70 // 'is_signed_var': False, 'len': 2, 'name': 'CHASSIS_ADS_ERR', 'offset': 0.0,
71 // 'order': 'intel', 'physical_range': '[0|2]', 'physical_unit': '',
72 // 'precision': 1.0, 'type': 'enum'}
74 const std::uint8_t* bytes, const int32_t length) const;
75
76 // config detail: {'bit': 50, 'enum': {0: 'CHASSIS_BMS_CAN_NORMAL', 1:
77 // 'CHASSIS_BMS_CAN_ERROR'}, 'is_signed_var': False, 'len': 1, 'name':
78 // 'CHASSIS_BMS_CAN', 'offset': 0.0, 'order': 'intel', 'physical_range':
79 // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
81 const std::uint8_t* bytes, const int32_t length) const;
82
83 // config detail: {'bit': 51, 'enum': {0: 'CHASSIS_EHB_CAN_NORMAL', 1:
84 // 'CHASSIS_EHB_CAN_ERROR'}, 'is_signed_var': False, 'len': 1, 'name':
85 // 'CHASSIS_EHB_CAN', 'offset': 0.0, 'order': 'intel', 'physical_range':
86 // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
88 const std::uint8_t* bytes, const int32_t length) const;
89
90 // config detail: {'bit': 52, 'enum': {0: 'CHASSIS_EHB_ERR_NORMAL', 1:
91 // 'CHASSIS_EHB_ERR_ERROR'}, 'is_signed_var': False, 'len': 1, 'name':
92 // 'CHASSIS_EHB_ERR', 'offset': 0.0, 'order': 'intel', 'physical_range':
93 // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
95 const std::uint8_t* bytes, const int32_t length) const;
96
97 // config detail: {'bit': 53, 'enum': {0: 'CHASSIS_EPS_CAN_NORMAL', 1:
98 // 'CHASSIS_EPS_CAN_ERROR'}, 'is_signed_var': False, 'len': 1, 'name':
99 // 'CHASSIS_EPS_CAN', 'offset': 0.0, 'order': 'intel', 'physical_range':
100 // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
102 const std::uint8_t* bytes, const int32_t length) const;
103
104 // config detail: {'bit': 54, 'enum': {0: 'CHASSIS_EPS_ERR_NORMAL', 1:
105 // 'CHASSIS_EPS_ERR_ERROR'}, 'is_signed_var': False, 'len': 1, 'name':
106 // 'CHASSIS_EPS_ERR', 'offset': 0.0, 'order': 'intel', 'physical_range':
107 // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
109 const std::uint8_t* bytes, const int32_t length) const;
110
111 // config detail: {'bit': 55, 'enum': {0: 'CHASSIS_HW_LOST_NORMAL', 1:
112 // 'CHASSIS_HW_LOST_ERROR'}, 'is_signed_var': False, 'len': 1, 'name':
113 // 'CHASSIS_HW_Lost', 'offset': 0.0, 'order': 'intel', 'physical_range':
114 // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
116 const std::uint8_t* bytes, const int32_t length) const;
117
118 // config detail: {'bit': 56, 'enum': {0: 'CHASSIS_MCU_CAN_NORMAL', 1:
119 // 'CHASSIS_MCU_CAN_ERROR'}, 'is_signed_var': False, 'len': 1, 'name':
120 // 'CHASSIS_MCU_CAN', 'offset': 0.0, 'order': 'intel', 'physical_range':
121 // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
123 const std::uint8_t* bytes, const int32_t length) const;
124
125 // config detail: {'bit': 57, 'enum': {0: 'CHASSIS_MCU_ERR_NORMAL', 1:
126 // 'CHASSIS_MCU_ERR_ERROR'}, 'is_signed_var': False, 'len': 1, 'name':
127 // 'CHASSIS_MCU_ERR', 'offset': 0.0, 'order': 'intel', 'physical_range':
128 // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
130 const std::uint8_t* bytes, const int32_t length) const;
131};
132
133} // namespace ch
134} // namespace canbus
135} // namespace apollo
void Parse(const std::uint8_t *bytes, int32_t length, Ch *chassis) const override
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData