Apollo 10.0
自动驾驶开放平台
aeb_rearwheelspeed_354.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 Aebrearwheelspeed354::ID = 0x354;
32
33void Aebrearwheelspeed354::Parse(const std::uint8_t* bytes, int32_t length,
34 Neolix_edu* chassis) const {
35 chassis->mutable_aeb_rearwheelspeed_354()->set_wheelspeed_rl_valid(
36 wheelspeed_rl_valid(bytes, length));
37 chassis->mutable_aeb_rearwheelspeed_354()->set_wheelspeed_rl(
38 wheelspeed_rl(bytes, length));
39 chassis->mutable_aeb_rearwheelspeed_354()->set_wheelspeed_rr_valid(
40 wheelspeed_rr_valid(bytes, length));
41 chassis->mutable_aeb_rearwheelspeed_354()->set_wheelspeed_rr(
42 wheelspeed_rr(bytes, length));
43 chassis->mutable_aeb_rearwheelspeed_354()->set_wheelspeed_rl_direct(
44 wheelspeed_rl_direct(bytes, length));
45 chassis->mutable_aeb_rearwheelspeed_354()->set_wheelspeed_rr_direct(
46 wheelspeed_rr_direct(bytes, length));
47 chassis->mutable_aeb_rearwheelspeed_354()->set_alivecounter_rear(
48 alivecounter_rear(bytes, length));
49 chassis->mutable_aeb_rearwheelspeed_354()->set_checksum_rear(
50 checksum_rear(bytes, length));
51}
52
53// config detail: {'description': '0x0:Invalid;0x1:Valid', 'offset': 0.0,
54// 'precision': 1.0, 'len': 1, 'name': 'wheelspeed_rl_valid', 'is_signed_var':
55// False, 'physical_range': '[0.0|1.0]', 'bit': 23, 'type': 'bool', 'order':
56// 'motorola', 'physical_unit': 'bit'}
57bool Aebrearwheelspeed354::wheelspeed_rl_valid(const std::uint8_t* bytes,
58 int32_t length) const {
59 Byte t0(bytes + 2);
60 int32_t x = t0.get_byte(7, 1);
61
62 bool ret = x;
63 return ret;
64}
65
66// config detail: {'name': 'wheelspeed_rl', 'offset': 0.0, 'precision': 0.01,
67// 'len': 15, 'is_signed_var': False, 'physical_range': '[0.0|327.67]', 'bit':
68// 22, 'type': 'double', 'order': 'motorola', 'physical_unit': 'km/h'}
69double Aebrearwheelspeed354::wheelspeed_rl(const std::uint8_t* bytes,
70 int32_t length) const {
71 Byte t0(bytes + 2);
72 int32_t x = t0.get_byte(0, 7);
73
74 Byte t1(bytes + 3);
75 int32_t t = t1.get_byte(0, 8);
76 x <<= 8;
77 x |= t;
78
79 double ret = x * 0.010000;
80 return ret;
81}
82
83// config detail: {'description': '0x0:Invalid;0x1:Valid', 'offset': 0.0,
84// 'precision': 1.0, 'len': 1, 'name': 'wheelspeed_rr_valid', 'is_signed_var':
85// False, 'physical_range': '[0.0|1.0]', 'bit': 39, 'type': 'bool', 'order':
86// 'motorola', 'physical_unit': 'bit'}
87bool Aebrearwheelspeed354::wheelspeed_rr_valid(const std::uint8_t* bytes,
88 int32_t length) const {
89 Byte t0(bytes + 4);
90 int32_t x = t0.get_byte(7, 1);
91
92 bool ret = x;
93 return ret;
94}
95
96// config detail: {'name': 'wheelspeed_rr', 'offset': 0.0, 'precision': 0.01,
97// 'len': 15, 'is_signed_var': False, 'physical_range': '[0.0|327.67]', 'bit':
98// 38, 'type': 'double', 'order': 'motorola', 'physical_unit': 'km/h'}
99double Aebrearwheelspeed354::wheelspeed_rr(const std::uint8_t* bytes,
100 int32_t length) const {
101 Byte t0(bytes + 4);
102 int32_t x = t0.get_byte(0, 7);
103
104 Byte t1(bytes + 5);
105 int32_t t = t1.get_byte(0, 8);
106 x <<= 8;
107 x |= t;
108
109 double ret = x * 0.010000;
110 return ret;
111}
112
113// config detail: {'description': '0x0:Invalid;0x1:D;0x2:N;0x3:R', 'offset':
114// 0.0, 'precision': 1.0, 'len': 2, 'name': 'wheelspeed_rl_direct',
115// 'is_signed_var': False, 'physical_range': '[0.0|3.0]', 'bit': 53, 'type':
116// 'double', 'order': 'motorola', 'physical_unit': 'bit'}
117double Aebrearwheelspeed354::wheelspeed_rl_direct(const std::uint8_t* bytes,
118 int32_t length) const {
119 Byte t0(bytes + 6);
120 int32_t x = t0.get_byte(4, 2);
121
122 double ret = x;
123 return ret;
124}
125
126// config detail: {'description': '0x0:Invalid;0x1:D;0x2:N;0x3:R', 'offset':
127// 0.0, 'precision': 1.0, 'len': 2, 'name': 'wheelspeed_rr_direct',
128// 'is_signed_var': False, 'physical_range': '[0.0|3.0]', 'bit': 55, 'type':
129// 'double', 'order': 'motorola', 'physical_unit': 'bit'}
130double Aebrearwheelspeed354::wheelspeed_rr_direct(const std::uint8_t* bytes,
131 int32_t length) const {
132 Byte t0(bytes + 6);
133 int32_t x = t0.get_byte(6, 2);
134
135 double ret = x;
136 return ret;
137}
138
139// config detail: {'name': 'alivecounter_rear', 'offset': 0.0, 'precision': 1.0,
140// 'len': 4, 'is_signed_var': False, 'physical_range': '[0.0|15.0]', 'bit': 51,
141// 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
142double Aebrearwheelspeed354::alivecounter_rear(const std::uint8_t* bytes,
143 int32_t length) const {
144 Byte t0(bytes + 6);
145 int32_t x = t0.get_byte(0, 4);
146
147 double ret = x;
148 return ret;
149}
150
151// config detail: {'name': 'checksum_rear', 'offset': 0.0, 'precision': 1.0,
152// 'len': 8, 'is_signed_var': False, 'physical_range': '[0.0|255.0]', 'bit': 63,
153// 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
154double Aebrearwheelspeed354::checksum_rear(const std::uint8_t* bytes,
155 int32_t length) const {
156 Byte t0(bytes + 7);
157 int32_t x = t0.get_byte(0, 8);
158
159 double ret = x;
160 return ret;
161}
162} // namespace neolix_edu
163} // namespace canbus
164} // 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