Apollo 10.0
自动驾驶开放平台
brake_status__511.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#include "glog/logging.h"
21
22namespace apollo {
23namespace canbus {
24namespace ch {
25
26using ::apollo::drivers::canbus::Byte;
27
29const int32_t Brakestatus511::ID = 0x511;
30
31void Brakestatus511::Parse(const std::uint8_t* bytes, int32_t length,
32 Ch* chassis) const {
33 chassis->mutable_brake_status__511()->set_overspd_env(
34 overspd_env(bytes, length));
35 chassis->mutable_brake_status__511()->set_brake_pedal_en_sts(
36 brake_pedal_en_sts(bytes, length));
37 chassis->mutable_brake_status__511()->set_brake_pedal_sts(
38 brake_pedal_sts(bytes, length));
39 chassis->mutable_brake_status__511()->set_brake_err(
40 brake_err(bytes, length));
41 chassis->mutable_brake_status__511()->set_emergency_btn_env(
42 emergency_btn_env(bytes, length));
43 chassis->mutable_brake_status__511()->set_front_bump_env(
44 front_bump_env(bytes, length));
45 chassis->mutable_brake_status__511()->set_back_bump_env(
46 back_bump_env(bytes, length));
47 chassis->mutable_brake_status__511()->set_brake_light_actual(
48 brake_light_actual(bytes, length));
49}
50
51// config detail: {'bit': 48, 'enum': {0: 'OVERSPD_ENV_NOENV', 1:
52// 'OVERSPD_ENV_OVERSPEED_ENV'}, 'is_signed_var': False, 'len': 8, 'name':
53// 'overspd_env', 'offset': 0.0, 'order': 'intel', 'physical_range': '[0|1]',
54// 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
55Brake_status__511::Overspd_envType Brakestatus511::overspd_env(
56 const std::uint8_t* bytes, int32_t length) const {
57 Byte t0(bytes + 6);
58 int32_t x = t0.get_byte(0, 8);
59
62 return ret;
63}
64
65// config detail: {'bit': 0, 'description': 'brake pedal enable bit(Status)',
66// 'enum': {0: 'BRAKE_PEDAL_EN_STS_DISABLE', 1: 'BRAKE_PEDAL_EN_STS_ENABLE', 2:
67// 'BRAKE_PEDAL_EN_STS_TAKEOVER'}, 'is_signed_var': False, 'len': 8, 'name':
68// 'brake_pedal_en_sts', 'offset': 0.0, 'order': 'intel', 'physical_range':
69// '[0|2]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
70Brake_status__511::Brake_pedal_en_stsType Brakestatus511::brake_pedal_en_sts(
71 const std::uint8_t* bytes, int32_t length) const {
72 Byte t0(bytes + 0);
73 int32_t x = t0.get_byte(0, 8);
74
77 return ret;
78}
79
80// config detail: {'bit': 8, 'description': 'Percentage of brake pedal(Status)',
81// 'is_signed_var': False, 'len': 8, 'name': 'brake_pedal_sts', 'offset': 0.0,
82// 'order': 'intel', 'physical_range': '[0|100]', 'physical_unit': '%',
83// 'precision': 1.0, 'type': 'int'}
84int Brakestatus511::brake_pedal_sts(const std::uint8_t* bytes,
85 int32_t length) const {
86 Byte t0(bytes + 1);
87 int32_t x = t0.get_byte(0, 8);
88
89 int ret = x;
90 return ret;
91}
92
93// config detail: {'bit': 16, 'enum': {0: 'BRAKE_ERR_NOERR', 1:
94// 'BRAKE_ERR_BRAKE_SYSTEM_ERR'}, 'is_signed_var': False, 'len': 8, 'name':
95// 'brake_err', 'offset': 0.0, 'order': 'intel', 'physical_range': '[0|1]',
96// 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
97Brake_status__511::Brake_errType Brakestatus511::brake_err(
98 const std::uint8_t* bytes, int32_t length) const {
99 Byte t0(bytes + 2);
100 int32_t x = t0.get_byte(0, 8);
101
103 static_cast<Brake_status__511::Brake_errType>(x);
104 return ret;
105}
106
107// config detail: {'bit': 24, 'enum': {0: 'EMERGENCY_BTN_ENV_NOENV', 1:
108// 'EMERGENCY_BTN_ENV_EMERGENCY_BUTTON_ENV'}, 'is_signed_var': False, 'len': 8,
109// 'name': 'emergency_btn_env', 'offset': 0.0, 'order': 'intel',
110// 'physical_range': '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type':
111// 'enum'}
112Brake_status__511::Emergency_btn_envType Brakestatus511::emergency_btn_env(
113 const std::uint8_t* bytes, int32_t length) const {
114 Byte t0(bytes + 3);
115 int32_t x = t0.get_byte(0, 8);
116
119 return ret;
120}
121
122// config detail: {'bit': 32, 'enum': {0: 'FRONT_BUMP_ENV_NOENV', 1:
123// 'FRONT_BUMP_ENV_FRONT_BUMPER_ENV'}, 'is_signed_var': False, 'len': 8, 'name':
124// 'front_bump_env', 'offset': 0.0, 'order': 'intel', 'physical_range': '[0|1]',
125// 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
126Brake_status__511::Front_bump_envType Brakestatus511::front_bump_env(
127 const std::uint8_t* bytes, int32_t length) const {
128 Byte t0(bytes + 4);
129 int32_t x = t0.get_byte(0, 8);
130
133 return ret;
134}
135
136// config detail: {'bit': 40, 'enum': {0: 'BACK_BUMP_ENV_NOENV', 1:
137// 'BACK_BUMP_ENV_BACK_BUMPER_ENV'}, 'is_signed_var': False, 'len': 8, 'name':
138// 'back_bump_env', 'offset': 0.0, 'order': 'intel', 'physical_range': '[0|1]',
139// 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
140Brake_status__511::Back_bump_envType Brakestatus511::back_bump_env(
141 const std::uint8_t* bytes, int32_t length) const {
142 Byte t0(bytes + 5);
143 int32_t x = t0.get_byte(0, 8);
144
147 return ret;
148}
149
150// config detail: {'bit': 56, 'enum': {0: 'BRAKE_LIGHT_ACTUAL_BRAKELIGHT_OFF',
151// 1: 'BRAKE_LIGHT_ACTUAL_BRAKELIGHT_ON'}, 'is_signed_var': False, 'len': 1,
152// 'name': 'brake_light_actual', 'offset': 0.0, 'order': 'intel',
153// 'physical_range': '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type':
154// 'enum'}
155Brake_status__511::Brake_light_actualType Brakestatus511::brake_light_actual(
156 const std::uint8_t* bytes, int32_t length) const {
157 Byte t0(bytes + 7);
158 int32_t x = t0.get_byte(0, 1);
159
162 return ret;
163}
164} // namespace ch
165} // namespace canbus
166} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Ch *chassis) const override
class register implement
Definition arena_queue.h:37