Apollo 10.0
自动驾驶开放平台
dash_controls_left_cmd_10c.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 Dashcontrolsleftcmd10c::ID = 0x10C;
32
33void Dashcontrolsleftcmd10c::Parse(const std::uint8_t* bytes, int32_t length,
34 Lexus* chassis) const {
35 chassis->mutable_dash_controls_left_cmd_10c()->set_ignore_overrides(
36 ignore_overrides(bytes, length));
37 chassis->mutable_dash_controls_left_cmd_10c()->set_enable(
38 enable(bytes, length));
39 chassis->mutable_dash_controls_left_cmd_10c()->set_clear_override(
40 clear_override(bytes, length));
41 chassis->mutable_dash_controls_left_cmd_10c()->set_clear_faults(
42 clear_faults(bytes, length));
43 chassis->mutable_dash_controls_left_cmd_10c()->set_dash_controls_button(
44 dash_controls_button(bytes, length));
45}
46
47// config detail: {'name': 'ignore_overrides', 'offset': 0.0, 'precision': 1.0,
48// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 1,
49// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
50bool Dashcontrolsleftcmd10c::ignore_overrides(const std::uint8_t* bytes,
51 int32_t length) const {
52 Byte t0(bytes + 0);
53 int32_t x = t0.get_byte(1, 1);
54
55 bool ret = x;
56 return ret;
57}
58
59// config detail: {'name': 'enable', 'offset': 0.0, 'precision': 1.0, 'len': 1,
60// 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type': 'bool',
61// 'order': 'motorola', 'physical_unit': ''}
62bool Dashcontrolsleftcmd10c::enable(const std::uint8_t* bytes,
63 int32_t length) const {
64 Byte t0(bytes + 0);
65 int32_t x = t0.get_byte(0, 1);
66
67 bool ret = x;
68 return ret;
69}
70
71// config detail: {'name': 'clear_override', 'offset': 0.0, 'precision': 1.0,
72// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 2,
73// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
74bool Dashcontrolsleftcmd10c::clear_override(const std::uint8_t* bytes,
75 int32_t length) const {
76 Byte t0(bytes + 0);
77 int32_t x = t0.get_byte(2, 1);
78
79 bool ret = x;
80 return ret;
81}
82
83// config detail: {'name': 'clear_faults', 'offset': 0.0, 'precision': 1.0,
84// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 3,
85// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
86bool Dashcontrolsleftcmd10c::clear_faults(const std::uint8_t* bytes,
87 int32_t length) const {
88 Byte t0(bytes + 0);
89 int32_t x = t0.get_byte(3, 1);
90
91 bool ret = x;
92 return ret;
93}
94
95// config detail: {'name': 'dash_controls_button', 'enum': {0:
96// 'DASH_CONTROLS_BUTTON_DASH_CONTROL_NONE', 1:
97// 'DASH_CONTROLS_BUTTON_DASH_CONTROL_OK', 2:
98// 'DASH_CONTROLS_BUTTON_DASH_CONTROL_LEFT', 3:
99// 'DASH_CONTROLS_BUTTON_DASH_CONTROL_RIGHT', 4:
100// 'DASH_CONTROLS_BUTTON_DASH_CONTROL_UP', 5:
101// 'DASH_CONTROLS_BUTTON_DASH_CONTROL_DOWN'}, 'precision': 1.0, 'len': 8,
102// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|255]', 'bit':
103// 15, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
105Dashcontrolsleftcmd10c::dash_controls_button(const std::uint8_t* bytes,
106 int32_t length) const {
107 Byte t0(bytes + 1);
108 int32_t x = t0.get_byte(0, 8);
109
112 return ret;
113}
114} // namespace lexus
115} // namespace canbus
116} // 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