Apollo 10.0
自动驾驶开放平台
pc_vcu_205.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/ge3/proto/ge3.pb.h"
21
22namespace apollo {
23namespace canbus {
24namespace ge3 {
25
27 ::apollo::canbus::Ge3> {
28 public:
29 static const int32_t ID;
30
31 Pcvcu205();
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': 'Acceleration pedal request', 'offset': 0.0,
40 // 'precision': 0.05, 'len': 12, 'name': 'PC_AccPedReq', 'is_signed_var':
41 // False, 'physical_range': '[0|100]', 'bit': 15, 'type': 'double', 'order':
42 // 'motorola', 'physical_unit': '%'}
43 Pcvcu205* set_pc_accpedreq(double pc_accpedreq);
44
45 // config detail: {'description': 'Acceleration pedal control enable', 'enum':
46 // {0: 'PC_ACCPEDENABLE_DISABLE', 1: 'PC_ACCPEDENABLE_ENABLE'},
47 // 'precision': 1.0, 'len': 1, 'name': 'PC_AccPedEnable', 'is_signed_var':
48 // False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 6, 'type': 'enum',
49 // 'order': 'motorola', 'physical_unit': ''}
51 Pc_vcu_205::Pc_accpedenableType pc_accpedenable);
52
53 // config detail: {'description': 'Torque request', 'offset': -3000.0,
54 // 'precision': 1.5, 'len': 12, 'name': 'PC_TorqReq', 'is_signed_var': False,
55 // 'physical_range': '[-3000|3000]', 'bit': 19, 'type': 'double', 'order':
56 // 'motorola', 'physical_unit': 'Nm'}
57 Pcvcu205* set_pc_torqreq(double pc_torqreq);
58
59 // config detail: {'description': 'Torque control enable', 'enum': {0:
60 // 'PC_TORQENABLE_DISABLE', 1: 'PC_TORQENABLE_ENABLE'}, 'precision': 1.0,
61 // 'len': 1, 'name': 'PC_TorqEnable', 'is_signed_var': False, 'offset': 0.0,
62 // 'physical_range': '[0|1]', 'bit': 5, 'type': 'enum', 'order': 'motorola',
63 // 'physical_unit': ''}
65
66 // config detail: {'description': 'Gear request', 'enum': {0:
67 // 'PC_GEARREQ_INVALID', 1: 'PC_GEARREQ_DRIVE', 2: 'PC_GEARREQ_NEUTRAL', 3:
68 // 'PC_GEARREQ_REVERSE', 4: 'PC_GEARREQ_PARK'}, 'precision': 1.0, 'len': 3,
69 // 'name': 'PC_GearReq', 'is_signed_var': False, 'offset': 0.0,
70 // 'physical_range': '[0|7]', 'bit': 2, 'type': 'enum', 'order': 'motorola',
71 // 'physical_unit': ''}
73
74 // config detail: {'description': 'Gear control enable', 'enum': {0:
75 // 'PC_GEARENABLE_DISABLE', 1: 'PC_GEARENABLE_ENABLE'}, 'precision': 1.0,
76 // 'len': 1, 'name': 'PC_GearEnable', 'is_signed_var': False, 'offset': 0.0,
77 // 'physical_range': '[0|1]', 'bit': 7, 'type': 'enum', 'order': 'motorola',
78 // 'physical_unit': ''}
80
81 private:
82 // config detail: {'description': 'Acceleration pedal request', 'offset': 0.0,
83 // 'precision': 0.05, 'len': 12, 'name': 'PC_AccPedReq', 'is_signed_var':
84 // False, 'physical_range': '[0|100]', 'bit': 15, 'type': 'double', 'order':
85 // 'motorola', 'physical_unit': '%'}
86 void set_p_pc_accpedreq(uint8_t* data, double pc_accpedreq);
87
88 // config detail: {'description': 'Acceleration pedal control enable', 'enum':
89 // {0: 'PC_ACCPEDENABLE_DISABLE', 1: 'PC_ACCPEDENABLE_ENABLE'},
90 // 'precision': 1.0, 'len': 1, 'name': 'PC_AccPedEnable', 'is_signed_var':
91 // False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 6, 'type': 'enum',
92 // 'order': 'motorola', 'physical_unit': ''}
93 void set_p_pc_accpedenable(uint8_t* data,
94 Pc_vcu_205::Pc_accpedenableType pc_accpedenable);
95
96 // config detail: {'description': 'Torque request', 'offset': -3000.0,
97 // 'precision': 1.5, 'len': 12, 'name': 'PC_TorqReq', 'is_signed_var': False,
98 // 'physical_range': '[-3000|3000]', 'bit': 19, 'type': 'double', 'order':
99 // 'motorola', 'physical_unit': 'Nm'}
100 void set_p_pc_torqreq(uint8_t* data, double pc_torqreq);
101
102 // config detail: {'description': 'Torque control enable', 'enum': {0:
103 // 'PC_TORQENABLE_DISABLE', 1: 'PC_TORQENABLE_ENABLE'}, 'precision': 1.0,
104 // 'len': 1, 'name': 'PC_TorqEnable', 'is_signed_var': False, 'offset': 0.0,
105 // 'physical_range': '[0|1]', 'bit': 5, 'type': 'enum', 'order': 'motorola',
106 // 'physical_unit': ''}
107 void set_p_pc_torqenable(uint8_t* data,
108 Pc_vcu_205::Pc_torqenableType pc_torqenable);
109
110 // config detail: {'description': 'Gear request', 'enum': {0:
111 // 'PC_GEARREQ_INVALID', 1: 'PC_GEARREQ_DRIVE', 2: 'PC_GEARREQ_NEUTRAL', 3:
112 // 'PC_GEARREQ_REVERSE', 4: 'PC_GEARREQ_PARK'}, 'precision': 1.0, 'len': 3,
113 // 'name': 'PC_GearReq', 'is_signed_var': False, 'offset': 0.0,
114 // 'physical_range': '[0|7]', 'bit': 2, 'type': 'enum', 'order': 'motorola',
115 // 'physical_unit': ''}
116 void set_p_pc_gearreq(uint8_t* data, Pc_vcu_205::Pc_gearreqType pc_gearreq);
117
118 // config detail: {'description': 'Gear control enable', 'enum': {0:
119 // 'PC_GEARENABLE_DISABLE', 1: 'PC_GEARENABLE_ENABLE'}, 'precision': 1.0,
120 // 'len': 1, 'name': 'PC_GearEnable', 'is_signed_var': False, 'offset': 0.0,
121 // 'physical_range': '[0|1]', 'bit': 7, 'type': 'enum', 'order': 'motorola',
122 // 'physical_unit': ''}
123 void set_p_pc_gearenable(uint8_t* data,
124 Pc_vcu_205::Pc_gearenableType pc_gearenable);
125
126 private:
127 double pc_accpedreq_;
128 Pc_vcu_205::Pc_accpedenableType pc_accpedenable_;
129 double pc_torqreq_;
130 Pc_vcu_205::Pc_torqenableType pc_torqenable_;
131 Pc_vcu_205::Pc_gearreqType pc_gearreq_;
132 Pc_vcu_205::Pc_gearenableType pc_gearenable_;
133};
134
135} // namespace ge3
136} // namespace canbus
137} // namespace apollo
Pcvcu205 * set_pc_gearenable(Pc_vcu_205::Pc_gearenableType pc_gearenable)
uint32_t GetPeriod() const override
Definition pc_vcu_205.cc:31
static const int32_t ID
Definition pc_vcu_205.h:29
Pcvcu205 * set_pc_torqreq(double pc_torqreq)
Definition pc_vcu_205.cc:99
Pcvcu205 * set_pc_gearreq(Pc_vcu_205::Pc_gearreqType pc_gearreq)
Pcvcu205 * set_pc_accpedenable(Pc_vcu_205::Pc_accpedenableType pc_accpedenable)
Definition pc_vcu_205.cc:80
Pcvcu205 * set_pc_accpedreq(double pc_accpedreq)
Definition pc_vcu_205.cc:56
Pcvcu205 * set_pc_torqenable(Pc_vcu_205::Pc_torqenableType pc_torqenable)
void UpdateData(uint8_t *data) override
Definition pc_vcu_205.cc:37
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData