Apollo  6.0
Open source self driving car software
throttle_command_100.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': 'Throttle_Acc', 'offset': 0.0, 'precision': 0.01,
40  // 'len': 10, 'is_signed_var': False, 'physical_range': '[0|10]', 'bit': 15,
41  // 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s^2'}
42  Throttlecommand100* set_throttle_acc(double throttle_acc);
43 
44  // config detail: {'name': 'CheckSum_100', 'offset': 0.0, 'precision': 1.0,
45  // 'len': 8, 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 63,
46  // 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
47  Throttlecommand100* set_checksum_100(int checksum_100);
48 
49  // config detail: {'name': 'Throttle_Pedal_Target', 'offset': 0.0,
50  // 'precision': 0.1, 'len': 16, 'is_signed_var': False, 'physical_range':
51  // '[0|100]', 'bit': 31, 'type': 'double', 'order': 'motorola',
52  // 'physical_unit': '%'}
53  Throttlecommand100* set_throttle_pedal_target(double throttle_pedal_target);
54 
55  // config detail: {'name': 'Throttle_EN_CTRL', 'enum': {0:
56  // 'THROTTLE_EN_CTRL_DISABLE', 1: 'THROTTLE_EN_CTRL_ENABLE'},
57  // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
58  // 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum', 'order': 'motorola',
59  // 'physical_unit': ''}
61  Throttle_command_100::Throttle_en_ctrlType throttle_en_ctrl);
62 
63  private:
64  // config detail: {'name': 'Throttle_Acc', 'offset': 0.0, 'precision': 0.01,
65  // 'len': 10, 'is_signed_var': False, 'physical_range': '[0|10]', 'bit': 15,
66  // 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s^2'}
67  void set_p_throttle_acc(uint8_t* data, double throttle_acc);
68 
69  // config detail: {'name': 'CheckSum_100', 'offset': 0.0, 'precision': 1.0,
70  // 'len': 8, 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 63,
71  // 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
72  void set_p_checksum_100(uint8_t* data, int checksum_100);
73 
74  // config detail: {'name': 'Throttle_Pedal_Target', 'offset': 0.0,
75  // 'precision': 0.1, 'len': 16, 'is_signed_var': False, 'physical_range':
76  // '[0|100]', 'bit': 31, 'type': 'double', 'order': 'motorola',
77  // 'physical_unit': '%'}
78  void set_p_throttle_pedal_target(uint8_t* data, double throttle_pedal_target);
79 
80  // config detail: {'name': 'Throttle_EN_CTRL', 'enum': {0:
81  // 'THROTTLE_EN_CTRL_DISABLE', 1: 'THROTTLE_EN_CTRL_ENABLE'},
82  // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
83  // 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum', 'order': 'motorola',
84  // 'physical_unit': ''}
85  void set_p_throttle_en_ctrl(
86  uint8_t* data,
87  Throttle_command_100::Throttle_en_ctrlType throttle_en_ctrl);
88 
89  private:
90  double throttle_acc_;
91  int checksum_100_;
92  double throttle_pedal_target_;
93  Throttle_command_100::Throttle_en_ctrlType throttle_en_ctrl_;
94 };
95 
96 } // namespace devkit
97 } // namespace canbus
98 } // namespace apollo
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
Throttlecommand100 * set_checksum_100(int checksum_100)
Throttlecommand100 * set_throttle_en_ctrl(Throttle_command_100::Throttle_en_ctrlType throttle_en_ctrl)
static const int32_t ID
Definition: throttle_command_100.h:29
void UpdateData(uint8_t *data) override
The class of ProtocolData.
Throttlecommand100 * set_throttle_acc(double throttle_acc)
Throttlecommand100 * set_throttle_pedal_target(double throttle_pedal_target)
Definition: throttle_command_100.h:26