Apollo  6.0
Open source self driving car software
scu_vcu_1_312.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 ge3 {
25 
27  ::apollo::canbus::ChassisDetail> {
28  public:
29  static const int32_t ID;
30  Scuvcu1312();
31  void Parse(const std::uint8_t* bytes, int32_t length,
32  ChassisDetail* chassis) const override;
33 
34  private:
35  // config detail: {'description': 'Gear fault status', 'enum': {0:
36  // 'VCU_ELCSYSFAULT_NORMAL', 1: 'VCU_ELCSYSFAULT_FAULT'}, 'precision': 1.0,
37  // 'len': 1, 'name': 'VCU_ElcSysFault', 'is_signed_var': False, 'offset': 0.0,
38  // 'physical_range': '[0|0]', 'bit': 49, 'type': 'enum', 'order': 'motorola',
39  // 'physical_unit': ''}
40  Scu_vcu_1_312::Vcu_elcsysfaultType vcu_elcsysfault(
41  const std::uint8_t* bytes, const int32_t length) const;
42 
43  // config detail: {'description': 'Brake pedal position', 'enum': {0:
44  // 'VCU_BRKPEDST_UNPRESSED', 1: 'VCU_BRKPEDST_PRESSED'}, 'precision': 1.0,
45  // 'len': 1, 'name': 'VCU_BrkPedSt', 'is_signed_var': False, 'offset': 0.0,
46  // 'physical_range': '[0|1]', 'bit': 48, 'type': 'enum', 'order': 'motorola',
47  // 'physical_unit': ''}
48  Scu_vcu_1_312::Vcu_brkpedstType vcu_brkpedst(const std::uint8_t* bytes,
49  const int32_t length) const;
50 
51  // config detail: {'description': 'VCU interrupt index', 'enum': {0:
52  // 'VCU_INTIDX_NOINT', 1: 'VCU_INTIDX_OVERFLOW', 2: 'VCU_INTIDX_TIMEOUT', 3:
53  // 'VCU_INTIDX_ACCPEDINT', 4: 'VCU_INTIDX_BRKPEDINT', 5:
54  // 'VCU_INTIDX_GEARINT'}, 'precision': 1.0, 'len': 3, 'name': 'VCU_IntIdx',
55  // 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|7]', 'bit':
56  // 58, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
57  Scu_vcu_1_312::Vcu_intidxType vcu_intidx(const std::uint8_t* bytes,
58  const int32_t length) const;
59 
60  // config detail: {'description': 'Gear interrupt index', 'enum': {0:
61  // 'VCU_GEARINTIDX_NOINT', 1: 'VCU_GEARINTIDX_OVERFLOW', 2:
62  // 'VCU_GEARINTIDX_TIMEOUT'}, 'precision': 1.0, 'len': 3, 'name':
63  // 'VCU_GearIntIdx', 'is_signed_var': False, 'offset': 0.0, 'physical_range':
64  // '[0|7]', 'bit': 61, 'type': 'enum', 'order': 'motorola', 'physical_unit':
65  // ''}
66  Scu_vcu_1_312::Vcu_gearintidxType vcu_gearintidx(const std::uint8_t* bytes,
67  const int32_t length) const;
68 
69  // config detail: {'description': 'VCU Gear drive mode', 'enum': {0:
70  // 'VCU_GEARDRVMODE_INVALID', 1: 'VCU_GEARDRVMODE_MANUAL', 2:
71  // 'VCU_GEARDRVMODE_INTERRUPT', 3: 'VCU_GEARDRVMODE_AUTO'}, 'precision': 1.0,
72  // 'len': 2, 'name': 'VCU_GearDrvMode', 'is_signed_var': False, 'offset': 0.0,
73  // 'physical_range': '[0|3]', 'bit': 63, 'type': 'enum', 'order': 'motorola',
74  // 'physical_unit': ''}
75  Scu_vcu_1_312::Vcu_geardrvmodeType vcu_geardrvmode(
76  const std::uint8_t* bytes, const int32_t length) const;
77 
78  // config detail: {'description': 'Actual acceleration pedal position',
79  // 'offset': 0.0, 'precision': 0.05, 'len': 12, 'name': 'VCU_AccPedAct',
80  // 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': 47, 'type':
81  // 'double', 'order': 'motorola', 'physical_unit': '%'}
82  double vcu_accpedact(const std::uint8_t* bytes, const int32_t length) const;
83 
84  // config detail: {'description': 'Brake pedal position', 'offset': 0.0,
85  // 'precision': 0.392, 'len': 8, 'name': 'VCU_BrkPedPst', 'is_signed_var':
86  // False, 'physical_range': '[0|99.96]', 'bit': 39, 'type': 'double', 'order':
87  // 'motorola', 'physical_unit': '%'}
88  double vcu_brkpedpst(const std::uint8_t* bytes, const int32_t length) const;
89 
90  // config detail: {'description': 'Veh range', 'offset': 0.0,
91  // 'precision': 1.0, 'len': 10, 'name': 'VCU_VehRng', 'is_signed_var': False,
92  // 'physical_range': '[0|1000]', 'bit': 9, 'type': 'int', 'order': 'motorola',
93  // 'physical_unit': 'km'}
94  int vcu_vehrng(const std::uint8_t* bytes, const int32_t length) const;
95 
96  // config detail: {'description': 'Actual acceleration pedal position',
97  // 'offset': 0.0, 'precision': 0.392, 'len': 8, 'name': 'VCU_AccPedPst',
98  // 'is_signed_var': False, 'physical_range': '[0|99.96]', 'bit': 31, 'type':
99  // 'double', 'order': 'motorola', 'physical_unit': '%'}
100  double vcu_accpedpst(const std::uint8_t* bytes, const int32_t length) const;
101 
102  // config detail: {'description': 'HEV system ready status', 'enum': {0:
103  // 'VCU_VEHRDYST_NOTREADY', 1: 'VCU_VEHRDYST_READY'}, 'precision': 1.0, 'len':
104  // 1, 'name': 'VCU_VehRdySt', 'is_signed_var': False, 'offset': 0.0,
105  // 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum', 'order': 'motorola',
106  // 'physical_unit': ''}
107  Scu_vcu_1_312::Vcu_vehrdystType vcu_vehrdyst(const std::uint8_t* bytes,
108  const int32_t length) const;
109 
110  // config detail: {'description': 'VCU fault status', 'enum': {0:
111  // 'VCU_FAULTST_NORMAL', 1: 'VCU_FAULTST_DERATE', 2: 'VCU_FAULTST_RSV1', 3:
112  // 'VCU_FAULTST_RSV2', 4: 'VCU_FAULTST_RSV3', 5: 'VCU_FAULTST_FAULT'},
113  // 'precision': 1.0, 'len': 4, 'name': 'VCU_FaultSt', 'is_signed_var': False,
114  // 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 5, 'type': 'enum',
115  // 'order': 'motorola', 'physical_unit': ''}
116  Scu_vcu_1_312::Vcu_faultstType vcu_faultst(const std::uint8_t* bytes,
117  const int32_t length) const;
118 
119  // config detail: {'description': 'VCU drive mode', 'enum': {0:
120  // 'VCU_DRVMODE_INVALID', 1: 'VCU_DRVMODE_MANUAL', 2: 'VCU_DRVMODE_INTERRUPT',
121  // 3: 'VCU_DRVMODE_AUTO'}, 'precision': 1.0, 'len': 2, 'name': 'VCU_DrvMode',
122  // 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|3]', 'bit': 7,
123  // 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
124  Scu_vcu_1_312::Vcu_drvmodeType vcu_drvmode(const std::uint8_t* bytes,
125  const int32_t length) const;
126 
127  // config detail: {'description': 'Gear lever position', 'enum': {0:
128  // 'VCU_GEARPST_INVALID', 1: 'VCU_GEARPST_DRIVE', 2: 'VCU_GEARPST_NEUTRAL', 3:
129  // 'VCU_GEARPST_REVERSE', 4: 'VCU_GEARPST_PARK'}, 'precision': 1.0, 'len': 3,
130  // 'name': 'VCU_GearPst', 'is_signed_var': False, 'offset': 0.0,
131  // 'physical_range': '[0|7]', 'bit': 12, 'type': 'enum', 'order': 'motorola',
132  // 'physical_unit': ''}
133  Scu_vcu_1_312::Vcu_gearpstType vcu_gearpst(const std::uint8_t* bytes,
134  const int32_t length) const;
135 
136  // config detail: {'description': 'Gear fault status', 'enum': {0:
137  // 'VCU_GEARFAULTST_NORMAL', 1: 'VCU_GEARFAULTST_FAULT'}, 'precision': 1.0,
138  // 'len': 1, 'name': 'VCU_GearFaultSt', 'is_signed_var': False, 'offset': 0.0,
139  // 'physical_range': '[0|0]', 'bit': 1, 'type': 'enum', 'order': 'motorola',
140  // 'physical_unit': ''}
141  Scu_vcu_1_312::Vcu_gearfaultstType vcu_gearfaultst(
142  const std::uint8_t* bytes, const int32_t length) const;
143 
144  // config detail: {'description': 'Actual gear', 'enum': {0:
145  // 'VCU_GEARACT_INVALID', 1: 'VCU_GEARACT_DRIVE', 2: 'VCU_GEARACT_NEUTRAL', 3:
146  // 'VCU_GEARACT_REVERSE', 4: 'VCU_GEARACT_PARK'}, 'precision': 1.0, 'len': 3,
147  // 'name': 'VCU_GearAct', 'is_signed_var': False, 'offset': 0.0,
148  // 'physical_range': '[0|7]', 'bit': 15, 'type': 'enum', 'order': 'motorola',
149  // 'physical_unit': ''}
150  Scu_vcu_1_312::Vcu_gearactType vcu_gearact(const std::uint8_t* bytes,
151  const int32_t length) const;
152 };
153 
154 } // namespace ge3
155 } // namespace canbus
156 } // namespace apollo
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
static const int32_t ID
Definition: scu_vcu_1_312.h:29
void Parse(const std::uint8_t *bytes, int32_t length, ChassisDetail *chassis) const override
The class of ProtocolData.
Definition: scu_vcu_1_312.h:26