Apollo  6.0
Open source self driving car software
gear_command_103.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: {'name': 'Gear_Target', 'enum': {0: 'GEAR_TARGET_INVALID',
40  // 1: 'GEAR_TARGET_PARK', 2: 'GEAR_TARGET_REVERSE', 3: 'GEAR_TARGET_NEUTRAL',
41  // 4: 'GEAR_TARGET_DRIVE'}, 'precision': 1.0, 'len': 3, 'is_signed_var':
42  // False, 'offset': 0.0, 'physical_range': '[0|4]', 'bit': 10, 'type': 'enum',
43  // 'order': 'motorola', 'physical_unit': ''}
45  Gear_command_103::Gear_targetType gear_target);
46 
47  // config detail: {'name': 'Gear_EN_CTRL', 'enum': {0: 'GEAR_EN_CTRL_DISABLE',
48  // 1: 'GEAR_EN_CTRL_ENABLE'}, 'precision': 1.0, 'len': 1, 'is_signed_var':
49  // False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum',
50  // 'order': 'motorola', 'physical_unit': ''}
52  Gear_command_103::Gear_en_ctrlType gear_en_ctrl);
53 
54  // config detail: {'name': 'CheckSum_103', 'offset': 0.0, 'precision': 1.0,
55  // 'len': 8, 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 63,
56  // 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
57  Gearcommand103* set_checksum_103(int checksum_103);
58 
59  private:
60  // config detail: {'name': 'Gear_Target', 'enum': {0: 'GEAR_TARGET_INVALID',
61  // 1: 'GEAR_TARGET_PARK', 2: 'GEAR_TARGET_REVERSE', 3: 'GEAR_TARGET_NEUTRAL',
62  // 4: 'GEAR_TARGET_DRIVE'}, 'precision': 1.0, 'len': 3, 'is_signed_var':
63  // False, 'offset': 0.0, 'physical_range': '[0|4]', 'bit': 10, 'type': 'enum',
64  // 'order': 'motorola', 'physical_unit': ''}
65  void set_p_gear_target(uint8_t* data,
66  Gear_command_103::Gear_targetType gear_target);
67 
68  // config detail: {'name': 'Gear_EN_CTRL', 'enum': {0: 'GEAR_EN_CTRL_DISABLE',
69  // 1: 'GEAR_EN_CTRL_ENABLE'}, 'precision': 1.0, 'len': 1, 'is_signed_var':
70  // False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum',
71  // 'order': 'motorola', 'physical_unit': ''}
72  void set_p_gear_en_ctrl(uint8_t* data,
73  Gear_command_103::Gear_en_ctrlType gear_en_ctrl);
74 
75  // config detail: {'name': 'CheckSum_103', 'offset': 0.0, 'precision': 1.0,
76  // 'len': 8, 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 63,
77  // 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
78  void set_p_checksum_103(uint8_t* data, int checksum_103);
79 
80  private:
81  Gear_command_103::Gear_targetType gear_target_;
82  Gear_command_103::Gear_en_ctrlType gear_en_ctrl_;
83  int checksum_103_;
84 };
85 
86 } // namespace devkit
87 } // namespace canbus
88 } // namespace apollo
Gearcommand103 * set_gear_target(Gear_command_103::Gear_targetType gear_target)
Definition: gear_command_103.h:26
void UpdateData(uint8_t *data) override
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Gearcommand103 * set_gear_en_ctrl(Gear_command_103::Gear_en_ctrlType gear_en_ctrl)
This is the base class of protocol data.
Definition: protocol_data.h:44
uint32_t GetPeriod() const override
Gearcommand103 * set_checksum_103(int checksum_103)
static const int32_t ID
Definition: gear_command_103.h:29
The class of ProtocolData.