Apollo  6.0
Open source self driving car software
wheelspeed_6a.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 bytes
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 
67  private:
77  double front_left_wheel_speed(const std::uint8_t *bytes,
78  int32_t length) const;
79 
89  double front_right_wheel_speed(const std::uint8_t *bytes,
90  int32_t length) const;
91 
101  double rear_left_wheel_speed(const std::uint8_t *bytes, int32_t length) const;
102 
112  double rear_right_wheel_speed(const std::uint8_t *bytes,
113  int32_t length) const;
114 
115  double parse_two_frames(const std::uint8_t low_byte,
116  const std::uint8_t high_byte) const;
117 };
118 
119 } // namespace lincoln
120 } // namespace canbus
121 } // 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
one of the protocol data of lincoln vehicle
Definition: wheelspeed_6a.h:42
static const int32_t ID
Definition: wheelspeed_6a.h:45
The class of ProtocolData.
virtual void Parse(const std::uint8_t *bytes, int32_t length, ChassisDetail *chassis_detail) const