Apollo 10.0
自动驾驶开放平台
steering_report_502.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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
17#pragma once
18
19#include "modules/canbus_vehicle/demo/proto/demo.pb.h"
20
22
23namespace apollo {
24namespace canbus {
25namespace demo {
26
28 : public ::apollo::drivers::canbus::ProtocolData<::apollo::canbus::Demo> {
29 public:
30 static const int32_t ID;
32 void Parse(const std::uint8_t* bytes, int32_t length,
33 Demo* chassis) const override;
34
35 private:
36 // config detail: {'bit': 47, 'is_signed_var': False, 'len': 16, 'name':
37 // 'Steer_ANGLE_Rear_Actual', 'offset': -500.0, 'order': 'motorola',
38 // 'physical_range': '[-500|500]', 'physical_unit': 'deg', 'precision': 1.0,
39 // 'type': 'int'}
40 int steer_angle_rear_actual(const std::uint8_t* bytes,
41 const int32_t length) const;
42
43 // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
44 // 'Steer_ANGLE_SPD_Actual', 'offset': 0.0, 'order': 'motorola',
45 // 'physical_range': '[0|0]', 'physical_unit': 'deg/s', 'precision': 1.0,
46 // 'type': 'int'}
47 int steer_angle_spd_actual(const std::uint8_t* bytes,
48 const int32_t length) const;
49
50 // config detail: {'bit': 23, 'description': 'Steer system communication
51 // fault', 'enum': {0: 'STEER_FLT2_NO_FAULT', 1:
52 // 'STEER_FLT2_STEER_SYSTEM_COMUNICATION_FAULT'}, 'is_signed_var': False,
53 // 'len': 8, 'name': 'Steer_FLT2', 'offset': 0.0, 'order': 'motorola',
54 // 'physical_range': '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type':
55 // 'enum'}
56 Steering_report_502::Steer_flt2Type steer_flt2(const std::uint8_t* bytes,
57 const int32_t length) const;
58
59 // config detail: {'bit': 15, 'description': 'Steer system hardware fault',
60 // 'enum': {0: 'STEER_FLT1_NO_FAULT', 1:
61 // 'STEER_FLT1_STEER_SYSTEM_HARDWARE_FAULT'}, 'is_signed_var': False, 'len':
62 // 8, 'name': 'Steer_FLT1', 'offset': 0.0, 'order': 'motorola',
63 // 'physical_range': '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type':
64 // 'enum'}
65 Steering_report_502::Steer_flt1Type steer_flt1(const std::uint8_t* bytes,
66 const int32_t length) const;
67
68 // config detail: {'bit': 1, 'description': 'enable', 'enum': {0:
69 // 'STEER_EN_STATE_MANUAL', 1: 'STEER_EN_STATE_AUTO', 2:
70 // 'STEER_EN_STATE_TAKEOVER', 3: 'STEER_EN_STATE_STANDBY'}, 'is_signed_var':
71 // False, 'len': 2, 'name': 'Steer_EN_state', 'offset': 0.0, 'order':
72 // 'motorola', 'physical_range': '[0|2]', 'physical_unit': '',
73 // 'precision': 1.0, 'signal_type': 'enable', 'type': 'enum'}
75 const std::uint8_t* bytes, const int32_t length) const;
76
77 // config detail: {'bit': 31, 'description': 'command', 'is_signed_var':
78 // False, 'len': 16, 'name': 'Steer_ANGLE_Actual', 'offset': -500.0, 'order':
79 // 'motorola', 'physical_range': '[-500|500]', 'physical_unit': 'deg',
80 // 'precision': 1.0, 'signal_type': 'command', 'type': 'int'}
81 int steer_angle_actual(const std::uint8_t* bytes, const int32_t length) const;
82};
83
84} // namespace demo
85} // namespace canbus
86} // namespace apollo
void Parse(const std::uint8_t *bytes, int32_t length, Demo *chassis) const override
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData