Apollo  6.0
Open source self driving car software
scu_eps_311.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  Scueps311();
31  void Parse(const std::uint8_t* bytes, int32_t length,
32  ChassisDetail* chassis) const override;
33 
34  private:
35  // config detail: {'description': 'EPS interrupt index', 'enum': {0:
36  // 'EPS_INTIDX_NOINT', 1: 'EPS_INTIDX_OVERFLOW', 2: 'EPS_INTIDX_TIMEOUT', 3:
37  // 'EPS_INTIDX_STEERINT'}, 'precision': 1.0, 'len': 3, 'name': 'EPS_IntIdx',
38  // 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|7]', 'bit': 6,
39  // 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
40  Scu_eps_311::Eps_intidxType eps_intidx(const std::uint8_t* bytes,
41  const int32_t length) const;
42 
43  // config detail: {'description': 'Steer angle speed', 'offset': 0.0,
44  // 'precision': 4.0, 'len': 8, 'name': 'EPS_SteerAngleSpd', 'is_signed_var':
45  // False, 'physical_range': '[0|1016]', 'bit': 15, 'type': 'double', 'order':
46  // 'motorola', 'physical_unit': 'deg/s'}
47  double eps_steeranglespd(const std::uint8_t* bytes,
48  const int32_t length) const;
49 
50  // config detail: {'description': 'Steer angle Left + right -', 'offset':
51  // -780.0, 'precision': 0.1, 'len': 16, 'name': 'EPS_SteerAngle',
52  // 'is_signed_var': False, 'physical_range': '[-780|779.9]', 'bit': 23,
53  // 'type': 'double', 'order': 'motorola', 'physical_unit': 'deg'}
54  double eps_steerangle(const std::uint8_t* bytes, const int32_t length) const;
55 
56  // config detail: {'description': 'EPS fault status', 'enum': {0:
57  // 'EPS_FAULTST_NORMAL', 1: 'EPS_FAULTST_FAULT'}, 'precision': 1.0, 'len': 1,
58  // 'name': 'EPS_FaultSt', 'is_signed_var': False, 'offset': 0.0,
59  // 'physical_range': '[0|1]', 'bit': 7, 'type': 'enum', 'order': 'motorola',
60  // 'physical_unit': ''}
61  Scu_eps_311::Eps_faultstType eps_faultst(const std::uint8_t* bytes,
62  const int32_t length) const;
63 
64  // config detail: {'description': 'EPS drive mode', 'enum': {0:
65  // 'EPS_DRVMODE_INVALID', 1: 'EPS_DRVMODE_MANUAL', 2: 'EPS_DRVMODE_INTERRUPT',
66  // 3: 'EPS_DRVMODE_AUTO'}, 'precision': 1.0, 'len': 2, 'name': 'EPS_DrvMode',
67  // 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|3]', 'bit': 1,
68  // 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
69  Scu_eps_311::Eps_drvmodeType eps_drvmode(const std::uint8_t* bytes,
70  const int32_t length) const;
71 };
72 
73 } // namespace ge3
74 } // namespace canbus
75 } // namespace apollo
static const int32_t ID
Definition: scu_eps_311.h:29
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
Definition: scu_eps_311.h:26
The class of ProtocolData.