Apollo  6.0
Open source self driving car software
vcu_vehicle_status_report_101.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2020 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 neolix_edu {
25 
28  ::apollo::canbus::ChassisDetail> {
29  public:
30  static const int32_t ID;
32  void Parse(const std::uint8_t* bytes, int32_t length,
33  ChassisDetail* chassis) const override;
34 
35  private:
36  // config detail: {'description': '0x0:disable;0x1:enable', 'offset': 0.0,
37  // 'precision': 1.0, 'len': 1, 'name': 'Drive_Enable_Resp', 'is_signed_var':
38  // False, 'physical_range': '[0|0]', 'bit': 0, 'type': 'bool', 'order':
39  // 'motorola', 'physical_unit': ''}
40  bool drive_enable_resp(const std::uint8_t* bytes, const int32_t length) const;
41 
42  // config detail: {'description': '0x0:Disconnect;0x1:Connect', 'offset': 0.0,
43  // 'precision': 1.0, 'len': 1, 'name': 'VCU_HighVoltageCircuitState',
44  // 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 2, 'type':
45  // 'bool', 'order': 'motorola', 'physical_unit': ''}
46  bool vcu_highvoltagecircuitstate(const std::uint8_t* bytes,
47  const int32_t length) const;
48 
49  // config detail: {'description': '0x0: Disable;0x1:Enable', 'offset': 0.0,
50  // 'precision': 1.0, 'len': 1, 'name': 'VCU_DCDC_EnabledStates',
51  // 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 3, 'type':
52  // 'bool', 'order': 'motorola', 'physical_unit': ''}
53  bool vcu_dcdc_enabledstates(const std::uint8_t* bytes,
54  const int32_t length) const;
55 
56  // config detail: {'description': '0x0:Standby;0x1:auto drive;0x2:net
57  // drive;0x3:remote control;0x4:emergency brake;0x5~0x7:Reserved', 'enum': {0:
58  // 'CONTROL_MODE_RESP_STANDBY', 1: 'CONTROL_MODE_RESP_AUTO_DRIVE', 2:
59  // 'CONTROL_MODE_RESP_NET_DRIVE', 3: 'CONTROL_MODE_RESP_REMOTE_CONTROL', 4:
60  // 'CONTROL_MODE_RESP_EMERGENCY_BRAKE'}, 'precision': 1.0, 'len': 3, 'name':
61  // 'Control_Mode_Resp', 'is_signed_var': False, 'offset': 0.0,
62  // 'physical_range': '[0|7]', 'bit': 6, 'type': 'enum', 'order': 'motorola',
63  // 'physical_unit': ''}
64  Vcu_vehicle_status_report_101::Control_mode_respType control_mode_resp(
65  const std::uint8_t* bytes, const int32_t length) const;
66 
67  // config detail: {'name': 'VCU_Vehicle_Speed', 'offset': 0.0, 'precision':
68  // 0.05625, 'len': 13, 'is_signed_var': False, 'physical_range': '[0|460.69]',
69  // 'bit': 15, 'type': 'double', 'order': 'motorola', 'physical_unit': 'Km/h'}
70  double vcu_vehicle_speed(const std::uint8_t* bytes,
71  const int32_t length) const;
72 
73  // config detail: {'description': '0x0:Reserved;0x1:Start;0x2:Stop;0x3:Invalid
74  // ', 'offset': 0.0, 'precision': 1.0, 'len': 2, 'name':
75  // 'VCU_LowBatteryChargingFunctionSt', 'is_signed_var': False,
76  // 'physical_range': '[0|0]', 'bit': 17, 'type': 'int', 'order': 'motorola',
77  // 'physical_unit': ''}
78  int vcu_lowbatterychargingfunctionst(const std::uint8_t* bytes,
79  const int32_t length) const;
80 
81  // config detail: {'name': 'VCU_Display_SOC', 'offset': 0.0, 'precision': 1.0,
82  // 'len': 8, 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': 31,
83  // 'type': 'int', 'order': 'motorola', 'physical_unit': '%'}
84  int vcu_display_soc(const std::uint8_t* bytes, const int32_t length) const;
85 
86  // config detail: {'name': 'VCU_Motor_Speed', 'offset': 0.0, 'precision':
87  // 0.25, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
88  // 39, 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
89  double vcu_motor_speed(const std::uint8_t* bytes, const int32_t length) const;
90 
91  // config detail: {'description': '0x0:Standby Status;0x1:Forward
92  // Mode;0x2:Reverse Mode', 'offset': 0.0, 'precision': 1.0, 'len': 2, 'name':
93  // 'VCU_Motor_Direction', 'is_signed_var': False, 'physical_range': '[0|0]',
94  // 'bit': 54, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
95  int vcu_motor_direction(const std::uint8_t* bytes,
96  const int32_t length) const;
97 
98  // config detail: {'description': '0x0:disable;0x1:enable', 'offset': 0.0,
99  // 'precision': 1.0, 'len': 1, 'name': 'VCU_Motor_Speed_Valid',
100  // 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 55, 'type':
101  // 'bool', 'order': 'motorola', 'physical_unit': ''}
102  bool vcu_motor_speed_valid(const std::uint8_t* bytes,
103  const int32_t length) const;
104 
105  // config detail: {'name': 'VCU_StatusRept_AliveCounter', 'offset': 0.0,
106  // 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
107  // '[0|0]', 'bit': 51, 'type': 'int', 'order': 'motorola', 'physical_unit':
108  // ''}
109  int vcu_statusrept_alivecounter(const std::uint8_t* bytes,
110  const int32_t length) const;
111 
112  // config detail: {'name': 'VCU_StatusRept_CheckSum', 'offset': 0.0,
113  // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
114  // '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
115  // ''}
116  int vcu_statusrept_checksum(const std::uint8_t* bytes,
117  const int32_t length) const;
118 };
119 
120 } // namespace neolix_edu
121 } // namespace canbus
122 } // namespace apollo
static const int32_t ID
Definition: vcu_vehicle_status_report_101.h:30
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
Definition: vcu_vehicle_status_report_101.h:26
The class of ProtocolData.
void Parse(const std::uint8_t *bytes, int32_t length, ChassisDetail *chassis) const override