Apollo 10.0
自动驾驶开放平台
aeb_systemstate_11.cc
浏览该文件的文档.
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
18
19#include "glog/logging.h"
20
23
24namespace apollo {
25namespace canbus {
26namespace neolix_edu {
27
28using ::apollo::drivers::canbus::Byte;
29
31const int32_t Aebsystemstate11::ID = 0x11;
32
33void Aebsystemstate11::Parse(const std::uint8_t* bytes, int32_t length,
34 Neolix_edu* chassis) const {
35 chassis->mutable_aeb_systemstate_11()->set_aeb_state(
36 aeb_state(bytes, length));
37 chassis->mutable_aeb_systemstate_11()->set_aeb_brakestate(
38 aeb_brakestate(bytes, length));
39 chassis->mutable_aeb_systemstate_11()->set_faultrank(
40 faultrank(bytes, length));
41 chassis->mutable_aeb_systemstate_11()->set_currenttemperature(
42 currenttemperature(bytes, length));
43 chassis->mutable_aeb_systemstate_11()->set_pas_f1_stop(
44 pas_f1_stop(bytes, length));
45 chassis->mutable_aeb_systemstate_11()->set_pas_f2_stop(
46 pas_f2_stop(bytes, length));
47 chassis->mutable_aeb_systemstate_11()->set_pas_f3_stop(
48 pas_f3_stop(bytes, length));
49 chassis->mutable_aeb_systemstate_11()->set_pas_f4_stop(
50 pas_f4_stop(bytes, length));
51 chassis->mutable_aeb_systemstate_11()->set_pas_b1_stop(
52 pas_b1_stop(bytes, length));
53 chassis->mutable_aeb_systemstate_11()->set_pas_b2_stop(
54 pas_b2_stop(bytes, length));
55 chassis->mutable_aeb_systemstate_11()->set_pas_b3_stop(
56 pas_b3_stop(bytes, length));
57 chassis->mutable_aeb_systemstate_11()->set_pas_b4_stop(
58 pas_b4_stop(bytes, length));
59 chassis->mutable_aeb_systemstate_11()->set_aeb_livecounter_rear(
60 aeb_livecounter_rear(bytes, length));
61 chassis->mutable_aeb_systemstate_11()->set_aeb_cheksum(
62 aeb_cheksum(bytes, length));
63}
64
65// config detail: {'description': '0x00:read only;0x01:brake enable', 'offset':
66// 0.0, 'precision': 1.0, 'len': 2, 'name': 'aeb_state', 'is_signed_var': False,
67// 'physical_range': '[0|1]', 'bit': 1, 'type': 'int', 'order': 'motorola',
68// 'physical_unit': ''}
69int Aebsystemstate11::aeb_state(const std::uint8_t* bytes,
70 int32_t length) const {
71 Byte t0(bytes + 0);
72 int32_t x = t0.get_byte(0, 2);
73
74 int ret = x;
75 return ret;
76}
77
78// config detail: {'description': '0x00:off;0x01:on', 'offset': 0.0,
79// 'precision': 1.0, 'len': 1, 'name': 'aeb_brakestate', 'is_signed_var': False,
80// 'physical_range': '[0|1]', 'bit': 2, 'type': 'bool', 'order': 'motorola',
81// 'physical_unit': ''}
82bool Aebsystemstate11::aeb_brakestate(const std::uint8_t* bytes,
83 int32_t length) const {
84 Byte t0(bytes + 0);
85 int32_t x = t0.get_byte(2, 1);
86
87 bool ret = x;
88 return ret;
89}
90
91// config detail: {'description': '0x0:Nomal;0x1:Level 1;0x2:Level 2;0x3:Level
92// 3;0x4:Level 4;0x5:Level 5;0x6:Reserved;0x7:Reserved', 'offset': 0.0,
93// 'precision': 1.0, 'len': 3, 'name': 'faultrank', 'is_signed_var': False,
94// 'physical_range': '[0|5]', 'bit': 10, 'type': 'int', 'order': 'motorola',
95// 'physical_unit': ''}
96int Aebsystemstate11::faultrank(const std::uint8_t* bytes,
97 int32_t length) const {
98 Byte t0(bytes + 1);
99 int32_t x = t0.get_byte(0, 3);
100
101 int ret = x;
102 return ret;
103}
104
105// config detail: {'name': 'currenttemperature', 'offset': -40.0,
106// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
107// '[0|120]', 'bit': 23, 'type': 'int', 'order': 'motorola', 'physical_unit':
108// ''}
109int Aebsystemstate11::currenttemperature(const std::uint8_t* bytes,
110 int32_t length) const {
111 Byte t0(bytes + 2);
112 int32_t x = t0.get_byte(0, 8);
113
114 int ret = x + -40.000000;
115 return ret;
116}
117
118// config detail: {'description': '0x0:Normal;0x1:ActivateBrake', 'offset': 0.0,
119// 'precision': 1.0, 'len': 1, 'name': 'pas_f1_stop', 'is_signed_var': False,
120// 'physical_range': '[0|1]', 'bit': 24, 'type': 'bool', 'order': 'motorola',
121// 'physical_unit': ''}
122bool Aebsystemstate11::pas_f1_stop(const std::uint8_t* bytes,
123 int32_t length) const {
124 Byte t0(bytes + 3);
125 int32_t x = t0.get_byte(0, 1);
126
127 bool ret = x;
128 return ret;
129}
130
131// config detail: {'description': '0x0:Normal;0x1:ActivateBrake', 'offset': 0.0,
132// 'precision': 1.0, 'len': 1, 'name': 'pas_f2_stop', 'is_signed_var': False,
133// 'physical_range': '[0|1]', 'bit': 25, 'type': 'bool', 'order': 'motorola',
134// 'physical_unit': ''}
135bool Aebsystemstate11::pas_f2_stop(const std::uint8_t* bytes,
136 int32_t length) const {
137 Byte t0(bytes + 3);
138 int32_t x = t0.get_byte(1, 1);
139
140 bool ret = x;
141 return ret;
142}
143
144// config detail: {'description': '0x0:Normal;0x1:ActivateBrake', 'offset': 0.0,
145// 'precision': 1.0, 'len': 1, 'name': 'pas_f3_stop', 'is_signed_var': False,
146// 'physical_range': '[0|1]', 'bit': 26, 'type': 'bool', 'order': 'motorola',
147// 'physical_unit': ''}
148bool Aebsystemstate11::pas_f3_stop(const std::uint8_t* bytes,
149 int32_t length) const {
150 Byte t0(bytes + 3);
151 int32_t x = t0.get_byte(2, 1);
152
153 bool ret = x;
154 return ret;
155}
156
157// config detail: {'description': '0x0:Normal;0x1:ActivateBrake', 'offset': 0.0,
158// 'precision': 1.0, 'len': 1, 'name': 'pas_f4_stop', 'is_signed_var': False,
159// 'physical_range': '[0|1]', 'bit': 27, 'type': 'bool', 'order': 'motorola',
160// 'physical_unit': ''}
161bool Aebsystemstate11::pas_f4_stop(const std::uint8_t* bytes,
162 int32_t length) const {
163 Byte t0(bytes + 3);
164 int32_t x = t0.get_byte(3, 1);
165
166 bool ret = x;
167 return ret;
168}
169
170// config detail: {'description': '0x0:Normal;0x1:ActivateBrake', 'offset': 0.0,
171// 'precision': 1.0, 'len': 1, 'name': 'pas_b1_stop', 'is_signed_var': False,
172// 'physical_range': '[0|1]', 'bit': 28, 'type': 'bool', 'order': 'motorola',
173// 'physical_unit': ''}
174bool Aebsystemstate11::pas_b1_stop(const std::uint8_t* bytes,
175 int32_t length) const {
176 Byte t0(bytes + 3);
177 int32_t x = t0.get_byte(4, 1);
178
179 bool ret = x;
180 return ret;
181}
182
183// config detail: {'description': '0x0:Normal;0x1:ActivateBrake', 'offset': 0.0,
184// 'precision': 1.0, 'len': 1, 'name': 'pas_b2_stop', 'is_signed_var': False,
185// 'physical_range': '[0|1]', 'bit': 29, 'type': 'bool', 'order': 'motorola',
186// 'physical_unit': ''}
187bool Aebsystemstate11::pas_b2_stop(const std::uint8_t* bytes,
188 int32_t length) const {
189 Byte t0(bytes + 3);
190 int32_t x = t0.get_byte(5, 1);
191
192 bool ret = x;
193 return ret;
194}
195
196// config detail: {'description': '0x0:Normal;0x1:ActivateBrake', 'offset': 0.0,
197// 'precision': 1.0, 'len': 1, 'name': 'pas_b3_stop', 'is_signed_var': False,
198// 'physical_range': '[0|1]', 'bit': 30, 'type': 'bool', 'order': 'motorola',
199// 'physical_unit': ''}
200bool Aebsystemstate11::pas_b3_stop(const std::uint8_t* bytes,
201 int32_t length) const {
202 Byte t0(bytes + 3);
203 int32_t x = t0.get_byte(6, 1);
204
205 bool ret = x;
206 return ret;
207}
208
209// config detail: {'description': '0x0:Normal;0x1:ActivateBrake', 'offset': 0.0,
210// 'precision': 1.0, 'len': 1, 'name': 'pas_b4_stop', 'is_signed_var': False,
211// 'physical_range': '[0|1]', 'bit': 31, 'type': 'bool', 'order': 'motorola',
212// 'physical_unit': ''}
213bool Aebsystemstate11::pas_b4_stop(const std::uint8_t* bytes,
214 int32_t length) const {
215 Byte t0(bytes + 3);
216 int32_t x = t0.get_byte(7, 1);
217
218 bool ret = x;
219 return ret;
220}
221
222// config detail: {'name': 'aeb_livecounter_rear', 'offset': 0.0,
223// 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
224// '[0|15]', 'bit': 51, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
225int Aebsystemstate11::aeb_livecounter_rear(const std::uint8_t* bytes,
226 int32_t length) const {
227 Byte t0(bytes + 6);
228 int32_t x = t0.get_byte(0, 4);
229
230 int ret = x;
231 return ret;
232}
233
234// config detail: {'name': 'aeb_cheksum', 'offset': 0.0, 'precision': 1.0,
235// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 63,
236// 'type': 'int', 'order': 'motorola', 'physical_unit': 'bit'}
237int Aebsystemstate11::aeb_cheksum(const std::uint8_t* bytes,
238 int32_t length) const {
239 Byte t0(bytes + 7);
240 int32_t x = t0.get_byte(0, 8);
241
242 int ret = x;
243 return ret;
244}
245} // namespace neolix_edu
246} // namespace canbus
247} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Neolix_edu *chassis) const override
class register implement
Definition arena_queue.h:37