Apollo 10.0
自动驾驶开放平台
steering_command_102.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2020 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/devkit/proto/devkit.pb.h"
20
22
23namespace apollo {
24namespace canbus {
25namespace devkit {
26
28 ::apollo::canbus::Devkit> {
29 public:
30 static const int32_t ID;
31
33
34 uint32_t GetPeriod() const override;
35
36 void Parse(const std::uint8_t* bytes, int32_t length,
37 Devkit* chassis) const override;
38
39 void UpdateData(uint8_t* data) override;
40
41 void Reset() override;
42
43 // config detail: {'bit': 0, 'enum': {0: 'STEER_EN_CTRL_DISABLE', 1:
44 // 'STEER_EN_CTRL_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name':
45 // 'Steer_EN_CTRL', 'offset': 0.0, 'order': 'motorola', 'physical_range':
46 // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
49
50 // config detail: {'bit': 31, 'is_signed_var': False, 'len': 16, 'name':
51 // 'Steer_ANGLE_Target', 'offset': -500.0, 'order': 'motorola',
52 // 'physical_range': '[-500|500]''right -, left +', 'physical_unit': 'deg',
53 // 'precision': 1.0, 'type': 'int'}
54 Steeringcommand102* set_steer_angle_target(int steer_angle_target);
55
56 // config detail: {'bit': 15, 'is_signed_var': False, 'len': 8, 'name':
57 // 'Steer_ANGLE_SPD_Target', 'offset': 0.0, 'order': 'motorola',
58 // 'physical_range': '[0|250]', 'physical_unit': 'deg/s', 'precision': 1.0,
59 // 'type': 'int'}
60 Steeringcommand102* set_steer_angle_spd_target(int steer_angle_spd_target);
61
62 // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
63 // 'CheckSum_102', 'offset': 0.0, 'order': 'motorola', 'physical_range':
64 // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
65 Steeringcommand102* set_checksum_102(int checksum_102);
66
67 private:
68 // config detail: {'bit': 0, 'enum': {0: 'STEER_EN_CTRL_DISABLE', 1:
69 // 'STEER_EN_CTRL_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name':
70 // 'Steer_EN_CTRL', 'offset': 0.0, 'order': 'motorola', 'physical_range':
71 // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
72 void set_p_steer_en_ctrl(
73 uint8_t* data, Steering_command_102::Steer_en_ctrlType steer_en_ctrl);
74
75 // config detail: {'bit': 31, 'is_signed_var': False, 'len': 16, 'name':
76 // 'Steer_ANGLE_Target', 'offset': -500.0, 'order': 'motorola',
77 // 'physical_range': '[-500|500]', 'physical_unit': 'deg', 'precision': 1.0,
78 // 'type': 'int'}
79 void set_p_steer_angle_target(uint8_t* data, int steer_angle_target);
80
81 // config detail: {'bit': 15, 'is_signed_var': False, 'len': 8, 'name':
82 // 'Steer_ANGLE_SPD_Target', 'offset': 0.0, 'order': 'motorola',
83 // 'physical_range': '[0|250]', 'physical_unit': 'deg/s', 'precision': 1.0,
84 // 'type': 'int'}
85 void set_p_steer_angle_spd_target(uint8_t* data, int steer_angle_spd_target);
86
87 // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
88 // 'CheckSum_102', 'offset': 0.0, 'order': 'motorola', 'physical_range':
89 // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
90 void set_p_checksum_102(uint8_t* data, int checksum_102);
91
92 // report the command
94 const std::uint8_t* bytes, const int32_t length) const;
95
96 double steer_angle_target(const std::uint8_t* bytes,
97 const int32_t length) const;
98
99 double steer_angle_spd_target(const std::uint8_t* bytes,
100 const int32_t length) const;
101
102 int checksum_102(const std::uint8_t* bytes, const int32_t length) const;
103
104 private:
106 int steer_angle_target_;
107 int steer_angle_spd_target_;
108 int checksum_102_;
109};
110
111} // namespace devkit
112} // namespace canbus
113} // namespace apollo
Steeringcommand102 * set_steer_angle_spd_target(int steer_angle_spd_target)
Steeringcommand102 * set_checksum_102(int checksum_102)
void Parse(const std::uint8_t *bytes, int32_t length, Devkit *chassis) const override
Steeringcommand102 * set_steer_en_ctrl(Steering_command_102::Steer_en_ctrlType steer_en_ctrl)
Steeringcommand102 * set_steer_angle_target(int steer_angle_target)
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData