Apollo  6.0
Open source self driving car software
brake_60.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;
48  uint32_t GetPeriod() const override;
49 
54  void UpdateData(uint8_t *data) override;
55 
59  void Reset() override;
60 
65  Brake60 *set_pedal(double pcmd);
66 
72 
78 
79  private:
84  Brake60 *enable_boo_cmd();
85 
90  Brake60 *disable_boo_cmd();
91 
98  void set_pedal_p(uint8_t *data, double pedal);
99 
105  void set_boo_cmd_p(uint8_t *bytes, bool boo_cmd);
106 
112  void set_enable_p(uint8_t *bytes, bool en);
113 
119  void set_clear_driver_override_flag_p(uint8_t *bytes, bool clear);
120 
126  void set_ignore_driver_override_p(uint8_t *bytes, bool ignore);
127 
128  /*
129  * config detail: {'name': 'count', 'offset': 0.0, 'precision': 1.0, 'len': 8,
130  * 'f_type': 'value', 'is_signed_var': False, 'physical_range': '[0|255]',
131  * 'bit': 56, 'type': 'int', 'order': 'intel', 'physical_unit': '""'}
132  */
133  void set_watchdog_counter_p(uint8_t *data, int32_t count);
134 
135  private:
136  double pedal_cmd_ = 0.0;
137  bool boo_cmd_ = false;
138  bool pedal_enable_ = false;
139  bool clear_driver_override_flag_ = false;
140  bool ignore_driver_override_ = false;
141  int32_t watchdog_counter_ = 0.0;
142 };
143 
144 } // namespace lincoln
145 } // namespace canbus
146 } // 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
Brake60 * set_disable()
set pedal_enable_ to false
Brake60 * set_pedal(double pcmd)
set pedal based on pedal command
void Reset() override
reset the private variables
static const int32_t ID
Definition: brake_60.h:43
one of the protocol data of lincoln vehicle
Definition: brake_60.h:40
void UpdateData(uint8_t *data) override
update the data
Brake60 * set_enable()
set pedal_enable_ to true
The class of ProtocolData.
uint32_t GetPeriod() const override
get the data period