Apollo  6.0
Open source self driving car software
brake_command_111.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2019 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 ch {
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': 'brake pedal enable bit(Command)', 'enum':
40  // {0: 'BRAKE_PEDAL_EN_CTRL_DISABLE', 1: 'BRAKE_PEDAL_EN_CTRL_ENABLE'},
41  // 'precision': 1.0, 'len': 8, 'name': 'BRAKE_PEDAL_EN_CTRL', 'is_signed_var':
42  // False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum',
43  // 'order': 'intel', 'physical_unit': ''}
45  Brake_command_111::Brake_pedal_en_ctrlType brake_pedal_en_ctrl);
46 
47  // config detail: {'description': 'Percentage of brake pedal(Command)',
48  // 'offset': 0.0, 'precision': 1.0, 'len': 8, 'name': 'BRAKE_PEDAL_CMD',
49  // 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': 8, 'type':
50  // 'int', 'order': 'intel', 'physical_unit': '%'}
51  Brakecommand111* set_brake_pedal_cmd(int brake_pedal_cmd);
52 
53  private:
54  // config detail: {'description': 'brake pedal enable bit(Command)', 'enum':
55  // {0: 'BRAKE_PEDAL_EN_CTRL_DISABLE', 1: 'BRAKE_PEDAL_EN_CTRL_ENABLE'},
56  // 'precision': 1.0, 'len': 8, 'name': 'BRAKE_PEDAL_EN_CTRL', 'is_signed_var':
57  // False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum',
58  // 'order': 'intel', 'physical_unit': ''}
59  void set_p_brake_pedal_en_ctrl(
60  uint8_t* data,
61  Brake_command_111::Brake_pedal_en_ctrlType brake_pedal_en_ctrl);
62 
63  // config detail: {'description': 'Percentage of brake pedal(Command)',
64  // 'offset': 0.0, 'precision': 1.0, 'len': 8, 'name': 'BRAKE_PEDAL_CMD',
65  // 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': 8, 'type':
66  // 'int', 'order': 'intel', 'physical_unit': '%'}
67  void set_p_brake_pedal_cmd(uint8_t* data, int brake_pedal_cmd);
68 
69  private:
70  Brake_command_111::Brake_pedal_en_ctrlType brake_pedal_en_ctrl_;
71  int brake_pedal_cmd_;
72 };
73 
74 } // namespace ch
75 } // namespace canbus
76 } // namespace apollo
static const int32_t ID
Definition: brake_command_111.h:29
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
This is the base class of protocol data.
Definition: protocol_data.h:44
Brakecommand111 * set_brake_pedal_en_ctrl(Brake_command_111::Brake_pedal_en_ctrlType brake_pedal_en_ctrl)
Brakecommand111 * set_brake_pedal_cmd(int brake_pedal_cmd)
The class of ProtocolData.
uint32_t GetPeriod() const override
Definition: brake_command_111.h:26