Apollo  6.0
Open source self driving car software
steering_command_102.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 devkit {
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: {'bit': 0, 'enum': {0: 'STEER_EN_CTRL_DISABLE', 1:
40  // 'STEER_EN_CTRL_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name':
41  // 'Steer_EN_CTRL', 'offset': 0.0, 'order': 'motorola', 'physical_range':
42  // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
44  Steering_command_102::Steer_en_ctrlType steer_en_ctrl);
45 
46  // config detail: {'bit': 31, 'is_signed_var': False, 'len': 16, 'name':
47  // 'Steer_ANGLE_Target', 'offset': -500.0, 'order': 'motorola',
48  // 'physical_range': '[-500|500]', 'physical_unit': 'deg', 'precision': 1.0,
49  // 'type': 'int'}
50  Steeringcommand102* set_steer_angle_target(int steer_angle_target);
51 
52  // config detail: {'bit': 15, 'is_signed_var': False, 'len': 8, 'name':
53  // 'Steer_ANGLE_SPD', 'offset': 0.0, 'order': 'motorola', 'physical_range':
54  // '[0|250]', 'physical_unit': 'deg/s', 'precision': 1.0, 'type': 'int'}
55  Steeringcommand102* set_steer_angle_spd(int steer_angle_spd);
56 
57  // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
58  // 'CheckSum_102', 'offset': 0.0, 'order': 'motorola', 'physical_range':
59  // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
60  Steeringcommand102* set_checksum_102(int checksum_102);
61 
62  private:
63  // config detail: {'bit': 0, 'enum': {0: 'STEER_EN_CTRL_DISABLE', 1:
64  // 'STEER_EN_CTRL_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name':
65  // 'Steer_EN_CTRL', 'offset': 0.0, 'order': 'motorola', 'physical_range':
66  // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
67  void set_p_steer_en_ctrl(
68  uint8_t* data, Steering_command_102::Steer_en_ctrlType steer_en_ctrl);
69 
70  // config detail: {'bit': 31, 'is_signed_var': False, 'len': 16, 'name':
71  // 'Steer_ANGLE_Target', 'offset': -500.0, 'order': 'motorola',
72  // 'physical_range': '[-500|500]', 'physical_unit': 'deg', 'precision': 1.0,
73  // 'type': 'int'}
74  void set_p_steer_angle_target(uint8_t* data, int steer_angle_target);
75 
76  // config detail: {'bit': 15, 'is_signed_var': False, 'len': 8, 'name':
77  // 'Steer_ANGLE_SPD', 'offset': 0.0, 'order': 'motorola', 'physical_range':
78  // '[0|250]', 'physical_unit': 'deg/s', 'precision': 1.0, 'type': 'int'}
79  void set_p_steer_angle_spd(uint8_t* data, int steer_angle_spd);
80 
81  // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
82  // 'CheckSum_102', 'offset': 0.0, 'order': 'motorola', 'physical_range':
83  // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
84  void set_p_checksum_102(uint8_t* data, int checksum_102);
85 
86  private:
87  Steering_command_102::Steer_en_ctrlType steer_en_ctrl_;
88  int steer_angle_target_;
89  int steer_angle_spd_;
90  int checksum_102_;
91 };
92 
93 } // namespace devkit
94 } // namespace canbus
95 } // namespace apollo
Steeringcommand102 * set_checksum_102(int checksum_102)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
This is the base class of protocol data.
Definition: protocol_data.h:44
Steeringcommand102 * set_steer_en_ctrl(Steering_command_102::Steer_en_ctrlType steer_en_ctrl)
Definition: steering_command_102.h:26
static const int32_t ID
Definition: steering_command_102.h:29
The class of ProtocolData.
Steeringcommand102 * set_steer_angle_target(int steer_angle_target)
Steeringcommand102 * set_steer_angle_spd(int steer_angle_spd)
void UpdateData(uint8_t *data) override