Apollo 10.0
自动驾驶开放平台
wheelspeed_6a.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/common_msgs/chassis_msgs/chassis.pb.h"
27#include "modules/canbus_vehicle/lincoln/proto/lincoln.pb.h"
29
34namespace apollo {
35namespace canbus {
36namespace lincoln {
37
44 ::apollo::canbus::Lincoln> {
45 public:
46 static const int32_t ID;
47
48 /*
49 * @brief parse received data
50 * @param bytes a pointer to the input bytes
51 * @param length the length of the input bytes
52 * @param chassis_detail the parsed chassis_detail
53 */
54 virtual void Parse(const std::uint8_t *bytes, int32_t length,
55 Lincoln *chassis_detail) const;
56
57 /*
58 * @brief parse received data
59 * @param bytes a pointer to the input bytes
60 * @param length the length of the input bytes
61 * @param timestamp the timestamp of input bytes
62 * @param chassis_detail the parsed chassis_detail
63 */
64 virtual void Parse(const std::uint8_t *bytes, int32_t length,
65 const struct timeval &timestamp,
66 Lincoln *chassis_detail) const;
67
68 private:
78 double front_left_wheel_speed(const std::uint8_t *bytes,
79 int32_t length) const;
80
90 double front_right_wheel_speed(const std::uint8_t *bytes,
91 int32_t length) const;
92
102 double rear_left_wheel_speed(const std::uint8_t *bytes, int32_t length) const;
103
113 double rear_right_wheel_speed(const std::uint8_t *bytes,
114 int32_t length) const;
115
116 double parse_two_frames(const std::uint8_t low_byte,
117 const std::uint8_t high_byte) const;
118
119 WheelSpeed::WheelSpeedType wheel_direction_convert(double wheel_speed) const;
120};
121
122} // namespace lincoln
123} // namespace canbus
124} // namespace apollo
one of the protocol data of lincoln vehicle
virtual void Parse(const std::uint8_t *bytes, int32_t length, Lincoln *chassis_detail) const
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData