Apollo  6.0
Open source self driving car software
brake_61.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 "modules/canbus/proto/chassis_detail.pb.h"
26 
31 namespace apollo {
32 namespace canbus {
33 namespace lincoln {
34 
41  ::apollo::canbus::ChassisDetail> {
42  public:
43  static const int32_t ID;
44 
45  /*
46  * @brief parse received data
47  * @param bytes a pointer to the input bytes
48  * @param length the length of the input bytes
49  * @param timestamp the timestamp of input data
50  * @param chassis_detail the parsed chassis_detail
51  */
52  virtual void Parse(const std::uint8_t *bytes, int32_t length,
53  ChassisDetail *chassis_detail) const;
54 
55  private:
66  double pedal_input(const std::uint8_t *bytes, int32_t length) const;
67 
78  double pedal_cmd(const std::uint8_t *bytes, int32_t length) const;
79 
90  double pedal_output(const std::uint8_t *bytes, int32_t length) const;
91 
92  double parse_two_frames(const std::uint8_t low_byte,
93  const std::uint8_t high_byte) const;
94 
104  bool boo_input(const std::uint8_t *bytes, int32_t length) const;
105 
115  bool boo_cmd(const std::uint8_t *bytes, int32_t length) const;
116 
126  bool boo_output(const std::uint8_t *bytes, int32_t length) const;
127 
137  bool is_watchdog_counter_applying_brakes(const std::uint8_t *bytes,
138  int32_t length) const;
139 
149  int32_t watchdog_counter_source(const std::uint8_t *bytes,
150  int32_t length) const;
151 
161  bool is_enabled(const std::uint8_t *bytes, int32_t length) const;
162 
172  bool is_driver_override(const std::uint8_t *bytes, int32_t length) const;
173 
183  bool is_driver_activity(const std::uint8_t *bytes, int32_t length) const;
184 
194  bool is_watchdog_counter_fault(const std::uint8_t *bytes,
195  int32_t length) const;
196 
206  bool is_channel_1_fault(const std::uint8_t *bytes, int32_t length) const;
207 
217  bool is_channel_2_fault(const std::uint8_t *bytes, int32_t length) const;
218 
228  bool is_boo_switch_fault(const std::uint8_t *bytes, int32_t length) const;
229 
239  bool is_connector_fault(const std::uint8_t *bytes, int32_t length) const;
240 };
241 
242 } // namespace lincoln
243 } // namespace canbus
244 } // namespace apollo
static const int32_t ID
Definition: brake_61.h:43
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
virtual void Parse(const std::uint8_t *bytes, int32_t length, ChassisDetail *chassis_detail) const
one of the protocol data of lincoln vehicle
Definition: brake_61.h:40
The class of ProtocolData.