Apollo 10.0
自动驾驶开放平台
door_rpt_417.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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 lexus {
27
28using ::apollo::drivers::canbus::Byte;
29
31const int32_t Doorrpt417::ID = 0x417;
32
33void Doorrpt417::Parse(const std::uint8_t* bytes, int32_t length,
34 Lexus* chassis) const {
35 chassis->mutable_door_rpt_417()->set_fuel_door_open_is_valid(
36 fuel_door_open_is_valid(bytes, length));
37 chassis->mutable_door_rpt_417()->set_trunk_open_is_valid(
38 trunk_open_is_valid(bytes, length));
39 chassis->mutable_door_rpt_417()->set_hood_open_is_valid(
40 hood_open_is_valid(bytes, length));
41 chassis->mutable_door_rpt_417()->set_rear_pass_door_open_is_valid(
42 rear_pass_door_open_is_valid(bytes, length));
43 chassis->mutable_door_rpt_417()->set_rear_driver_door_open_is_valid(
44 rear_driver_door_open_is_valid(bytes, length));
45 chassis->mutable_door_rpt_417()->set_pass_door_open_is_valid(
46 pass_door_open_is_valid(bytes, length));
47 chassis->mutable_door_rpt_417()->set_driver_door_open_is_valid(
48 driver_door_open_is_valid(bytes, length));
49 chassis->mutable_door_rpt_417()->set_fuel_door_open(
50 fuel_door_open(bytes, length));
51 chassis->mutable_door_rpt_417()->set_trunk_open(
52 trunk_open(bytes, length));
53 chassis->mutable_door_rpt_417()->set_hood_open(
54 hood_open(bytes, length));
55 chassis->mutable_door_rpt_417()->set_rear_pass_door_open(
56 rear_pass_door_open(bytes, length));
57 chassis->mutable_door_rpt_417()->set_rear_driver_door_open(
58 rear_driver_door_open(bytes, length));
59 chassis->mutable_door_rpt_417()->set_pass_door_open(
60 pass_door_open(bytes, length));
61 chassis->mutable_door_rpt_417()->set_driver_door_open(
62 driver_door_open(bytes, length));
63}
64
65// config detail: {'name': 'fuel_door_open_is_valid', 'offset': 0.0,
66// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
67// '[0|1]', 'bit': 14, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
68bool Doorrpt417::fuel_door_open_is_valid(const std::uint8_t* bytes,
69 int32_t length) const {
70 Byte t0(bytes + 1);
71 int32_t x = t0.get_byte(6, 1);
72
73 bool ret = x;
74 return ret;
75}
76
77// config detail: {'name': 'trunk_open_is_valid', 'offset': 0.0,
78// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
79// '[0|1]', 'bit': 13, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
80bool Doorrpt417::trunk_open_is_valid(const std::uint8_t* bytes,
81 int32_t length) const {
82 Byte t0(bytes + 1);
83 int32_t x = t0.get_byte(5, 1);
84
85 bool ret = x;
86 return ret;
87}
88
89// config detail: {'name': 'hood_open_is_valid', 'offset': 0.0,
90// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
91// '[0|1]', 'bit': 12, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
92bool Doorrpt417::hood_open_is_valid(const std::uint8_t* bytes,
93 int32_t length) const {
94 Byte t0(bytes + 1);
95 int32_t x = t0.get_byte(4, 1);
96
97 bool ret = x;
98 return ret;
99}
100
101// config detail: {'name': 'rear_pass_door_open_is_valid', 'offset': 0.0,
102// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
103// '[0|1]', 'bit': 11, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
104bool Doorrpt417::rear_pass_door_open_is_valid(const std::uint8_t* bytes,
105 int32_t length) const {
106 Byte t0(bytes + 1);
107 int32_t x = t0.get_byte(3, 1);
108
109 bool ret = x;
110 return ret;
111}
112
113// config detail: {'name': 'rear_driver_door_open_is_valid', 'offset': 0.0,
114// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
115// '[0|1]', 'bit': 10, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
116bool Doorrpt417::rear_driver_door_open_is_valid(const std::uint8_t* bytes,
117 int32_t length) const {
118 Byte t0(bytes + 1);
119 int32_t x = t0.get_byte(2, 1);
120
121 bool ret = x;
122 return ret;
123}
124
125// config detail: {'name': 'pass_door_open_is_valid', 'offset': 0.0,
126// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
127// '[0|1]', 'bit': 9, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
128bool Doorrpt417::pass_door_open_is_valid(const std::uint8_t* bytes,
129 int32_t length) const {
130 Byte t0(bytes + 1);
131 int32_t x = t0.get_byte(1, 1);
132
133 bool ret = x;
134 return ret;
135}
136
137// config detail: {'name': 'driver_door_open_is_valid', 'offset': 0.0,
138// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
139// '[0|1]', 'bit': 8, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
140bool Doorrpt417::driver_door_open_is_valid(const std::uint8_t* bytes,
141 int32_t length) const {
142 Byte t0(bytes + 1);
143 int32_t x = t0.get_byte(0, 1);
144
145 bool ret = x;
146 return ret;
147}
148
149// config detail: {'name': 'fuel_door_open', 'offset': 0.0, 'precision': 1.0,
150// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 6,
151// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
152bool Doorrpt417::fuel_door_open(const std::uint8_t* bytes,
153 int32_t length) const {
154 Byte t0(bytes + 0);
155 int32_t x = t0.get_byte(6, 1);
156
157 bool ret = x;
158 return ret;
159}
160
161// config detail: {'name': 'trunk_open', 'offset': 0.0, 'precision': 1.0, 'len':
162// 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 5, 'type':
163// 'bool', 'order': 'motorola', 'physical_unit': ''}
164bool Doorrpt417::trunk_open(const std::uint8_t* bytes, int32_t length) const {
165 Byte t0(bytes + 0);
166 int32_t x = t0.get_byte(5, 1);
167
168 bool ret = x;
169 return ret;
170}
171
172// config detail: {'name': 'hood_open', 'offset': 0.0, 'precision': 1.0, 'len':
173// 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 4, 'type':
174// 'bool', 'order': 'motorola', 'physical_unit': ''}
175bool Doorrpt417::hood_open(const std::uint8_t* bytes, int32_t length) const {
176 Byte t0(bytes + 0);
177 int32_t x = t0.get_byte(4, 1);
178
179 bool ret = x;
180 return ret;
181}
182
183// config detail: {'name': 'rear_pass_door_open', 'offset': 0.0,
184// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
185// '[0|1]', 'bit': 3, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
186bool Doorrpt417::rear_pass_door_open(const std::uint8_t* bytes,
187 int32_t length) const {
188 Byte t0(bytes + 0);
189 int32_t x = t0.get_byte(3, 1);
190
191 bool ret = x;
192 return ret;
193}
194
195// config detail: {'name': 'rear_driver_door_open', 'offset': 0.0,
196// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
197// '[0|1]', 'bit': 2, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
198bool Doorrpt417::rear_driver_door_open(const std::uint8_t* bytes,
199 int32_t length) const {
200 Byte t0(bytes + 0);
201 int32_t x = t0.get_byte(2, 1);
202
203 bool ret = x;
204 return ret;
205}
206
207// config detail: {'name': 'pass_door_open', 'offset': 0.0, 'precision': 1.0,
208// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 1,
209// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
210bool Doorrpt417::pass_door_open(const std::uint8_t* bytes,
211 int32_t length) const {
212 Byte t0(bytes + 0);
213 int32_t x = t0.get_byte(1, 1);
214
215 bool ret = x;
216 return ret;
217}
218
219// config detail: {'name': 'driver_door_open', 'offset': 0.0, 'precision': 1.0,
220// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0,
221// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
222bool Doorrpt417::driver_door_open(const std::uint8_t* bytes,
223 int32_t length) const {
224 Byte t0(bytes + 0);
225 int32_t x = t0.get_byte(0, 1);
226
227 bool ret = x;
228 return ret;
229}
230} // namespace lexus
231} // namespace canbus
232} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Lexus *chassis) const override
class register implement
Definition arena_queue.h:37