Apollo  6.0
Open source self driving car software
steering_65.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2017 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 
22 #pragma once
23 
24 #include <sys/time.h>
25 
26 #include "modules/canbus/proto/chassis_detail.pb.h"
28 
33 namespace apollo {
34 namespace canbus {
35 namespace lincoln {
36 
43  ::apollo::canbus::ChassisDetail> {
44  public:
45  static const int32_t ID;
46 
47  /*
48  * @brief parse received data
49  * @param bytes a pointer to the input bytes
50  * @param length the length of the input bytes
51  * @param chassis_detail the parsed chassis_detail
52  */
53  virtual void Parse(const std::uint8_t *bytes, int32_t length,
54  ChassisDetail *chassis_detail) const;
55 
56  /*
57  * @brief parse received data
58  * @param bytes a pointer to the input bytes
59  * @param length the length of the input bytes
60  * @param timestamp the timestamp of input data
61  * @param chassis_detail the parsed chassis_detail
62  */
63  virtual void Parse(const std::uint8_t *bytes, int32_t length,
64  const struct timeval &timestamp,
65  ChassisDetail *chassis_detail) const;
66 
77  double steering_angle(const std::uint8_t *bytes, int32_t length) const;
78 
89  double reported_steering_angle_cmd(const std::uint8_t *bytes,
90  int32_t length) const;
91 
101  double vehicle_speed(const std::uint8_t *bytes, int32_t length) const;
102 
113  double epas_torque(const std::uint8_t *bytes, int32_t length) const;
114 
124  bool is_enabled(const std::uint8_t *bytes, int32_t length) const;
125 
135  bool is_driver_override(const std::uint8_t *bytes, int32_t length) const;
136 
146  bool is_driver_activity(const std::uint8_t *bytes, int32_t length) const;
147 
157  bool is_watchdog_counter_fault(const std::uint8_t *bytes,
158  int32_t length) const;
159 
169  bool is_channel_1_fault(const std::uint8_t *bytes, int32_t length) const;
170 
180  bool is_channel_2_fault(const std::uint8_t *bytes, int32_t length) const;
181 
191  bool is_calibration_fault(const std::uint8_t *bytes, int32_t length) const;
192 
202  bool is_connector_fault(const std::uint8_t *bytes, int32_t length) const;
203 };
204 
205 } // namespace lincoln
206 } // namespace canbus
207 } // namespace apollo
bool is_calibration_fault(const std::uint8_t *bytes, int32_t length) const
check calibration fault bit based on byte array. config detail: {&#39;name&#39;: &#39;fltcal&#39;, &#39;offset&#39;: 0.0, &#39;precision&#39;: 1.0, &#39;len&#39;: 1, &#39;f_type&#39;: &#39;valid&#39;, &#39;is_signed_var&#39;: False, &#39;physical_range&#39;: &#39;[0|0]&#39;, &#39;bit&#39;: 62, &#39;type&#39;: &#39;bool&#39;, &#39;order&#39;: &#39;intel&#39;, &#39;physical_unit&#39;: &#39;""&#39;}
static const int32_t ID
Definition: steering_65.h:45
bool is_enabled(const std::uint8_t *bytes, int32_t length) const
check enabled bit based on byte array. config detail: {&#39;name&#39;: &#39;en&#39;, &#39;offset&#39;: 0.0, &#39;precision&#39;: 1.0, &#39;len&#39;: 1, &#39;f_type&#39;: &#39;valid&#39;, &#39;is_signed_var&#39;: False, &#39;physical_range&#39;: &#39;[0|0]&#39;, &#39;bit&#39;: 56, &#39;type&#39;: &#39;bool&#39;, &#39;order&#39;: &#39;intel&#39;, &#39;physical_unit&#39;: &#39;""&#39;}
double steering_angle(const std::uint8_t *bytes, int32_t length) const
calculate steering angle based on byte array. config detail: {&#39;name&#39;: &#39;angle&#39;, &#39;offset&#39;: 0...
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
bool is_connector_fault(const std::uint8_t *bytes, int32_t length) const
check connector fault bit based on byte array. config detail: {&#39;name&#39;: &#39;fltcon&#39;, &#39;offset&#39;: 0...
bool is_watchdog_counter_fault(const std::uint8_t *bytes, int32_t length) const
check watchdog counter fault based on byte array. config detail: {&#39;name&#39;: &#39;fltwdc&#39;, &#39;offset&#39;: 0.0, &#39;precision&#39;: 1.0, &#39;len&#39;: 1, &#39;f_type&#39;: &#39;valid&#39;, &#39;is_signed_var&#39;: False, &#39;physical_range&#39;: &#39;[0|0]&#39;, &#39;bit&#39;: 59, &#39;type&#39;: &#39;bool&#39;, &#39;order&#39;: &#39;intel&#39;, &#39;physical_unit&#39;: &#39;""&#39;}
one of the protocol data of lincoln vehicle
Definition: steering_65.h:42
virtual void Parse(const std::uint8_t *bytes, int32_t length, ChassisDetail *chassis_detail) const
bool is_channel_1_fault(const std::uint8_t *bytes, int32_t length) const
check channel 1 fault bit based on byte array. config detail: {&#39;name&#39;: &#39;flt1&#39;, &#39;offset&#39;: 0...
double epas_torque(const std::uint8_t *bytes, int32_t length) const
calculate epas torque based on byte array. config detail: {&#39;name&#39;: &#39;torque&#39;, &#39;offset&#39;: 0...
double reported_steering_angle_cmd(const std::uint8_t *bytes, int32_t length) const
calculate reported steering angle command based on byte array. config detail: {&#39;name&#39;: &#39;cmd&#39;...
The class of ProtocolData.
bool is_channel_2_fault(const std::uint8_t *bytes, int32_t length) const
check channel 2 fault bit based on byte array. config detail: {&#39;name&#39;: &#39;flt2&#39;, &#39;offset&#39;: 0...
bool is_driver_override(const std::uint8_t *bytes, int32_t length) const
check driver override bit based on byte array. config detail: {&#39;name&#39;: &#39;override&#39;, &#39;offset&#39;: 0.0, &#39;precision&#39;: 1.0, &#39;len&#39;: 1, &#39;f_type&#39;: &#39;valid&#39;, &#39;is_signed_var&#39;: False, &#39;physical_range&#39;: &#39;[0|0]&#39;, &#39;bit&#39;: 57, &#39;type&#39;: &#39;bool&#39;, &#39;order&#39;: &#39;intel&#39;, &#39;physical_unit&#39;: &#39;""&#39;}
double vehicle_speed(const std::uint8_t *bytes, int32_t length) const
calculate vehicle speed based on byte array. config detail: {&#39;name&#39;: &#39;speed&#39;, &#39;offset&#39;: 0...
bool is_driver_activity(const std::uint8_t *bytes, int32_t length) const
check driver activity bit based on byte array. config detail: {&#39;name&#39;: &#39;driver&#39;, &#39;offset&#39;: 0...