Apollo  6.0
Open source self driving car software
brake_command_101.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': 1, 'enum': {0: 'AEB_EN_CTRL_DISABLE_AEB', 1:
40  // 'AEB_EN_CTRL_ENABLE_AEB'}, 'is_signed_var': False, 'len': 1, 'name':
41  // 'AEB_EN_CTRL', 'offset': 0.0, 'order': 'motorola', 'physical_range':
42  // '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
44  Brake_command_101::Aeb_en_ctrlType aeb_en_ctrl);
45 
46  // config detail: {'bit': 15, 'is_signed_var': False, 'len': 10, 'name':
47  // 'Brake_Dec', 'offset': 0.0, 'order': 'motorola', 'physical_range':
48  // '[0|10]', 'physical_unit': 'm/s^2', 'precision': 0.01, 'type': 'double'}
49  Brakecommand101* set_brake_dec(double brake_dec);
50 
51  // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
52  // 'CheckSum_101', 'offset': 0.0, 'order': 'motorola', 'physical_range':
53  // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
54  Brakecommand101* set_checksum_101(int checksum_101);
55 
56  // config detail: {'bit': 31, 'is_signed_var': False, 'len': 16, 'name':
57  // 'Brake_Pedal_Target', 'offset': 0.0, 'order': 'motorola', 'physical_range':
58  // '[0|100]', 'physical_unit': '%', 'precision': 0.1, 'type': 'double'}
59  Brakecommand101* set_brake_pedal_target(double brake_pedal_target);
60 
61  // config detail: {'bit': 0, 'enum': {0: 'BRAKE_EN_CTRL_DISABLE', 1:
62  // 'BRAKE_EN_CTRL_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name':
63  // 'Brake_EN_CTRL', 'offset': 0.0, 'order': 'motorola', 'physical_range':
64  // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
66  Brake_command_101::Brake_en_ctrlType brake_en_ctrl);
67 
68  private:
69  // config detail: {'bit': 1, 'enum': {0: 'AEB_EN_CTRL_DISABLE_AEB', 1:
70  // 'AEB_EN_CTRL_ENABLE_AEB'}, 'is_signed_var': False, 'len': 1, 'name':
71  // 'AEB_EN_CTRL', 'offset': 0.0, 'order': 'motorola', 'physical_range':
72  // '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
73  void set_p_aeb_en_ctrl(uint8_t* data,
74  Brake_command_101::Aeb_en_ctrlType aeb_en_ctrl);
75 
76  // config detail: {'bit': 15, 'is_signed_var': False, 'len': 10, 'name':
77  // 'Brake_Dec', 'offset': 0.0, 'order': 'motorola', 'physical_range':
78  // '[0|10]', 'physical_unit': 'm/s^2', 'precision': 0.01, 'type': 'double'}
79  void set_p_brake_dec(uint8_t* data, double brake_dec);
80 
81  // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
82  // 'CheckSum_101', 'offset': 0.0, 'order': 'motorola', 'physical_range':
83  // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
84  void set_p_checksum_101(uint8_t* data, int checksum_101);
85 
86  // config detail: {'bit': 31, 'is_signed_var': False, 'len': 16, 'name':
87  // 'Brake_Pedal_Target', 'offset': 0.0, 'order': 'motorola', 'physical_range':
88  // '[0|100]', 'physical_unit': '%', 'precision': 0.1, 'type': 'double'}
89  void set_p_brake_pedal_target(uint8_t* data, double brake_pedal_target);
90 
91  // config detail: {'bit': 0, 'enum': {0: 'BRAKE_EN_CTRL_DISABLE', 1:
92  // 'BRAKE_EN_CTRL_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name':
93  // 'Brake_EN_CTRL', 'offset': 0.0, 'order': 'motorola', 'physical_range':
94  // '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
95  void set_p_brake_en_ctrl(uint8_t* data,
96  Brake_command_101::Brake_en_ctrlType brake_en_ctrl);
97 
98  private:
99  Brake_command_101::Aeb_en_ctrlType aeb_en_ctrl_;
100  double brake_dec_;
101  int checksum_101_;
102  double brake_pedal_target_;
103  Brake_command_101::Brake_en_ctrlType brake_en_ctrl_;
104 };
105 
106 } // namespace devkit
107 } // namespace canbus
108 } // namespace apollo
void UpdateData(uint8_t *data) override
Definition: brake_command_101.h:26
static const int32_t ID
Definition: brake_command_101.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
Brakecommand101 * set_brake_dec(double brake_dec)
Brakecommand101 * set_aeb_en_ctrl(Brake_command_101::Aeb_en_ctrlType aeb_en_ctrl)
Brakecommand101 * set_checksum_101(int checksum_101)
The class of ProtocolData.
Brakecommand101 * set_brake_pedal_target(double brake_pedal_target)
Brakecommand101 * set_brake_en_ctrl(Brake_command_101::Brake_en_ctrlType brake_en_ctrl)
uint32_t GetPeriod() const override