Apollo  6.0
Open source self driving car software
vcu_report_505.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 devkit {
25 
27  ::apollo::canbus::ChassisDetail> {
28  public:
29  static const int32_t ID;
30  Vcureport505();
31  void Parse(const std::uint8_t* bytes, int32_t length,
32  ChassisDetail* chassis) const override;
33 
34  private:
35  // config detail: {'bit': 36, 'enum': {0:
36  // 'VEHICLE_MODE_STATE_MANUAL_REMOTE_MODE', 1: 'VEHICLE_MODE_STATE_AUTO_MODE',
37  // 2: 'VEHICLE_MODE_STATE_EMERGENCY_MODE', 3:
38  // 'VEHICLE_MODE_STATE_STANDBY_MODE'}, 'is_signed_var': False, 'len': 2,
39  // 'name': 'Vehicle_Mode_State', 'offset': 0.0, 'order': 'motorola',
40  // 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
41  // 'enum'}
42  Vcu_report_505::Vehicle_mode_stateType vehicle_mode_state(
43  const std::uint8_t* bytes, const int32_t length) const;
44 
45  // config detail: {'bit': 33, 'enum': {0: 'FRONTCRASH_STATE_NO_EVENT', 1:
46  // 'FRONTCRASH_STATE_CRASH_EVENT'}, 'is_signed_var': False, 'len': 1, 'name':
47  // 'FrontCrash_State', 'offset': 0.0, 'order': 'motorola', 'physical_range':
48  // '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
49  Vcu_report_505::Frontcrash_stateType frontcrash_state(
50  const std::uint8_t* bytes, const int32_t length) const;
51 
52  // config detail: {'bit': 34, 'enum': {0: 'BACKCRASH_STATE_NO_EVENT', 1:
53  // 'BACKCRASH_STATE_CRASH_EVENT'}, 'is_signed_var': False, 'len': 1, 'name':
54  // 'BackCrash_State', 'offset': 0.0, 'order': 'motorola', 'physical_range':
55  // '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
56  Vcu_report_505::Backcrash_stateType backcrash_state(
57  const std::uint8_t* bytes, const int32_t length) const;
58 
59  // config detail: {'bit': 32, 'enum': {0: 'AEB_STATE_INACTIVE', 1:
60  // 'AEB_STATE_ACTIVE'}, 'is_signed_var': False, 'len': 1, 'name': 'AEB_State',
61  // 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]',
62  // 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
63  Vcu_report_505::Aeb_stateType aeb_state(const std::uint8_t* bytes,
64  const int32_t length) const;
65 
66  // config detail: {'bit': 7, 'is_signed_var': True, 'len': 12, 'name': 'ACC',
67  // 'offset': 0.0, 'order': 'motorola', 'physical_range': '[-10|10]',
68  // 'physical_unit': 'm/s^2', 'precision': 0.01, 'type': 'double'}
69  double acc(const std::uint8_t* bytes, const int32_t length) const;
70 
71  // config detail: {'bit': 23, 'is_signed_var': False, 'len': 16, 'name':
72  // 'SPEED', 'offset': 0.0, 'order': 'motorola', 'physical_range':
73  // '[0|65.535]', 'physical_unit': 'm/s', 'precision': 0.001, 'type': 'double'}
74  double speed(const std::uint8_t* bytes, const int32_t length) const;
75 };
76 
77 } // namespace devkit
78 } // namespace canbus
79 } // namespace apollo
Definition: vcu_report_505.h:26
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: vcu_report_505.h:29
The class of ProtocolData.
void Parse(const std::uint8_t *bytes, int32_t length, ChassisDetail *chassis) const override