Apollo 10.0
自动驾驶开放平台
dash_controls_left_rpt_20c.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 Dashcontrolsleftrpt20c::ID = 0x20C;
32
33void Dashcontrolsleftrpt20c::Parse(const std::uint8_t* bytes, int32_t length,
34 Lexus* chassis) const {
35 chassis->mutable_dash_controls_left_rpt_20c()->set_output_value(
36 output_value(bytes, length));
37 chassis->mutable_dash_controls_left_rpt_20c()->set_commanded_value(
38 commanded_value(bytes, length));
39 chassis->mutable_dash_controls_left_rpt_20c()->set_manual_input(
40 manual_input(bytes, length));
41 chassis->mutable_dash_controls_left_rpt_20c()->set_vehicle_fault(
42 vehicle_fault(bytes, length));
43 chassis->mutable_dash_controls_left_rpt_20c()->set_pacmod_fault(
44 pacmod_fault(bytes, length));
45 chassis->mutable_dash_controls_left_rpt_20c()->set_override_active(
46 override_active(bytes, length));
47 chassis->mutable_dash_controls_left_rpt_20c()->set_output_reported_fault(
48 output_reported_fault(bytes, length));
49 chassis->mutable_dash_controls_left_rpt_20c()->set_input_output_fault(
50 input_output_fault(bytes, length));
51 chassis->mutable_dash_controls_left_rpt_20c()->set_enabled(
52 enabled(bytes, length));
53 chassis->mutable_dash_controls_left_rpt_20c()->set_command_output_fault(
54 command_output_fault(bytes, length));
55}
56
57// config detail: {'name': 'output_value', 'enum': {0:
58// 'OUTPUT_VALUE_DASH_CONTROL_NONE', 1: 'OUTPUT_VALUE_DASH_CONTROL_OK', 2:
59// 'OUTPUT_VALUE_DASH_CONTROL_LEFT', 3: 'OUTPUT_VALUE_DASH_CONTROL_RIGHT', 4:
60// 'OUTPUT_VALUE_DASH_CONTROL_UP', 5: 'OUTPUT_VALUE_DASH_CONTROL_DOWN'},
61// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
62// 'physical_range': '[0|255]', 'bit': 31, 'type': 'enum', 'order': 'motorola',
63// 'physical_unit': ''}
65Dashcontrolsleftrpt20c::output_value(const std::uint8_t* bytes,
66 int32_t length) const {
67 Byte t0(bytes + 3);
68 int32_t x = t0.get_byte(0, 8);
69
72 return ret;
73}
74
75// config detail: {'name': 'commanded_value', 'enum': {0:
76// 'COMMANDED_VALUE_DASH_CONTROL_NONE', 1: 'COMMANDED_VALUE_DASH_CONTROL_OK', 2:
77// 'COMMANDED_VALUE_DASH_CONTROL_LEFT', 3: 'COMMANDED_VALUE_DASH_CONTROL_RIGHT',
78// 4: 'COMMANDED_VALUE_DASH_CONTROL_UP', 5:
79// 'COMMANDED_VALUE_DASH_CONTROL_DOWN'}, 'precision': 1.0, 'len': 8,
80// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|255]', 'bit':
81// 23, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
83Dashcontrolsleftrpt20c::commanded_value(const std::uint8_t* bytes,
84 int32_t length) const {
85 Byte t0(bytes + 2);
86 int32_t x = t0.get_byte(0, 8);
87
90 return ret;
91}
92
93// config detail: {'name': 'manual_input', 'enum': {0:
94// 'MANUAL_INPUT_DASH_CONTROL_NONE', 1: 'MANUAL_INPUT_DASH_CONTROL_OK', 2:
95// 'MANUAL_INPUT_DASH_CONTROL_LEFT', 3: 'MANUAL_INPUT_DASH_CONTROL_RIGHT', 4:
96// 'MANUAL_INPUT_DASH_CONTROL_UP', 5: 'MANUAL_INPUT_DASH_CONTROL_DOWN'},
97// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
98// 'physical_range': '[0|255]', 'bit': 15, 'type': 'enum', 'order': 'motorola',
99// 'physical_unit': ''}
101Dashcontrolsleftrpt20c::manual_input(const std::uint8_t* bytes,
102 int32_t length) const {
103 Byte t0(bytes + 1);
104 int32_t x = t0.get_byte(0, 8);
105
108 return ret;
109}
110
111// config detail: {'name': 'vehicle_fault', 'offset': 0.0, 'precision': 1.0,
112// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 6,
113// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
114bool Dashcontrolsleftrpt20c::vehicle_fault(const std::uint8_t* bytes,
115 int32_t length) const {
116 Byte t0(bytes + 0);
117 int32_t x = t0.get_byte(6, 1);
118
119 bool ret = x;
120 return ret;
121}
122
123// config detail: {'name': 'pacmod_fault', 'offset': 0.0, 'precision': 1.0,
124// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 5,
125// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
126bool Dashcontrolsleftrpt20c::pacmod_fault(const std::uint8_t* bytes,
127 int32_t length) const {
128 Byte t0(bytes + 0);
129 int32_t x = t0.get_byte(5, 1);
130
131 bool ret = x;
132 return ret;
133}
134
135// config detail: {'name': 'override_active', 'offset': 0.0, 'precision': 1.0,
136// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 1,
137// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
138bool Dashcontrolsleftrpt20c::override_active(const std::uint8_t* bytes,
139 int32_t length) const {
140 Byte t0(bytes + 0);
141 int32_t x = t0.get_byte(1, 1);
142
143 bool ret = x;
144 return ret;
145}
146
147// config detail: {'name': 'output_reported_fault', 'offset': 0.0,
148// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
149// '[0|1]', 'bit': 4, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
150bool Dashcontrolsleftrpt20c::output_reported_fault(const std::uint8_t* bytes,
151 int32_t length) const {
152 Byte t0(bytes + 0);
153 int32_t x = t0.get_byte(4, 1);
154
155 bool ret = x;
156 return ret;
157}
158
159// config detail: {'name': 'input_output_fault', 'offset': 0.0,
160// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
161// '[0|1]', 'bit': 3, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
162bool Dashcontrolsleftrpt20c::input_output_fault(const std::uint8_t* bytes,
163 int32_t length) const {
164 Byte t0(bytes + 0);
165 int32_t x = t0.get_byte(3, 1);
166
167 bool ret = x;
168 return ret;
169}
170
171// config detail: {'name': 'enabled', 'offset': 0.0, 'precision': 1.0, 'len': 1,
172// 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type': 'bool',
173// 'order': 'motorola', 'physical_unit': ''}
174bool Dashcontrolsleftrpt20c::enabled(const std::uint8_t* bytes,
175 int32_t length) const {
176 Byte t0(bytes + 0);
177 int32_t x = t0.get_byte(0, 1);
178
179 bool ret = x;
180 return ret;
181}
182
183// config detail: {'name': 'command_output_fault', 'offset': 0.0,
184// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
185// '[0|1]', 'bit': 2, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
186bool Dashcontrolsleftrpt20c::command_output_fault(const std::uint8_t* bytes,
187 int32_t length) const {
188 Byte t0(bytes + 0);
189 int32_t x = t0.get_byte(2, 1);
190
191 bool ret = x;
192 return ret;
193}
194} // namespace lexus
195} // namespace canbus
196} // 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