Apollo 10.0
自动驾驶开放平台
aeb_frontwheelspeed_353.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 Aebfrontwheelspeed353::ID = 0x353;
32
33void Aebfrontwheelspeed353::Parse(const std::uint8_t* bytes, int32_t length,
34 Neolix_edu* chassis) const {
35 chassis->mutable_aeb_frontwheelspeed_353()->set_vehiclespeedvalid(
36 vehiclespeedvalid(bytes, length));
37 chassis->mutable_aeb_frontwheelspeed_353()->set_vehiclespeed(
38 vehiclespeed(bytes, length));
39 chassis->mutable_aeb_frontwheelspeed_353()->set_vehiclerealdirect(
40 vehiclerealdirect(bytes, length));
41 chassis->mutable_aeb_frontwheelspeed_353()->set_wheelspeed_fl_valid(
42 wheelspeed_fl_valid(bytes, length));
43 chassis->mutable_aeb_frontwheelspeed_353()->set_wheelspeed_fl(
44 wheelspeed_fl(bytes, length));
45 chassis->mutable_aeb_frontwheelspeed_353()->set_wheelspeed_fr_valid(
46 wheelspeed_fr_valid(bytes, length));
47 chassis->mutable_aeb_frontwheelspeed_353()->set_wheelspeed_fr(
48 wheelspeed_fr(bytes, length));
49 chassis->mutable_aeb_frontwheelspeed_353()->set_wheelspeed_fl_direct(
50 wheelspeed_fl_direct(bytes, length));
51 chassis->mutable_aeb_frontwheelspeed_353()->set_wheelspeed_fr_direct(
52 wheelspeed_fr_direct(bytes, length));
53 chassis->mutable_aeb_frontwheelspeed_353()->set_alivecounter_front(
54 alivecounter_front(bytes, length));
55 chassis->mutable_aeb_frontwheelspeed_353()->set_checksum_front(
56 checksum_front(bytes, length));
57}
58
59// config detail: {'description': '0x0:Invalid;0x1:Valid', 'offset': 0.0,
60// 'precision': 1.0, 'len': 1, 'name': 'vehiclespeedvalid', 'is_signed_var':
61// False, 'physical_range': '[0.0|1.0]', 'bit': 7, 'type': 'bool', 'order':
62// 'motorola', 'physical_unit': 'bit'}
63bool Aebfrontwheelspeed353::vehiclespeedvalid(const std::uint8_t* bytes,
64 int32_t length) const {
65 Byte t0(bytes + 0);
66 int32_t x = t0.get_byte(7, 1);
67
68 bool ret = x;
69 return ret;
70}
71
72// config detail: {'name': 'vehiclespeed', 'offset': 0.0, 'precision': 0.05625,
73// 'len': 13, 'is_signed_var': False, 'physical_range': '[0.0|460.69]', 'bit':
74// 4, 'type': 'double', 'order': 'motorola', 'physical_unit': 'Km/h'}
75double Aebfrontwheelspeed353::vehiclespeed(const std::uint8_t* bytes,
76 int32_t length) const {
77 Byte t0(bytes + 0);
78 int32_t x = t0.get_byte(0, 5);
79
80 Byte t1(bytes + 1);
81 int32_t t = t1.get_byte(0, 8);
82 x <<= 8;
83 x |= t;
84
85 double ret = x * 0.056250;
86 return ret;
87}
88
89// config detail: {'description': '0x0:Invalid;0x1:D;0x2:N;0x3:R', 'offset':
90// 0.0, 'precision': 1.0, 'len': 2, 'name': 'vehiclerealdirect',
91// 'is_signed_var': False, 'physical_range': '[0.0|3.0]', 'bit': 6, 'type':
92// 'double', 'order': 'motorola', 'physical_unit': 'bit'}
93double Aebfrontwheelspeed353::vehiclerealdirect(const std::uint8_t* bytes,
94 int32_t length) const {
95 Byte t0(bytes + 0);
96 int32_t x = t0.get_byte(5, 2);
97
98 double ret = x;
99 return ret;
100}
101
102// config detail: {'description': '0x0:Invalid;0x1:Valid', 'offset': 0.0,
103// 'precision': 1.0, 'len': 1, 'name': 'wheelspeed_fl_valid', 'is_signed_var':
104// False, 'physical_range': '[0.0|1.0]', 'bit': 23, 'type': 'bool', 'order':
105// 'motorola', 'physical_unit': 'bit'}
106bool Aebfrontwheelspeed353::wheelspeed_fl_valid(const std::uint8_t* bytes,
107 int32_t length) const {
108 Byte t0(bytes + 2);
109 int32_t x = t0.get_byte(7, 1);
110
111 bool ret = x;
112 return ret;
113}
114
115// config detail: {'name': 'wheelspeed_fl', 'offset': 0.0, 'precision': 0.01,
116// 'len': 15, 'is_signed_var': False, 'physical_range': '[0.0|327.67]', 'bit':
117// 22, 'type': 'double', 'order': 'motorola', 'physical_unit': 'km/h'}
118double Aebfrontwheelspeed353::wheelspeed_fl(const std::uint8_t* bytes,
119 int32_t length) const {
120 Byte t0(bytes + 2);
121 int32_t x = t0.get_byte(0, 7);
122
123 Byte t1(bytes + 3);
124 int32_t t = t1.get_byte(0, 8);
125 x <<= 8;
126 x |= t;
127
128 double ret = x * 0.010000;
129 return ret;
130}
131
132// config detail: {'description': '0x0:Invalid;0x1:Valid', 'offset': 0.0,
133// 'precision': 1.0, 'len': 1, 'name': 'wheelspeed_fr_valid', 'is_signed_var':
134// False, 'physical_range': '[0.0|1.0]', 'bit': 39, 'type': 'bool', 'order':
135// 'motorola', 'physical_unit': 'bit'}
136bool Aebfrontwheelspeed353::wheelspeed_fr_valid(const std::uint8_t* bytes,
137 int32_t length) const {
138 Byte t0(bytes + 4);
139 int32_t x = t0.get_byte(7, 1);
140
141 bool ret = x;
142 return ret;
143}
144
145// config detail: {'name': 'wheelspeed_fr', 'offset': 0.0, 'precision': 0.01,
146// 'len': 15, 'is_signed_var': False, 'physical_range': '[0.0|327.67]', 'bit':
147// 38, 'type': 'double', 'order': 'motorola', 'physical_unit': 'km/h'}
148double Aebfrontwheelspeed353::wheelspeed_fr(const std::uint8_t* bytes,
149 int32_t length) const {
150 Byte t0(bytes + 4);
151 int32_t x = t0.get_byte(0, 7);
152
153 Byte t1(bytes + 5);
154 int32_t t = t1.get_byte(0, 8);
155 x <<= 8;
156 x |= t;
157
158 double ret = x * 0.010000;
159 return ret;
160}
161
162// config detail: {'description': '0x0:Invalid;0x1:D;0x2:N;0x3:R', 'offset':
163// 0.0, 'precision': 1.0, 'len': 2, 'name': 'wheelspeed_fl_direct',
164// 'is_signed_var': False, 'physical_range': '[0.0|3.0]', 'bit': 53, 'type':
165// 'double', 'order': 'motorola', 'physical_unit': 'bit'}
166double Aebfrontwheelspeed353::wheelspeed_fl_direct(const std::uint8_t* bytes,
167 int32_t length) const {
168 Byte t0(bytes + 6);
169 int32_t x = t0.get_byte(4, 2);
170
171 double ret = x;
172 return ret;
173}
174
175// config detail: {'description': '0x0:Invalid;0x1:D;0x2:N;0x3:R', 'offset':
176// 0.0, 'precision': 1.0, 'len': 2, 'name': 'wheelspeed_fr_direct',
177// 'is_signed_var': False, 'physical_range': '[0.0|3.0]', 'bit': 55, 'type':
178// 'double', 'order': 'motorola', 'physical_unit': 'bit'}
179double Aebfrontwheelspeed353::wheelspeed_fr_direct(const std::uint8_t* bytes,
180 int32_t length) const {
181 Byte t0(bytes + 6);
182 int32_t x = t0.get_byte(6, 2);
183
184 double ret = x;
185 return ret;
186}
187
188// config detail: {'name': 'alivecounter_front', 'offset': 0.0,
189// 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
190// '[0.0|15.0]', 'bit': 51, 'type': 'double', 'order': 'motorola',
191// 'physical_unit': ''}
192double Aebfrontwheelspeed353::alivecounter_front(const std::uint8_t* bytes,
193 int32_t length) const {
194 Byte t0(bytes + 6);
195 int32_t x = t0.get_byte(0, 4);
196
197 double ret = x;
198 return ret;
199}
200
201// config detail: {'name': 'checksum_front', 'offset': 0.0, 'precision': 1.0,
202// 'len': 8, 'is_signed_var': False, 'physical_range': '[0.0|255.0]', 'bit': 63,
203// 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
204double Aebfrontwheelspeed353::checksum_front(const std::uint8_t* bytes,
205 int32_t length) const {
206 Byte t0(bytes + 7);
207 int32_t x = t0.get_byte(0, 8);
208
209 double ret = x;
210 return ret;
211}
212} // namespace neolix_edu
213} // namespace canbus
214} // 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