Apollo 10.0
自动驾驶开放平台
steering_65.h
浏览该文件的文档.
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_vehicle/lincoln/proto/lincoln.pb.h"
28
33namespace apollo {
34namespace canbus {
35namespace lincoln {
36
43 ::apollo::canbus::Lincoln> {
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 Lincoln *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 Lincoln *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
one of the protocol data of lincoln vehicle
Definition steering_65.h:43
double epas_torque(const std::uint8_t *bytes, int32_t length) const
calculate epas torque based on byte array.
bool is_enabled(const std::uint8_t *bytes, int32_t length) const
check enabled bit based on byte array.
double reported_steering_angle_cmd(const std::uint8_t *bytes, int32_t length) const
calculate reported steering angle command based on byte array.
bool is_connector_fault(const std::uint8_t *bytes, int32_t length) const
check connector fault bit based on byte array.
bool is_channel_2_fault(const std::uint8_t *bytes, int32_t length) const
check channel 2 fault bit based on byte array.
virtual void Parse(const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
bool is_watchdog_counter_fault(const std::uint8_t *bytes, int32_t length) const
check watchdog counter fault based on byte array.
bool is_driver_activity(const std::uint8_t *bytes, int32_t length) const
check driver activity bit based on byte array.
bool is_driver_override(const std::uint8_t *bytes, int32_t length) const
check driver override bit based on byte array.
bool is_channel_1_fault(const std::uint8_t *bytes, int32_t length) const
check channel 1 fault bit based on byte array.
bool is_calibration_fault(const std::uint8_t *bytes, int32_t length) const
check calibration fault bit based on byte array.
double steering_angle(const std::uint8_t *bytes, int32_t length) const
calculate steering angle based on byte array.
double vehicle_speed(const std::uint8_t *bytes, int32_t length) const
calculate vehicle speed based on byte array.
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData