Apollo  6.0
Open source self driving car software
ads_light_horn_command_310.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': 'Turn_Right_Light_Command',
41  // 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 8, 'type':
42  // 'bool', 'order': 'motorola', 'physical_unit': 'bit'}
44  bool turn_right_light_command);
45 
46  // config detail: {'description': '0x0:disable ;0x1:enable ;0x2-0x3:Reserved
47  // ', 'offset': 0.0, 'precision': 1.0, 'len': 1, 'name':
48  // 'Turn_Left_Light_Command', 'is_signed_var': False, 'physical_range':
49  // '[0|1]', 'bit': 9, 'type': 'bool', 'order': 'motorola', 'physical_unit':
50  // 'bit'}
52  bool turn_left_light_command);
53 
54  // config detail: {'name': 'Horn_Command', 'offset': 0.0, 'precision': 1.0,
55  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 10,
56  // 'type': 'bool', 'order': 'motorola', 'physical_unit': 'bit'}
57  Adslighthorncommand310* set_horn_command(bool horn_command);
58 
59  // config detail: {'description': '0x0:Off;0x1:LowBeam;0x2:HighBeam',
60  // 'offset': 0.0, 'precision': 1.0, 'len': 2, 'name': 'Beam_Command',
61  // 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 13, 'type':
62  // 'int', 'order': 'motorola', 'physical_unit': 'bit'}
63  Adslighthorncommand310* set_beam_command(int beam_command);
64 
65  // config detail: {'name': 'AUTO_DriverCmd_AliveCounter', 'offset': 0.0,
66  // 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
67  // '[0|0]', 'bit': 51, 'type': 'int', 'order': 'motorola', 'physical_unit':
68  // ''}
70  int auto_drivercmd_alivecounter);
71 
72  // config detail: {'name': 'AUTO_DriverCmd_CheckSum', 'offset': 0.0,
73  // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
74  // '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
75  // ''}
77  int auto_drivercmd_checksum);
78 
79  private:
80  // config detail: {'description': '0x0:disable ;0x1:enable', 'offset': 0.0,
81  // 'precision': 1.0, 'len': 1, 'name': 'Turn_Right_Light_Command',
82  // 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 8, 'type':
83  // 'bool', 'order': 'motorola', 'physical_unit': 'bit'}
84  void set_p_turn_right_light_command(uint8_t* data,
85  bool turn_right_light_command);
86 
87  // config detail: {'description': '0x0:disable ;0x1:enable ;0x2-0x3:Reserved
88  // ', 'offset': 0.0, 'precision': 1.0, 'len': 1, 'name':
89  // 'Turn_Left_Light_Command', 'is_signed_var': False, 'physical_range':
90  // '[0|1]', 'bit': 9, 'type': 'bool', 'order': 'motorola', 'physical_unit':
91  // 'bit'}
92  void set_p_turn_left_light_command(uint8_t* data,
93  bool turn_left_light_command);
94 
95  // config detail: {'name': 'Horn_Command', 'offset': 0.0, 'precision': 1.0,
96  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 10,
97  // 'type': 'bool', 'order': 'motorola', 'physical_unit': 'bit'}
98  void set_p_horn_command(uint8_t* data, bool horn_command);
99 
100  // config detail: {'description': '0x0:Off;0x1:LowBeam;0x2:HighBeam',
101  // 'offset': 0.0, 'precision': 1.0, 'len': 2, 'name': 'Beam_Command',
102  // 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 13, 'type':
103  // 'int', 'order': 'motorola', 'physical_unit': 'bit'}
104  void set_p_beam_command(uint8_t* data, int beam_command);
105 
106  // config detail: {'name': 'AUTO_DriverCmd_AliveCounter', 'offset': 0.0,
107  // 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
108  // '[0|0]', 'bit': 51, 'type': 'int', 'order': 'motorola', 'physical_unit':
109  // ''}
110  void set_p_auto_drivercmd_alivecounter(uint8_t* data,
111  int auto_drivercmd_alivecounter);
112 
113  // config detail: {'name': 'AUTO_DriverCmd_CheckSum', 'offset': 0.0,
114  // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
115  // '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
116  // ''}
117  void set_p_auto_drivercmd_checksum(uint8_t* data,
118  int auto_drivercmd_checksum);
119 
120  private:
121  bool turn_right_light_command_;
122  bool turn_left_light_command_;
123  bool horn_command_;
124  int beam_command_;
125  int auto_drivercmd_alivecounter_;
126  int auto_drivercmd_checksum_;
127 };
128 
129 } // namespace neolix_edu
130 } // namespace canbus
131 } // namespace apollo
Definition: ads_light_horn_command_310.h:26
Adslighthorncommand310 * set_horn_command(bool horn_command)
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
Adslighthorncommand310 * set_auto_drivercmd_checksum(int auto_drivercmd_checksum)
static const int32_t ID
Definition: ads_light_horn_command_310.h:29
Adslighthorncommand310 * set_beam_command(int beam_command)
Adslighthorncommand310 * set_turn_right_light_command(bool turn_right_light_command)
The class of ProtocolData.
Adslighthorncommand310 * set_turn_left_light_command(bool turn_left_light_command)
Adslighthorncommand310 * set_auto_drivercmd_alivecounter(int auto_drivercmd_alivecounter)