Apollo
10.0
自动驾驶开放平台
brake_command_111.h
浏览该文件的文档.
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_vehicle/ch/proto/ch.pb.h"
20
#include "
modules/drivers/canbus/can_comm/protocol_data.h
"
21
22
namespace
apollo
{
23
namespace
canbus {
24
namespace
ch {
25
26
class
Brakecommand111
:
public
::apollo::drivers::canbus::ProtocolData
<
27
::apollo::canbus::Ch> {
28
public
:
29
static
const
int32_t
ID
;
30
31
Brakecommand111
();
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': 0, 'description': 'brake pedal enable bit(Command)',
40
// 'enum': {0: 'BRAKE_PEDAL_EN_CTRL_DISABLE', 1:
41
// 'BRAKE_PEDAL_EN_CTRL_ENABLE'}, 'is_signed_var': False, 'len': 8, 'name':
42
// 'BRAKE_PEDAL_EN_CTRL', 'offset': 0.0, 'order': 'intel', 'physical_range':
43
// '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
44
Brakecommand111
*
set_brake_pedal_en_ctrl
(
45
Brake_command_111::Brake_pedal_en_ctrlType
brake_pedal_en_ctrl);
46
47
// config detail: {'bit': 8, 'description': 'Percentage of brake
48
// pedal(Command)', 'is_signed_var': False, 'len': 8, 'name':
49
// 'BRAKE_PEDAL_CMD', 'offset': 0.0, 'order': 'intel', 'physical_range':
50
// '[0|100]', 'physical_unit': '%', 'precision': 1.0, 'type': 'int'}
51
Brakecommand111
*
set_brake_pedal_cmd
(
int
brake_pedal_cmd);
52
53
private
:
54
// config detail: {'bit': 0, 'description': 'brake pedal enable bit(Command)',
55
// 'enum': {0: 'BRAKE_PEDAL_EN_CTRL_DISABLE', 1:
56
// 'BRAKE_PEDAL_EN_CTRL_ENABLE'}, 'is_signed_var': False, 'len': 8, 'name':
57
// 'BRAKE_PEDAL_EN_CTRL', 'offset': 0.0, 'order': 'intel', 'physical_range':
58
// '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
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: {'bit': 8, 'description': 'Percentage of brake
64
// pedal(Command)', 'is_signed_var': False, 'len': 8, 'name':
65
// 'BRAKE_PEDAL_CMD', 'offset': 0.0, 'order': 'intel', 'physical_range':
66
// '[0|100]', 'physical_unit': '%', 'precision': 1.0, 'type': 'int'}
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
apollo::canbus::ch::Brakecommand111
Definition
brake_command_111.h:27
apollo::canbus::ch::Brakecommand111::set_brake_pedal_cmd
Brakecommand111 * set_brake_pedal_cmd(int brake_pedal_cmd)
Definition
brake_command_111.cc:68
apollo::canbus::ch::Brakecommand111::GetPeriod
uint32_t GetPeriod() const override
Definition
brake_command_111.cc:31
apollo::canbus::ch::Brakecommand111::Reset
void Reset() override
Definition
brake_command_111.cc:42
apollo::canbus::ch::Brakecommand111::Brakecommand111
Brakecommand111()
Definition
brake_command_111.cc:29
apollo::canbus::ch::Brakecommand111::ID
static const int32_t ID
Definition
brake_command_111.h:29
apollo::canbus::ch::Brakecommand111::set_brake_pedal_en_ctrl
Brakecommand111 * set_brake_pedal_en_ctrl(Brake_command_111::Brake_pedal_en_ctrlType brake_pedal_en_ctrl)
Definition
brake_command_111.cc:48
apollo::canbus::ch::Brakecommand111::UpdateData
void UpdateData(uint8_t *data) override
Definition
brake_command_111.cc:37
apollo::drivers::canbus::ProtocolData
This is the base class of protocol data.
Definition
protocol_data.h:44
apollo
class register implement
Definition
arena_queue.h:37
protocol_data.h
The class of ProtocolData
apollo::canbus::Brake_command_111::Brake_pedal_en_ctrlType
Brake_pedal_en_ctrlType
Definition
ch.proto:20
modules
canbus_vehicle
ch
protocol
brake_command_111.h