Apollo 11.0
自动驾驶开放平台
error_state_e1.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 Errorstatee1::ID = 0xE1;
32
33void Errorstatee1::Parse(const std::uint8_t* bytes, int32_t length,
34 Zhongyun* chassis) const {
35 chassis->mutable_error_state_e1()->set_brake_error_code(
36 brake_error_code(bytes, length));
37 chassis->mutable_error_state_e1()->set_driven_error_code(
38 driven_error_code(bytes, length));
39 chassis->mutable_error_state_e1()->set_steering_error_code(
40 steering_error_code(bytes, length));
41 chassis->mutable_error_state_e1()->set_parking_error_code(
42 parking_error_code(bytes, length));
43 chassis->mutable_error_state_e1()->set_gear_error_msg(
44 gear_error_msg(bytes, length));
45}
46
47// config detail: {'name': 'brake_error_code', 'enum': {0:
48// 'BRAKE_ERROR_CODE_NO_ERROR', 1: 'BRAKE_ERROR_CODE_ERROR'}, 'precision': 1.0,
49// 'len': 8, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|1]',
50// 'bit': 32, 'type': 'enum', 'order': 'intel', 'physical_unit': 'bit'}
51Error_state_e1::Brake_error_codeType Errorstatee1::brake_error_code(
52 const std::uint8_t* bytes, int32_t length) const {
53 Byte t0(bytes + 4);
54 int32_t x = t0.get_byte(0, 8);
55
58 return ret;
59}
60
61// config detail: {'name': 'driven_error_code', 'enum': {0:
62// 'DRIVEN_ERROR_CODE_NO_ERROR', 1: 'DRIVEN_ERROR_CODE_ERROR'},
63// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
64// 'physical_range': '[0|1]', 'bit': 24, 'type': 'enum', 'order': 'intel',
65// 'physical_unit': 'bit'}
66Error_state_e1::Driven_error_codeType Errorstatee1::driven_error_code(
67 const std::uint8_t* bytes, int32_t length) const {
68 Byte t0(bytes + 3);
69 int32_t x = t0.get_byte(0, 8);
70
73 return ret;
74}
75
76// config detail: {'name': 'steering_error_code', 'enum': {0:
77// 'STEERING_ERROR_CODE_NO_ERROR', 1: 'STEERING_ERROR_CODE_ERROR'},
78// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
79// 'physical_range': '[0|1]', 'bit': 16, 'type': 'enum', 'order': 'intel',
80// 'physical_unit': 'bit'}
81Error_state_e1::Steering_error_codeType Errorstatee1::steering_error_code(
82 const std::uint8_t* bytes, int32_t length) const {
83 Byte t0(bytes + 2);
84 int32_t x = t0.get_byte(0, 8);
85
88 return ret;
89}
90
91// config detail: {'name': 'parking_error_code', 'enum': {0:
92// 'PARKING_ERROR_CODE_NO_ERROR', 1: 'PARKING_ERROR_CODE_ERROR'},
93// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
94// 'physical_range': '[0|1]', 'bit': 8, 'type': 'enum', 'order': 'intel',
95// 'physical_unit': 'bit'}
96Error_state_e1::Parking_error_codeType Errorstatee1::parking_error_code(
97 const std::uint8_t* bytes, int32_t length) const {
98 Byte t0(bytes + 1);
99 int32_t x = t0.get_byte(0, 8);
100
103 return ret;
104}
105
106// config detail: {'name': 'gear_error_msg', 'enum': {0:
107// 'GEAR_ERROR_MSG_NO_ERROR', 1: 'GEAR_ERROR_MSG_ERROR'}, 'precision': 1.0,
108// 'len': 8, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|1]',
109// 'bit': 0, 'type': 'enum', 'order': 'intel', 'physical_unit': ''}
110Error_state_e1::Gear_error_msgType Errorstatee1::gear_error_msg(
111 const std::uint8_t* bytes, int32_t length) const {
112 Byte t0(bytes + 0);
113 int32_t x = t0.get_byte(0, 8);
114
117 return ret;
118}
119} // namespace zhongyun
120} // namespace canbus
121} // 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