Apollo 10.0
自动驾驶开放平台
ads_eps_command_56.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/neolix_edu/proto/neolix_edu.pb.h"
20
22
23namespace apollo {
24namespace canbus {
25namespace neolix_edu {
26
28 ::apollo::canbus::Neolix_edu> {
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 Neolix_edu* chassis) const override;
38
39 void UpdateData(uint8_t* data) override;
40
41 void Reset() override;
42
43 // config detail: {'description': '0x0:disable ;0x1:enable', 'offset': 0.0,
44 // 'precision': 1.0, 'len': 1, 'name': 'Drive_Enable', 'is_signed_var': False,
45 // 'physical_range': '[0|0]', 'bit': 0, 'type': 'bool', 'order': 'motorola',
46 // 'physical_unit': ''}
47 Adsepscommand56* set_drive_enable(bool drive_enable);
48
49 // config detail: {'name': 'AUTO_Target_Angle', 'offset': -2048.0,
50 // 'precision': 0.0625, 'len': 16, 'is_signed_var': False, 'physical_range':
51 // '[0|0]', 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit':
52 // ''}
53 Adsepscommand56* set_auto_target_angle(double auto_target_angle);
54
55 // config detail: {'name': 'AUTO_DriverCmd_AliveCounter', 'offset': 0.0,
56 // 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
57 // '[0|0]', 'bit': 51, 'type': 'int', 'order': 'motorola', 'physical_unit':
58 // ''}
60 int auto_drivercmd_alivecounter);
61
62 // config detail: {'name': 'AUTO_DriverCmd_CheckSum', 'offset': 0.0,
63 // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
64 // '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
65 // ''}
66 Adsepscommand56* set_auto_drivercmd_checksum(int auto_drivercmd_checksum);
67
68 private:
69 // config detail: {'description': '0x0:disable ;0x1:enable', 'offset': 0.0,
70 // 'precision': 1.0, 'len': 1, 'name': 'Drive_Enable', 'is_signed_var': False,
71 // 'physical_range': '[0|0]', 'bit': 0, 'type': 'bool', 'order': 'motorola',
72 // 'physical_unit': ''}
73 void set_p_drive_enable(uint8_t* data, bool drive_enable);
74
75 // config detail: {'name': 'AUTO_Target_Angle', 'offset': -2048.0,
76 // 'precision': 0.0625, 'len': 16, 'is_signed_var': False, 'physical_range':
77 // '[0|0]', 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit':
78 // ''}
79 void set_p_auto_target_angle(uint8_t* data, double auto_target_angle);
80
81 // config detail: {'name': 'AUTO_DriverCmd_AliveCounter', 'offset': 0.0,
82 // 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
83 // '[0|0]', 'bit': 51, 'type': 'int', 'order': 'motorola', 'physical_unit':
84 // ''}
85 void set_p_auto_drivercmd_alivecounter(uint8_t* data,
86 int auto_drivercmd_alivecounter);
87
88 // config detail: {'name': 'AUTO_DriverCmd_CheckSum', 'offset': 0.0,
89 // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
90 // '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
91 // ''}
92 void set_p_auto_drivercmd_checksum(uint8_t* data,
93 int auto_drivercmd_checksum);
94
95 bool drive_enable(const std::uint8_t* bytes, const int32_t length) const;
96
97 double auto_target_angle(const std::uint8_t* bytes,
98 const int32_t length) const;
99
100 private:
101 bool drive_enable_;
102 double auto_target_angle_;
103 int auto_drivercmd_alivecounter_;
104 int auto_drivercmd_checksum_;
105};
106
107} // namespace neolix_edu
108} // namespace canbus
109} // namespace apollo
Adsepscommand56 * set_auto_drivercmd_alivecounter(int auto_drivercmd_alivecounter)
void Parse(const std::uint8_t *bytes, int32_t length, Neolix_edu *chassis) const override
Adsepscommand56 * set_auto_drivercmd_checksum(int auto_drivercmd_checksum)
Adsepscommand56 * set_drive_enable(bool drive_enable)
Adsepscommand56 * set_auto_target_angle(double auto_target_angle)
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData