Apollo  6.0
Open source self driving car software
controller.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 <memory>
25 #include <string>
26 
29 #include "modules/control/proto/control_cmd.pb.h"
30 #include "modules/control/proto/control_conf.pb.h"
31 #include "modules/localization/proto/localization.pb.h"
32 #include "modules/planning/proto/planning.pb.h"
33 
38 namespace apollo {
39 namespace control {
40 
46 class Controller {
47  public:
51  Controller() = default;
52 
56  virtual ~Controller() = default;
57 
63  virtual common::Status Init(std::shared_ptr<DependencyInjector> injector,
64  const ControlConf *control_conf) = 0;
65 
76  const localization::LocalizationEstimate *localization,
77  const canbus::Chassis *chassis, const planning::ADCTrajectory *trajectory,
78  control::ControlCommand *cmd) = 0;
79 
84  virtual common::Status Reset() = 0;
85 
90  virtual std::string Name() const = 0;
91 
95  virtual void Stop() = 0;
96 };
97 
98 } // namespace control
99 } // namespace apollo
virtual void Stop()=0
stop controller
virtual std::string Name() const =0
controller name
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
virtual common::Status ComputeControlCommand(const localization::LocalizationEstimate *localization, const canbus::Chassis *chassis, const planning::ADCTrajectory *trajectory, control::ControlCommand *cmd)=0
compute control command based on current vehicle status and target trajectory
base class for all controllers.
Definition: controller.h:46
virtual ~Controller()=default
destructor
virtual common::Status Init(std::shared_ptr< DependencyInjector > injector, const ControlConf *control_conf)=0
initialize Controller
virtual common::Status Reset()=0
reset Controller
A general class to denote the return status of an API call. It can either be an OK status for success...
Definition: status.h:43
Controller()=default
constructor