Apollo  6.0
Open source self driving car software
controller_agent.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 <vector>
26 
30 #include "modules/control/proto/control_cmd.pb.h"
31 #include "modules/control/proto/control_conf.pb.h"
32 #include "modules/planning/proto/planning.pb.h"
33 
38 namespace apollo {
39 namespace control {
40 
47  public:
53  common::Status Init(std::shared_ptr<DependencyInjector> injector,
54  const ControlConf *control_conf);
55 
66  const localization::LocalizationEstimate *localization,
67  const canbus::Chassis *chassis, const planning::ADCTrajectory *trajectory,
68  control::ControlCommand *cmd);
69 
75 
76  private:
82  void RegisterControllers(const ControlConf *control_conf);
83 
84  common::Status InitializeConf(const ControlConf *control_conf);
85 
86  const ControlConf *control_conf_ = nullptr;
88  controller_factory_;
89  std::vector<std::unique_ptr<Controller>> controller_list_;
90  std::shared_ptr<DependencyInjector> injector_ = nullptr;
91 };
92 
93 } // namespace control
94 } // namespace apollo
common::Status Reset()
reset ControllerAgent
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Implements a Factory design pattern with Register and Create methods.
Definition: factory.h:60
common::Status Init(std::shared_ptr< DependencyInjector > injector, const ControlConf *control_conf)
initialize ControllerAgent
common::Status ComputeControlCommand(const localization::LocalizationEstimate *localization, const canbus::Chassis *chassis, const planning::ADCTrajectory *trajectory, control::ControlCommand *cmd)
compute control command based on current vehicle status and target trajectory
Defines the Factory class.
manage all controllers declared in control config file.
Definition: controller_agent.h:46
Defines the Controller base class.
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