Apollo 10.0
自动驾驶开放平台
enable_state_feedback_c3.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2019 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 zhongyun {
27
28using ::apollo::drivers::canbus::Byte;
29
31const int32_t Enablestatefeedbackc3::ID = 0xC3;
32
33void Enablestatefeedbackc3::Parse(const std::uint8_t* bytes, int32_t length,
34 Zhongyun* chassis) const {
35 chassis->mutable_enable_state_feedback_c3()->set_parking_enable_state(
36 parking_enable_state(bytes, length));
37 chassis->mutable_enable_state_feedback_c3()->set_steering_enable_state(
38 steering_enable_state(bytes, length));
39 chassis->mutable_enable_state_feedback_c3()->set_gear_enable_actual(
40 gear_enable_actual(bytes, length));
41 chassis->mutable_enable_state_feedback_c3()->set_driven_enable_state(
42 driven_enable_state(bytes, length));
43 chassis->mutable_enable_state_feedback_c3()->set_brake_enable_state(
44 brake_enable_state(bytes, length));
45}
46
47// config detail: {'name': 'parking_enable_state', 'enum': {0:
48// 'PARKING_ENABLE_STATE_PARKING_MANUALCONTROL', 1:
49// 'PARKING_ENABLE_STATE_PARKING_AUTOCONTROL', 2:
50// 'PARKING_ENABLE_STATE_PARKING_TAKEOVER'}, 'precision': 1.0, 'len': 8,
51// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 32,
52// 'type': 'enum', 'order': 'intel', 'physical_unit': ''}
54Enablestatefeedbackc3::parking_enable_state(const std::uint8_t* bytes,
55 int32_t length) const {
56 Byte t0(bytes + 4);
57 int32_t x = t0.get_byte(0, 8);
58
61 return ret;
62}
63
64// config detail: {'name': 'steering_enable_state', 'enum': {0:
65// 'STEERING_ENABLE_STATE_STEERING_MANUALCONTROL', 1:
66// 'STEERING_ENABLE_STATE_STEERING_AUTOCONTROL', 2:
67// 'STEERING_ENABLE_STATE_STEERING_MANUAL_TAKEOVER'}, 'precision': 1.0,
68// 'len': 8, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|2]',
69// 'bit': 8, 'type': 'enum', 'order': 'intel', 'physical_unit': ''}
71Enablestatefeedbackc3::steering_enable_state(const std::uint8_t* bytes,
72 int32_t length) const {
73 Byte t0(bytes + 1);
74 int32_t x = t0.get_byte(0, 8);
75
78 return ret;
79}
80
81// config detail: {'name': 'gear_enable_actual', 'enum': {0:
82// 'GEAR_ENABLE_ACTUAL_GEAR_MANUALCONTROL', 1:
83// 'GEAR_ENABLE_ACTUAL_GEAR_AUTOCONTROL', 2:
84// 'GEAR_ENABLE_ACTUAL_GEAR_MANUAL_TAKEOVER'}, 'precision': 1.0, 'len': 8,
85// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|2]', 'bit': 0,
86// 'type': 'enum', 'order': 'intel', 'physical_unit': ''}
88Enablestatefeedbackc3::gear_enable_actual(const std::uint8_t* bytes,
89 int32_t length) const {
90 Byte t0(bytes + 0);
91 int32_t x = t0.get_byte(0, 8);
92
95 return ret;
96}
97
98// config detail: {'name': 'driven_enable_state', 'enum': {0:
99// 'DRIVEN_ENABLE_STATE_DRIVE_MANUAL', 1: 'DRIVEN_ENABLE_STATE_DRIVE_AUTO',
100// 2: 'DRIVEN_ENABLE_STATE_DRIVE_TAKEOVER'}, 'precision': 1.0, 'len': 8,
101// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|2]', 'bit': 16,
102// 'type': 'enum', 'order': 'intel', 'physical_unit': ''}
104Enablestatefeedbackc3::driven_enable_state(const std::uint8_t* bytes,
105 int32_t length) const {
106 Byte t0(bytes + 2);
107 int32_t x = t0.get_byte(0, 8);
108
111 return ret;
112}
113
114// config detail: {'name': 'brake_enable_state', 'enum': {0:
115// 'BRAKE_ENABLE_STATE_BRAKE_MANUAL', 1: 'BRAKE_ENABLE_STATE_BRAKE_AUTO', 2:
116// 'BRAKE_ENABLE_STATE_BRAKE_TAKEOVER'}, 'precision': 1.0, 'len': 8,
117// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|2]', 'bit': 24,
118// 'type': 'enum', 'order': 'intel', 'physical_unit': ''}
120Enablestatefeedbackc3::brake_enable_state(const std::uint8_t* bytes,
121 int32_t length) const {
122 Byte t0(bytes + 3);
123 int32_t x = t0.get_byte(0, 8);
124
127 return ret;
128}
129} // namespace zhongyun
130} // namespace canbus
131} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Zhongyun *chassis) const override
class register implement
Definition arena_queue.h:37