Apollo  6.0
Open source self driving car software
steering_cmd_12c.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 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 lexus {
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: {'name': 'IGNORE_OVERRIDES', 'offset': 0.0,
40  // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
41  // '[0|1]', 'bit': 1, 'type': 'bool', 'order': 'motorola', 'physical_unit':
42  // ''}
43  Steeringcmd12c* set_ignore_overrides(bool ignore_overrides);
44 
45  // config detail: {'name': 'ENABLE', 'offset': 0.0, 'precision': 1.0, 'len':
46  // 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type':
47  // 'bool', 'order': 'motorola', 'physical_unit': ''}
48  Steeringcmd12c* set_enable(bool enable);
49 
50  // config detail: {'name': 'CLEAR_OVERRIDE', 'offset': 0.0, 'precision': 1.0,
51  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 2,
52  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
53  Steeringcmd12c* set_clear_override(bool clear_override);
54 
55  // config detail: {'name': 'CLEAR_FAULTS', 'offset': 0.0, 'precision': 1.0,
56  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 3,
57  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
58  Steeringcmd12c* set_clear_faults(bool clear_faults);
59 
60  // config detail: {'name': 'POSITION', 'offset': 0.0, 'precision': 0.001,
61  // 'len': 16, 'is_signed_var': True, 'physical_range': '[-32.768|32.767]',
62  // 'bit': 15, 'type': 'double', 'order': 'motorola', 'physical_unit': 'rad'}
63  Steeringcmd12c* set_position(double position);
64 
65  // config detail: {'name': 'ROTATION_RATE', 'offset': 0.0, 'precision': 0.001,
66  // 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit':
67  // 31, 'type': 'double', 'order': 'motorola', 'physical_unit': 'rad/s'}
68  Steeringcmd12c* set_rotation_rate(double rotation_rate);
69 
70  private:
71  // config detail: {'name': 'IGNORE_OVERRIDES', 'offset': 0.0,
72  // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
73  // '[0|1]', 'bit': 1, 'type': 'bool', 'order': 'motorola', 'physical_unit':
74  // ''}
75  void set_p_ignore_overrides(uint8_t* data, bool ignore_overrides);
76 
77  // config detail: {'name': 'ENABLE', 'offset': 0.0, 'precision': 1.0, 'len':
78  // 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type':
79  // 'bool', 'order': 'motorola', 'physical_unit': ''}
80  void set_p_enable(uint8_t* data, bool enable);
81 
82  // config detail: {'name': 'CLEAR_OVERRIDE', 'offset': 0.0, 'precision': 1.0,
83  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 2,
84  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
85  void set_p_clear_override(uint8_t* data, bool clear_override);
86 
87  // config detail: {'name': 'CLEAR_FAULTS', 'offset': 0.0, 'precision': 1.0,
88  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 3,
89  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
90  void set_p_clear_faults(uint8_t* data, bool clear_faults);
91 
92  // config detail: {'name': 'POSITION', 'offset': 0.0, 'precision': 0.001,
93  // 'len': 16, 'is_signed_var': True, 'physical_range': '[-32.768|32.767]',
94  // 'bit': 15, 'type': 'double', 'order': 'motorola', 'physical_unit': 'rad'}
95  void set_p_position(uint8_t* data, double position);
96 
97  // config detail: {'name': 'ROTATION_RATE', 'offset': 0.0, 'precision': 0.001,
98  // 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit':
99  // 31, 'type': 'double', 'order': 'motorola', 'physical_unit': 'rad/s'}
100  void set_p_rotation_rate(uint8_t* data, double rotation_rate);
101 
102  private:
103  bool ignore_overrides_;
104  bool enable_;
105  bool clear_override_;
106  bool clear_faults_;
107  double position_;
108  double rotation_rate_;
109 };
110 
111 } // namespace lexus
112 } // namespace canbus
113 } // namespace apollo
static const int32_t ID
Definition: steering_cmd_12c.h:29
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
Steeringcmd12c * set_enable(bool enable)
Definition: steering_cmd_12c.h:26
Steeringcmd12c * set_position(double position)
void UpdateData(uint8_t *data) override
Steeringcmd12c * set_clear_override(bool clear_override)
Steeringcmd12c * set_ignore_overrides(bool ignore_overrides)
Steeringcmd12c * set_rotation_rate(double rotation_rate)
uint32_t GetPeriod() const override
The class of ProtocolData.
Steeringcmd12c * set_clear_faults(bool clear_faults)