Apollo 10.0
自动驾驶开放平台
scu_bcs_3_308.cc
浏览该文件的文档.
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
18#include "glog/logging.h"
21
22namespace apollo {
23namespace canbus {
24namespace ge3 {
25
26using ::apollo::drivers::canbus::Byte;
27
29const int32_t Scubcs3308::ID = 0x308;
30
31void Scubcs3308::Parse(const std::uint8_t* bytes, int32_t length,
32 Ge3* chassis) const {
33 chassis->mutable_scu_bcs_3_308()->set_bcs_rrwheelspdvd(
34 bcs_rrwheelspdvd(bytes, length));
35 chassis->mutable_scu_bcs_3_308()->set_bcs_rrwheeldirectionvd(
36 bcs_rrwheeldirectionvd(bytes, length));
37 chassis->mutable_scu_bcs_3_308()->set_bcs_rlwheelspdvd(
38 bcs_rlwheelspdvd(bytes, length));
39 chassis->mutable_scu_bcs_3_308()->set_bcs_rlwheeldirectionvd(
40 bcs_rlwheeldirectionvd(bytes, length));
41 chassis->mutable_scu_bcs_3_308()->set_bcs_frwheelspdvd(
42 bcs_frwheelspdvd(bytes, length));
43 chassis->mutable_scu_bcs_3_308()->set_bcs_frwheeldirectionvd(
44 bcs_frwheeldirectionvd(bytes, length));
45 chassis->mutable_scu_bcs_3_308()->set_bcs_flwheelspdvd(
46 bcs_flwheelspdvd(bytes, length));
47 chassis->mutable_scu_bcs_3_308()->set_bcs_flwheeldirectionvd(
48 bcs_flwheeldirectionvd(bytes, length));
49 chassis->mutable_scu_bcs_3_308()->set_bcs_rrwheelspd(
50 bcs_rrwheelspd(bytes, length));
51 chassis->mutable_scu_bcs_3_308()->set_bcs_rrwheeldirection(
52 bcs_rrwheeldirection(bytes, length));
53 chassis->mutable_scu_bcs_3_308()->set_bcs_rlwheelspd(
54 bcs_rlwheelspd(bytes, length));
55 chassis->mutable_scu_bcs_3_308()->set_bcs_rlwheeldirection(
56 bcs_rlwheeldirection(bytes, length));
57 chassis->mutable_scu_bcs_3_308()->set_bcs_frwheelspd(
58 bcs_frwheelspd(bytes, length));
59 chassis->mutable_scu_bcs_3_308()->set_bcs_frwheeldirection(
60 bcs_frwheeldirection(bytes, length));
61 chassis->mutable_scu_bcs_3_308()->set_bcs_flwheelspd(
62 bcs_flwheelspd(bytes, length));
63 chassis->mutable_scu_bcs_3_308()->set_bcs_flwheeldirection(
64 bcs_flwheeldirection(bytes, length));
65}
66
67// config detail: {'description': 'Rear right wheel speed valid data', 'enum':
68// {0: 'BCS_RRWHEELSPDVD_INVALID', 1: 'BCS_RRWHEELSPDVD_VALID'},
69// 'precision': 1.0, 'len': 1, 'name': 'bcs_rrwheelspdvd', 'is_signed_var':
70// False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 57, 'type': 'enum',
71// 'order': 'motorola', 'physical_unit': '-'}
72Scu_bcs_3_308::Bcs_rrwheelspdvdType Scubcs3308::bcs_rrwheelspdvd(
73 const std::uint8_t* bytes, int32_t length) const {
74 Byte t0(bytes + 7);
75 int32_t x = t0.get_byte(1, 1);
76
79 return ret;
80}
81
82// config detail: {'description': 'Rear right wheel speed direction valid data',
83// 'enum': {0: 'BCS_RRWHEELDIRECTIONVD_INVALID', 1:
84// 'BCS_RRWHEELDIRECTIONVD_VALID'}, 'precision': 1.0, 'len': 1, 'name':
85// 'bcs_rrwheeldirectionvd', 'is_signed_var': False, 'offset': 0.0,
86// 'physical_range': '[0|1]', 'bit': 58, 'type': 'enum', 'order': 'motorola',
87// 'physical_unit': '-'}
88Scu_bcs_3_308::Bcs_rrwheeldirectionvdType Scubcs3308::bcs_rrwheeldirectionvd(
89 const std::uint8_t* bytes, int32_t length) const {
90 Byte t0(bytes + 7);
91 int32_t x = t0.get_byte(2, 1);
92
95 return ret;
96}
97
98// config detail: {'description': 'Rear left wheel speed valid data', 'enum':
99// {0: 'BCS_RLWHEELSPDVD_INVALID', 1: 'BCS_RLWHEELSPDVD_VALID'},
100// 'precision': 1.0, 'len': 1, 'name': 'bcs_rlwheelspdvd', 'is_signed_var':
101// False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 41, 'type': 'enum',
102// 'order': 'motorola', 'physical_unit': '-'}
103Scu_bcs_3_308::Bcs_rlwheelspdvdType Scubcs3308::bcs_rlwheelspdvd(
104 const std::uint8_t* bytes, int32_t length) const {
105 Byte t0(bytes + 5);
106 int32_t x = t0.get_byte(1, 1);
107
110 return ret;
111}
112
113// config detail: {'description': 'Rear left wheel speed direction valid data',
114// 'enum': {0: 'BCS_RLWHEELDIRECTIONVD_INVALID', 1:
115// 'BCS_RLWHEELDIRECTIONVD_VALID'}, 'precision': 1.0, 'len': 1, 'name':
116// 'bcs_rlwheeldirectionvd', 'is_signed_var': False, 'offset': 0.0,
117// 'physical_range': '[0|1]', 'bit': 42, 'type': 'enum', 'order': 'motorola',
118// 'physical_unit': '-'}
119Scu_bcs_3_308::Bcs_rlwheeldirectionvdType Scubcs3308::bcs_rlwheeldirectionvd(
120 const std::uint8_t* bytes, int32_t length) const {
121 Byte t0(bytes + 5);
122 int32_t x = t0.get_byte(2, 1);
123
126 return ret;
127}
128
129// config detail: {'description': 'Front right wheel speed valid data', 'enum':
130// {0: 'BCS_FRWHEELSPDVD_INVALID', 1: 'BCS_FRWHEELSPDVD_VALID'},
131// 'precision': 1.0, 'len': 1, 'name': 'bcs_frwheelspdvd', 'is_signed_var':
132// False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 25, 'type': 'enum',
133// 'order': 'motorola', 'physical_unit': '-'}
134Scu_bcs_3_308::Bcs_frwheelspdvdType Scubcs3308::bcs_frwheelspdvd(
135 const std::uint8_t* bytes, int32_t length) const {
136 Byte t0(bytes + 3);
137 int32_t x = t0.get_byte(1, 1);
138
141 return ret;
142}
143
144// config detail: {'description': 'Front right wheel speed direction valid
145// data', 'enum': {0: 'BCS_FRWHEELDIRECTIONVD_INVALID', 1:
146// 'BCS_FRWHEELDIRECTIONVD_VALID'}, 'precision': 1.0, 'len': 1, 'name':
147// 'bcs_frwheeldirectionvd', 'is_signed_var': False, 'offset': 0.0,
148// 'physical_range': '[0|1]', 'bit': 26, 'type': 'enum', 'order': 'motorola',
149// 'physical_unit': '-'}
150Scu_bcs_3_308::Bcs_frwheeldirectionvdType Scubcs3308::bcs_frwheeldirectionvd(
151 const std::uint8_t* bytes, int32_t length) const {
152 Byte t0(bytes + 3);
153 int32_t x = t0.get_byte(2, 1);
154
157 return ret;
158}
159
160// config detail: {'description': 'Front left wheel speed valid data', 'enum':
161// {0: 'BCS_FLWHEELSPDVD_INVALID', 1: 'BCS_FLWHEELSPDVD_VALID'},
162// 'precision': 1.0, 'len': 1, 'name': 'bcs_flwheelspdvd', 'is_signed_var':
163// False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 9, 'type': 'enum',
164// 'order': 'motorola', 'physical_unit': '-'}
165Scu_bcs_3_308::Bcs_flwheelspdvdType Scubcs3308::bcs_flwheelspdvd(
166 const std::uint8_t* bytes, int32_t length) const {
167 Byte t0(bytes + 1);
168 int32_t x = t0.get_byte(1, 1);
169
172 return ret;
173}
174
175// config detail: {'description': 'Front left wheel speed direction valid data',
176// 'enum': {0: 'BCS_FLWHEELDIRECTIONVD_INVALID', 1:
177// 'BCS_FLWHEELDIRECTIONVD_VALID'}, 'precision': 1.0, 'len': 1, 'name':
178// 'bcs_flwheeldirectionvd', 'is_signed_var': False, 'offset': 0.0,
179// 'physical_range': '[0|1]', 'bit': 10, 'type': 'enum', 'order': 'motorola',
180// 'physical_unit': '-'}
181Scu_bcs_3_308::Bcs_flwheeldirectionvdType Scubcs3308::bcs_flwheeldirectionvd(
182 const std::uint8_t* bytes, int32_t length) const {
183 Byte t0(bytes + 1);
184 int32_t x = t0.get_byte(2, 1);
185
188 return ret;
189}
190
191// config detail: {'description': 'Rear right wheel speed', 'offset': 0.0,
192// 'precision': 0.05625, 'len': 13, 'name': 'bcs_rrwheelspd', 'is_signed_var':
193// False, 'physical_range': '[0|240]', 'bit': 55, 'type': 'double', 'order':
194// 'motorola', 'physical_unit': 'km/h'}
195double Scubcs3308::bcs_rrwheelspd(const std::uint8_t* bytes,
196 int32_t length) const {
197 Byte t0(bytes + 6);
198 int32_t x = t0.get_byte(0, 8);
199
200 Byte t1(bytes + 7);
201 int32_t t = t1.get_byte(3, 5);
202 x <<= 5;
203 x |= t;
204
205 double ret = x * 0.056250;
206 return ret;
207}
208
209// config detail: {'description': 'Rear right wheel speed direction', 'enum':
210// {0: 'BCS_RRWHEELDIRECTION_FORWARD', 1: 'BCS_RRWHEELDIRECTION_BACKWARD'},
211// 'precision': 1.0, 'len': 1, 'name': 'bcs_rrwheeldirection', 'is_signed_var':
212// False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 56, 'type': 'enum',
213// 'order': 'motorola', 'physical_unit': '-'}
214Scu_bcs_3_308::Bcs_rrwheeldirectionType Scubcs3308::bcs_rrwheeldirection(
215 const std::uint8_t* bytes, int32_t length) const {
216 Byte t0(bytes + 7);
217 int32_t x = t0.get_byte(0, 1);
218
221 return ret;
222}
223
224// config detail: {'description': 'Rear left wheel speed', 'offset': 0.0,
225// 'precision': 0.05625, 'len': 13, 'name': 'bcs_rlwheelspd', 'is_signed_var':
226// False, 'physical_range': '[0|240]', 'bit': 39, 'type': 'double', 'order':
227// 'motorola', 'physical_unit': 'km/h'}
228double Scubcs3308::bcs_rlwheelspd(const std::uint8_t* bytes,
229 int32_t length) const {
230 Byte t0(bytes + 4);
231 int32_t x = t0.get_byte(0, 8);
232
233 Byte t1(bytes + 5);
234 int32_t t = t1.get_byte(3, 5);
235 x <<= 5;
236 x |= t;
237
238 double ret = x * 0.056250;
239 return ret;
240}
241
242// config detail: {'description': 'Rear left wheel speed direction', 'enum': {0:
243// 'BCS_RLWHEELDIRECTION_FORWARD', 1: 'BCS_RLWHEELDIRECTION_BACKWARD'},
244// 'precision': 1.0, 'len': 1, 'name': 'bcs_rlwheeldirection', 'is_signed_var':
245// False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 40, 'type': 'enum',
246// 'order': 'motorola', 'physical_unit': '-'}
247Scu_bcs_3_308::Bcs_rlwheeldirectionType Scubcs3308::bcs_rlwheeldirection(
248 const std::uint8_t* bytes, int32_t length) const {
249 Byte t0(bytes + 5);
250 int32_t x = t0.get_byte(0, 1);
251
254 return ret;
255}
256
257// config detail: {'description': 'Front right wheel speed', 'offset': 0.0,
258// 'precision': 0.05625, 'len': 13, 'name': 'bcs_frwheelspd', 'is_signed_var':
259// False, 'physical_range': '[0|240]', 'bit': 23, 'type': 'double', 'order':
260// 'motorola', 'physical_unit': 'km/h'}
261double Scubcs3308::bcs_frwheelspd(const std::uint8_t* bytes,
262 int32_t length) const {
263 Byte t0(bytes + 2);
264 int32_t x = t0.get_byte(0, 8);
265
266 Byte t1(bytes + 3);
267 int32_t t = t1.get_byte(3, 5);
268 x <<= 5;
269 x |= t;
270
271 double ret = x * 0.056250;
272 return ret;
273}
274
275// config detail: {'description': 'Front right wheel speed direction', 'enum':
276// {0: 'BCS_FRWHEELDIRECTION_FORWARD', 1: 'BCS_FRWHEELDIRECTION_BACKWARD'},
277// 'precision': 1.0, 'len': 1, 'name': 'bcs_frwheeldirection', 'is_signed_var':
278// False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 24, 'type': 'enum',
279// 'order': 'motorola', 'physical_unit': '-'}
280Scu_bcs_3_308::Bcs_frwheeldirectionType Scubcs3308::bcs_frwheeldirection(
281 const std::uint8_t* bytes, int32_t length) const {
282 Byte t0(bytes + 3);
283 int32_t x = t0.get_byte(0, 1);
284
287 return ret;
288}
289
290// config detail: {'description': 'Front left wheel speed', 'offset': 0.0,
291// 'precision': 0.05625, 'len': 13, 'name': 'bcs_flwheelspd', 'is_signed_var':
292// False, 'physical_range': '[0|240]', 'bit': 7, 'type': 'double', 'order':
293// 'motorola', 'physical_unit': 'km/h'}
294double Scubcs3308::bcs_flwheelspd(const std::uint8_t* bytes,
295 int32_t length) const {
296 Byte t0(bytes + 0);
297 int32_t x = t0.get_byte(0, 8);
298
299 Byte t1(bytes + 1);
300 int32_t t = t1.get_byte(3, 5);
301 x <<= 5;
302 x |= t;
303
304 double ret = x * 0.056250;
305 return ret;
306}
307
308// config detail: {'description': 'Front left wheel speed direction', 'enum':
309// {0: 'BCS_FLWHEELDIRECTION_FORWARD', 1: 'BCS_FLWHEELDIRECTION_BACKWARD'},
310// 'precision': 1.0, 'len': 1, 'name': 'bcs_flwheeldirection', 'is_signed_var':
311// False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 8, 'type': 'enum',
312// 'order': 'motorola', 'physical_unit': '-'}
313Scu_bcs_3_308::Bcs_flwheeldirectionType Scubcs3308::bcs_flwheeldirection(
314 const std::uint8_t* bytes, int32_t length) const {
315 Byte t0(bytes + 1);
316 int32_t x = t0.get_byte(0, 1);
317
320 return ret;
321}
322} // namespace ge3
323} // namespace canbus
324} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Ge3 *chassis) const override
class register implement
Definition arena_queue.h:37