Apollo 10.0
自动驾驶开放平台
brake_60.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 "modules/canbus_vehicle/lincoln/proto/lincoln.pb.h"
26
31namespace apollo {
32namespace canbus {
33namespace lincoln {
34
41 ::apollo::canbus::Lincoln> {
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
one of the protocol data of lincoln vehicle
Definition brake_60.h:41
Brake60 * set_pedal(double pcmd)
set pedal based on pedal command
Definition brake_60.cc:52
uint32_t GetPeriod() const override
get the data period
Definition brake_60.cc:30
Brake60 * set_enable()
set pedal_enable_ to true
Definition brake_60.cc:72
void Reset() override
reset the private variables
Definition brake_60.cc:43
Brake60 * set_disable()
set pedal_enable_ to false
Definition brake_60.cc:77
static const int32_t ID
Definition brake_60.h:43
void UpdateData(uint8_t *data) override
update the data
Definition brake_60.cc:35
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData