Apollo 10.0
自动驾驶开放平台
cruise_control_buttons_rpt_208.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 Cruisecontrolbuttonsrpt208::ID = 0x208;
32
33void Cruisecontrolbuttonsrpt208::Parse(const std::uint8_t* bytes,
34 int32_t length,
35 Lexus* chassis) const {
36 chassis->mutable_cruise_control_buttons_rpt_208()->set_output_value(
37 output_value(bytes, length));
38 chassis->mutable_cruise_control_buttons_rpt_208()->set_manual_input(
39 manual_input(bytes, length));
40 chassis->mutable_cruise_control_buttons_rpt_208()->set_commanded_value(
41 commanded_value(bytes, length));
42 chassis->mutable_cruise_control_buttons_rpt_208()->set_vehicle_fault(
43 vehicle_fault(bytes, length));
44 chassis->mutable_cruise_control_buttons_rpt_208()->set_pacmod_fault(
45 pacmod_fault(bytes, length));
46 chassis->mutable_cruise_control_buttons_rpt_208()->set_override_active(
47 override_active(bytes, length));
48 chassis->mutable_cruise_control_buttons_rpt_208()->set_output_reported_fault(
49 output_reported_fault(bytes, length));
50 chassis->mutable_cruise_control_buttons_rpt_208()->set_input_output_fault(
51 input_output_fault(bytes, length));
52 chassis->mutable_cruise_control_buttons_rpt_208()->set_enabled(
53 enabled(bytes, length));
54 chassis->mutable_cruise_control_buttons_rpt_208()->set_command_output_fault(
55 command_output_fault(bytes, length));
56}
57
58// config detail: {'name': 'output_value', 'enum': {0:
59// 'OUTPUT_VALUE_CRUISE_CONTROL_NONE', 1: 'OUTPUT_VALUE_CRUISE_CONTROL_CNCL', 2:
60// 'OUTPUT_VALUE_CRUISE_CONTROL_ACC_FURTHER', 3:
61// 'OUTPUT_VALUE_CRUISE_CONTROL_ACC_CLOSER', 4:
62// 'OUTPUT_VALUE_CRUISE_CONTROL_SET_DEC', 5:
63// 'OUTPUT_VALUE_CRUISE_CONTROL_RES_INC', 6:
64// 'OUTPUT_VALUE_CRUISE_CONTROL_ON_OFF'}, 'precision': 1.0, 'len': 8,
65// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|255]', 'bit':
66// 31, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
68Cruisecontrolbuttonsrpt208::output_value(const std::uint8_t* bytes,
69 int32_t length) const {
70 Byte t0(bytes + 3);
71 int32_t x = t0.get_byte(0, 8);
72
75 return ret;
76}
77
78// config detail: {'name': 'manual_input', 'enum': {0:
79// 'MANUAL_INPUT_CRUISE_CONTROL_NONE', 1: 'MANUAL_INPUT_CRUISE_CONTROL_CNCL', 2:
80// 'MANUAL_INPUT_CRUISE_CONTROL_ACC_FURTHER', 3:
81// 'MANUAL_INPUT_CRUISE_CONTROL_ACC_CLOSER', 4:
82// 'MANUAL_INPUT_CRUISE_CONTROL_SET_DEC', 5:
83// 'MANUAL_INPUT_CRUISE_CONTROL_RES_INC', 6:
84// 'MANUAL_INPUT_CRUISE_CONTROL_ON_OFF'}, 'precision': 1.0, 'len': 8,
85// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|255]', 'bit':
86// 15, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
88Cruisecontrolbuttonsrpt208::manual_input(const std::uint8_t* bytes,
89 int32_t length) const {
90 Byte t0(bytes + 1);
91 int32_t x = t0.get_byte(0, 8);
92
95 return ret;
96}
97
98// config detail: {'name': 'commanded_value', 'enum': {0:
99// 'COMMANDED_VALUE_CRUISE_CONTROL_NONE', 1:
100// 'COMMANDED_VALUE_CRUISE_CONTROL_CNCL', 2:
101// 'COMMANDED_VALUE_CRUISE_CONTROL_ACC_FURTHER', 3:
102// 'COMMANDED_VALUE_CRUISE_CONTROL_ACC_CLOSER', 4:
103// 'COMMANDED_VALUE_CRUISE_CONTROL_SET_DEC', 5:
104// 'COMMANDED_VALUE_CRUISE_CONTROL_RES_INC', 6:
105// 'COMMANDED_VALUE_CRUISE_CONTROL_ON_OFF'}, 'precision': 1.0, 'len': 8,
106// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|255]', 'bit':
107// 23, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
109Cruisecontrolbuttonsrpt208::commanded_value(const std::uint8_t* bytes,
110 int32_t length) const {
111 Byte t0(bytes + 2);
112 int32_t x = t0.get_byte(0, 8);
113
116 return ret;
117}
118
119// config detail: {'name': 'vehicle_fault', 'offset': 0.0, 'precision': 1.0,
120// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 6,
121// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
122bool Cruisecontrolbuttonsrpt208::vehicle_fault(const std::uint8_t* bytes,
123 int32_t length) const {
124 Byte t0(bytes + 0);
125 int32_t x = t0.get_byte(6, 1);
126
127 bool ret = x;
128 return ret;
129}
130
131// config detail: {'name': 'pacmod_fault', 'offset': 0.0, 'precision': 1.0,
132// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 5,
133// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
134bool Cruisecontrolbuttonsrpt208::pacmod_fault(const std::uint8_t* bytes,
135 int32_t length) const {
136 Byte t0(bytes + 0);
137 int32_t x = t0.get_byte(5, 1);
138
139 bool ret = x;
140 return ret;
141}
142
143// config detail: {'name': 'override_active', 'offset': 0.0, 'precision': 1.0,
144// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 1,
145// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
146bool Cruisecontrolbuttonsrpt208::override_active(const std::uint8_t* bytes,
147 int32_t length) const {
148 Byte t0(bytes + 0);
149 int32_t x = t0.get_byte(1, 1);
150
151 bool ret = x;
152 return ret;
153}
154
155// config detail: {'name': 'output_reported_fault', 'offset': 0.0,
156// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
157// '[0|1]', 'bit': 4, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
158bool Cruisecontrolbuttonsrpt208::output_reported_fault(
159 const std::uint8_t* bytes, int32_t length) const {
160 Byte t0(bytes + 0);
161 int32_t x = t0.get_byte(4, 1);
162
163 bool ret = x;
164 return ret;
165}
166
167// config detail: {'name': 'input_output_fault', 'offset': 0.0,
168// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
169// '[0|1]', 'bit': 3, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
170bool Cruisecontrolbuttonsrpt208::input_output_fault(const std::uint8_t* bytes,
171 int32_t length) const {
172 Byte t0(bytes + 0);
173 int32_t x = t0.get_byte(3, 1);
174
175 bool ret = x;
176 return ret;
177}
178
179// config detail: {'name': 'enabled', 'offset': 0.0, 'precision': 1.0, 'len': 1,
180// 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type': 'bool',
181// 'order': 'motorola', 'physical_unit': ''}
182bool Cruisecontrolbuttonsrpt208::enabled(const std::uint8_t* bytes,
183 int32_t length) const {
184 Byte t0(bytes + 0);
185 int32_t x = t0.get_byte(0, 1);
186
187 bool ret = x;
188 return ret;
189}
190
191// config detail: {'name': 'command_output_fault', 'offset': 0.0,
192// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
193// '[0|1]', 'bit': 2, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
194bool Cruisecontrolbuttonsrpt208::command_output_fault(const std::uint8_t* bytes,
195 int32_t length) const {
196 Byte t0(bytes + 0);
197 int32_t x = t0.get_byte(2, 1);
198
199 bool ret = x;
200 return ret;
201}
202} // namespace lexus
203} // namespace canbus
204} // 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