Apollo  6.0
Open source self driving car software
ads_drive_command_50.h
Go to the documentation of this file.
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/proto/chassis_detail.pb.h"
21 
22 namespace apollo {
23 namespace canbus {
24 namespace neolix_edu {
25 
27  ::apollo::canbus::ChassisDetail> {
28  public:
29  static const int32_t ID;
30 
32 
33  uint32_t GetPeriod() const override;
34 
35  void UpdateData(uint8_t* data) override;
36 
37  void Reset() override;
38 
39  // config detail: {'description': '0x0:disable ;0x1:enable', 'offset': 0.0,
40  // 'precision': 1.0, 'len': 1, 'name': 'Drive_Enable', 'is_signed_var': False,
41  // 'physical_range': '[0|0]', 'bit': 0, 'type': 'bool', 'order': 'motorola',
42  // 'physical_unit': ''}
43  Adsdrivecommand50* set_drive_enable(bool drive_enable);
44 
45  // config detail: {'description': '0x0:N ;0x1:D ;0x2:R ;0x3:Reserved ',
46  // 'enum': {0: 'AUTO_SHIFT_COMMAND_N', 1: 'AUTO_SHIFT_COMMAND_D', 2:
47  // 'AUTO_SHIFT_COMMAND_R', 3: 'AUTO_SHIFT_COMMAND_RESERVED'},
48  // 'precision': 1.0, 'len': 2, 'name': 'AUTO_Shift_Command', 'is_signed_var':
49  // False, 'offset': 0.0, 'physical_range': '[0|3]', 'bit': 9, 'type': 'enum',
50  // 'order': 'motorola', 'physical_unit': ''}
52  Ads_drive_command_50::Auto_shift_commandType auto_shift_command);
53 
54  // config detail: {'name': 'AUTO_Drive_Torque', 'offset': -665.0, 'precision':
55  // 0.02, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
56  // 23, 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
57  Adsdrivecommand50* set_auto_drive_torque(double auto_drive_torque);
58 
59  // config detail: {'name': 'AUTO_DriverCmd_AliveCounter', 'offset': 0.0,
60  // 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
61  // '[0|0]', 'bit': 51, 'type': 'int', 'order': 'motorola', 'physical_unit':
62  // ''}
64  int auto_drivercmd_alivecounter);
65 
66  // config detail: {'name': 'AUTO_DriverCmd_CheckSum', 'offset': 0.0,
67  // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
68  // '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
69  // ''}
70  Adsdrivecommand50* set_auto_drivercmd_checksum(int auto_drivercmd_checksum);
71 
72  private:
73  // config detail: {'description': '0x0:disable ;0x1:enable', 'offset': 0.0,
74  // 'precision': 1.0, 'len': 1, 'name': 'Drive_Enable', 'is_signed_var': False,
75  // 'physical_range': '[0|0]', 'bit': 0, 'type': 'bool', 'order': 'motorola',
76  // 'physical_unit': ''}
77  void set_p_drive_enable(uint8_t* data, bool drive_enable);
78 
79  // config detail: {'description': '0x0:N ;0x1:D ;0x2:R ;0x3:Reserved ',
80  // 'enum': {0: 'AUTO_SHIFT_COMMAND_N', 1: 'AUTO_SHIFT_COMMAND_D', 2:
81  // 'AUTO_SHIFT_COMMAND_R', 3: 'AUTO_SHIFT_COMMAND_RESERVED'},
82  // 'precision': 1.0, 'len': 2, 'name': 'AUTO_Shift_Command', 'is_signed_var':
83  // False, 'offset': 0.0, 'physical_range': '[0|3]', 'bit': 9, 'type': 'enum',
84  // 'order': 'motorola', 'physical_unit': ''}
85  void set_p_auto_shift_command(
86  uint8_t* data,
87  Ads_drive_command_50::Auto_shift_commandType auto_shift_command);
88 
89  // config detail: {'name': 'AUTO_Drive_Torque', 'offset': -665.0, 'precision':
90  // 0.02, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
91  // 23, 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
92  void set_p_auto_drive_torque(uint8_t* data, double auto_drive_torque);
93 
94  // config detail: {'name': 'AUTO_DriverCmd_AliveCounter', 'offset': 0.0,
95  // 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
96  // '[0|0]', 'bit': 51, 'type': 'int', 'order': 'motorola', 'physical_unit':
97  // ''}
98  void set_p_auto_drivercmd_alivecounter(uint8_t* data,
99  int auto_drivercmd_alivecounter);
100 
101  // config detail: {'name': 'AUTO_DriverCmd_CheckSum', 'offset': 0.0,
102  // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
103  // '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
104  // ''}
105  void set_p_auto_drivercmd_checksum(uint8_t* data,
106  int auto_drivercmd_checksum);
107 
108  private:
109  bool drive_enable_;
110  Ads_drive_command_50::Auto_shift_commandType auto_shift_command_;
111  double auto_drive_torque_;
112  int auto_drivercmd_alivecounter_;
113  int auto_drivercmd_checksum_;
114 };
115 
116 } // namespace neolix_edu
117 } // namespace canbus
118 } // namespace apollo
Definition: ads_drive_command_50.h:26
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
static const int32_t ID
Definition: ads_drive_command_50.h:29
This is the base class of protocol data.
Definition: protocol_data.h:44
Adsdrivecommand50 * set_auto_drivercmd_checksum(int auto_drivercmd_checksum)
Adsdrivecommand50 * set_drive_enable(bool drive_enable)
Adsdrivecommand50 * set_auto_shift_command(Ads_drive_command_50::Auto_shift_commandType auto_shift_command)
void UpdateData(uint8_t *data) override
Adsdrivecommand50 * set_auto_drive_torque(double auto_drive_torque)
The class of ProtocolData.
Adsdrivecommand50 * set_auto_drivercmd_alivecounter(int auto_drivercmd_alivecounter)