Apollo
10.0
自动驾驶开放平台
throttle_command_110.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
20
#include "modules/canbus_vehicle/ch/proto/ch.pb.h"
21
#include "
modules/drivers/canbus/can_comm/protocol_data.h
"
22
23
namespace
apollo
{
24
namespace
canbus {
25
namespace
ch {
26
27
class
Throttlecommand110
:
public
::apollo::drivers::canbus::ProtocolData
<
28
::apollo::canbus::Ch> {
29
public
:
30
static
const
int32_t
ID
;
31
32
Throttlecommand110
();
33
34
uint32_t
GetPeriod
()
const override
;
35
36
void
UpdateData
(uint8_t* data)
override
;
37
38
void
Reset
()
override
;
39
40
// config detail: {'bit': 0, 'description': 'throttle pedal enable
41
// bit(Command)', 'enum': {0: 'THROTTLE_PEDAL_EN_CTRL_DISABLE', 1:
42
// 'THROTTLE_PEDAL_EN_CTRL_ENABLE'}, 'is_signed_var': False, 'len': 8, 'name':
43
// 'THROTTLE_PEDAL_EN_CTRL', 'offset': 0.0, 'order': 'intel',
44
// 'physical_range': '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type':
45
// 'enum'}
46
Throttlecommand110
*
set_throttle_pedal_en_ctrl
(
47
Throttle_command_110::Throttle_pedal_en_ctrlType
throttle_pedal_en_ctrl);
48
49
// config detail: {'bit': 8, 'description': 'Percentage of throttle
50
// pedal(Command)', 'is_signed_var': False, 'len': 8, 'name':
51
// 'THROTTLE_PEDAL_CMD', 'offset': 0.0, 'order': 'intel', 'physical_range':
52
// '[0|100]', 'physical_unit': '%', 'precision': 1.0, 'type': 'int'}
53
Throttlecommand110
*
set_throttle_pedal_cmd
(
int
throttle_pedal_cmd);
54
55
private
:
56
// config detail: {'bit': 0, 'description': 'throttle pedal enable
57
// bit(Command)', 'enum': {0: 'THROTTLE_PEDAL_EN_CTRL_DISABLE', 1:
58
// 'THROTTLE_PEDAL_EN_CTRL_ENABLE'}, 'is_signed_var': False, 'len': 8, 'name':
59
// 'THROTTLE_PEDAL_EN_CTRL', 'offset': 0.0, 'order': 'intel',
60
// 'physical_range': '[0|1]', 'physical_unit': '', 'precision': 1.0, 'type':
61
// 'enum'}
62
void
set_p_throttle_pedal_en_ctrl(
63
uint8_t* data,
64
Throttle_command_110::Throttle_pedal_en_ctrlType
throttle_pedal_en_ctrl);
65
66
// config detail: {'bit': 8, 'description': 'Percentage of throttle
67
// pedal(Command)', 'is_signed_var': False, 'len': 8, 'name':
68
// 'THROTTLE_PEDAL_CMD', 'offset': 0.0, 'order': 'intel', 'physical_range':
69
// '[0|100]', 'physical_unit': '%', 'precision': 1.0, 'type': 'int'}
70
void
set_p_throttle_pedal_cmd(uint8_t* data,
int
throttle_pedal_cmd);
71
72
private
:
73
Throttle_command_110::Throttle_pedal_en_ctrlType
throttle_pedal_en_ctrl_;
74
int
throttle_pedal_cmd_;
75
};
76
77
}
// namespace ch
78
}
// namespace canbus
79
}
// namespace apollo
apollo::canbus::ch::Throttlecommand110
Definition
throttle_command_110.h:28
apollo::canbus::ch::Throttlecommand110::Reset
void Reset() override
Definition
throttle_command_110.cc:42
apollo::canbus::ch::Throttlecommand110::ID
static const int32_t ID
Definition
throttle_command_110.h:30
apollo::canbus::ch::Throttlecommand110::GetPeriod
uint32_t GetPeriod() const override
Definition
throttle_command_110.cc:31
apollo::canbus::ch::Throttlecommand110::set_throttle_pedal_cmd
Throttlecommand110 * set_throttle_pedal_cmd(int throttle_pedal_cmd)
Definition
throttle_command_110.cc:69
apollo::canbus::ch::Throttlecommand110::Throttlecommand110
Throttlecommand110()
Definition
throttle_command_110.cc:29
apollo::canbus::ch::Throttlecommand110::UpdateData
void UpdateData(uint8_t *data) override
Definition
throttle_command_110.cc:37
apollo::canbus::ch::Throttlecommand110::set_throttle_pedal_en_ctrl
Throttlecommand110 * set_throttle_pedal_en_ctrl(Throttle_command_110::Throttle_pedal_en_ctrlType throttle_pedal_en_ctrl)
Definition
throttle_command_110.cc:49
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::Throttle_command_110::Throttle_pedal_en_ctrlType
Throttle_pedal_en_ctrlType
Definition
ch.proto:8
modules
canbus_vehicle
ch
protocol
throttle_command_110.h