Apollo  6.0
Open source self driving car software
brake_control_a4.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 zhongyun {
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': 'brake_torque', 'offset': 0.0, 'precision': 0.05,
40  // 'len': 16, 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': 8,
41  // 'type': 'double', 'order': 'intel', 'physical_unit': '%'}
42  Brakecontrola4* set_brake_torque(double brake_torque);
43 
44  // config detail: {'name': 'Brake_Enable_control', 'enum': {0:
45  // 'BRAKE_ENABLE_CONTROL_BRAKE_MANUAL', 1: 'BRAKE_ENABLE_CONTROL_BRAKE_AUTO'},
46  // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
47  // 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum', 'order': 'intel',
48  // 'physical_unit': ''}
50  Brake_control_a4::Brake_enable_controlType brake_enable_control);
51 
52  private:
53  // config detail: {'name': 'brake_torque', 'offset': 0.0, 'precision': 0.05,
54  // 'len': 16, 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': 8,
55  // 'type': 'double', 'order': 'intel', 'physical_unit': '%'}
56  void set_p_brake_torque(uint8_t* data, double brake_torque);
57 
58  // config detail: {'name': 'Brake_Enable_control', 'enum': {0:
59  // 'BRAKE_ENABLE_CONTROL_BRAKE_MANUAL', 1: 'BRAKE_ENABLE_CONTROL_BRAKE_AUTO'},
60  // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
61  // 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum', 'order': 'intel',
62  // 'physical_unit': ''}
63  void set_p_brake_enable_control(
64  uint8_t* data,
65  Brake_control_a4::Brake_enable_controlType brake_enable_control);
66 
67  private:
68  double brake_torque_;
69  Brake_control_a4::Brake_enable_controlType brake_enable_control_;
70 };
71 
72 } // namespace zhongyun
73 } // namespace canbus
74 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
static const int32_t ID
Definition: brake_control_a4.h:29
This is the base class of protocol data.
Definition: protocol_data.h:44
Brakecontrola4 * set_brake_torque(double brake_torque)
uint32_t GetPeriod() const override
void UpdateData(uint8_t *data) override
Brakecontrola4 * set_brake_enable_control(Brake_control_a4::Brake_enable_controlType brake_enable_control)
Definition: brake_control_a4.h:26
The class of ProtocolData.