Apollo  6.0
Open source self driving car software
accel_rpt_200.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 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 lexus {
25 
27  ::apollo::canbus::ChassisDetail> {
28  public:
29  static const int32_t ID;
30  Accelrpt200();
31  void Parse(const std::uint8_t* bytes, int32_t length,
32  ChassisDetail* chassis) const override;
33 
34  private:
35  // config detail: {'name': 'VEHICLE_FAULT', 'offset': 0.0, 'precision': 1.0,
36  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 6,
37  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
38  bool vehicle_fault(const std::uint8_t* bytes, const int32_t length) const;
39 
40  // config detail: {'name': 'PACMOD_FAULT', 'offset': 0.0, 'precision': 1.0,
41  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 5,
42  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
43  bool pacmod_fault(const std::uint8_t* bytes, const int32_t length) const;
44 
45  // config detail: {'name': 'OUTPUT_REPORTED_FAULT', 'offset': 0.0,
46  // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
47  // '[0|1]', 'bit': 4, 'type': 'bool', 'order': 'motorola', 'physical_unit':
48  // ''}
49  bool output_reported_fault(const std::uint8_t* bytes,
50  const int32_t length) const;
51 
52  // config detail: {'name': 'INPUT_OUTPUT_FAULT', 'offset': 0.0,
53  // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
54  // '[0|1]', 'bit': 3, 'type': 'bool', 'order': 'motorola', 'physical_unit':
55  // ''}
56  bool input_output_fault(const std::uint8_t* bytes,
57  const int32_t length) const;
58 
59  // config detail: {'name': 'COMMAND_OUTPUT_FAULT', 'offset': 0.0,
60  // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
61  // '[0|1]', 'bit': 2, 'type': 'bool', 'order': 'motorola', 'physical_unit':
62  // ''}
63  bool command_output_fault(const std::uint8_t* bytes,
64  const int32_t length) const;
65 
66  // config detail: {'name': 'OVERRIDE_ACTIVE', 'offset': 0.0, 'precision': 1.0,
67  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 1,
68  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
69  bool override_active(const std::uint8_t* bytes, const int32_t length) const;
70 
71  // config detail: {'name': 'ENABLED', 'offset': 0.0, 'precision': 1.0, 'len':
72  // 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type':
73  // 'bool', 'order': 'motorola', 'physical_unit': ''}
74  bool enabled(const std::uint8_t* bytes, const int32_t length) const;
75 
76  // config detail: {'name': 'MANUAL_INPUT', 'offset': 0.0, 'precision': 0.001,
77  // 'len': 16, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 15,
78  // 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
79  double manual_input(const std::uint8_t* bytes, const int32_t length) const;
80 
81  // config detail: {'name': 'COMMANDED_VALUE', 'offset': 0.0, 'precision':
82  // 0.001, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit':
83  // 31, 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
84  double commanded_value(const std::uint8_t* bytes, const int32_t length) const;
85 
86  // config detail: {'name': 'OUTPUT_VALUE', 'offset': 0.0, 'precision': 0.001,
87  // 'len': 16, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 47,
88  // 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
89  double output_value(const std::uint8_t* bytes, const int32_t length) const;
90 };
91 
92 } // namespace lexus
93 } // namespace canbus
94 } // 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
void Parse(const std::uint8_t *bytes, int32_t length, ChassisDetail *chassis) const override
static const int32_t ID
Definition: accel_rpt_200.h:29
Definition: accel_rpt_200.h:26
The class of ProtocolData.