Apollo 10.0
自动驾驶开放平台
demo_control_task.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 <memory>
25#include <string>
26#include <vector>
27
28#include "modules/common_msgs/config_msgs/vehicle_config.pb.h"
29#include "modules/control/controllers/demo_control_task/proto/demo_control_task_conf.pb.h"
30
33
38namespace apollo {
39namespace control {
40
48 public:
53
57 virtual ~DemoControlTask();
58
63 common::Status Init(std::shared_ptr<DependencyInjector> injector) override;
64
75 const localization::LocalizationEstimate *localization,
76 const canbus::Chassis *chassis, const planning::ADCTrajectory *trajectory,
77 control::ControlCommand *cmd) override;
78
82 void Stop() override;
83
88 common::Status Reset() override;
89
94 std::string Name() const override;
95
96 protected:
97 std::shared_ptr<DependencyInjector> injector_;
98
99 private:
100 std::string name_;
101 double low_bound_acceleration_ = 0.0;
102 DemoControlTaskConf demo_control_task_conf_;
103};
104
105// 1.2 当前类声明为插件
108
109} // namespace control
110} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
DemoControlTask: Set the acceleration to 2 when the vehicle acceleration is less than 3.
std::string Name() const override
DemoControlTask name
void Stop() override
stop DemoControlTask
common::Status ComputeControlCommand(const localization::LocalizationEstimate *localization, const canbus::Chassis *chassis, const planning::ADCTrajectory *trajectory, control::ControlCommand *cmd) override
compute brake / throttle values based on current vehicle status and target trajectory
common::Status Reset() override
reset demo control task
std::shared_ptr< DependencyInjector > injector_
common::Status Init(std::shared_ptr< DependencyInjector > injector) override
initialize DemoControlTask
Defines the Controller base class.
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
class register implement
Definition arena_queue.h:37