Apollo 10.0
自动驾驶开放平台
apollo::control::ControlTask类 参考abstract

#include <control_task.h>

类 apollo::control::ControlTask 继承关系图:
apollo::control::ControlTask 的协作图:

Public 成员函数

 ControlTask ()=default
 constructor
 
virtual ~ControlTask ()=default
 destructor
 
virtual common::Status Init (std::shared_ptr< DependencyInjector > injector)=0
 initialize Controller
 
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
 
virtual common::Status Reset ()=0
 reset Controller
 
virtual std::string Name () const =0
 controller name
 
virtual void Stop ()=0
 stop controller
 

Protected 成员函数

template<typename T >
bool LoadConfig (T *config)
 
bool LoadCalibrationTable (calibration_table *calibration_table_conf)
 

详细描述

在文件 control_task.h52 行定义.

构造及析构函数说明

◆ ControlTask()

apollo::control::ControlTask::ControlTask ( )
default

constructor

◆ ~ControlTask()

virtual apollo::control::ControlTask::~ControlTask ( )
virtualdefault

destructor

成员函数说明

◆ ComputeControlCommand()

virtual common::Status apollo::control::ControlTask::ComputeControlCommand ( const localization::LocalizationEstimate localization,
const canbus::Chassis chassis,
const planning::ADCTrajectory trajectory,
control::ControlCommand cmd 
)
pure virtual

compute control command based on current vehicle status and target trajectory

参数
localizationvehicle location
chassisvehicle status e.g., speed, acceleration
trajectorytrajectory generated by planning
cmdcontrol command
返回
Status computation status

apollo::control::DemoControlTask, apollo::control::LonController, apollo::control::LatController , 以及 apollo::control::MPCController 内被实现.

◆ Init()

virtual common::Status apollo::control::ControlTask::Init ( std::shared_ptr< DependencyInjector injector)
pure virtual

initialize Controller

参数
control_confcontrol configurations
返回
Status initialization status

apollo::control::DemoControlTask, apollo::control::LatController, apollo::control::LonController , 以及 apollo::control::MPCController 内被实现.

◆ LoadCalibrationTable()

bool apollo::control::ControlTask::LoadCalibrationTable ( calibration_table calibration_table_conf)
inlineprotected

在文件 control_task.h106 行定义.

106 {
107 std::string calibration_table_path = FLAGS_calibration_table_file;
108
109 if (!apollo::cyber::common::GetProtoFromFile(calibration_table_path,
110 calibration_table_conf)) {
111 AERROR << "Load calibration table failed!";
112 return false;
113 }
114 AINFO << "Load the calibraiton table file successfully, file path: "
115 << calibration_table_path;
116 return true;
117 }
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...
Definition file.cc:132

◆ LoadConfig()

template<typename T >
bool apollo::control::ControlTask::LoadConfig ( T *  config)
protected

在文件 control_task.h121 行定义.

121 {
122 int status;
123 std::string class_name =
124 abi::__cxa_demangle(typeid(*this).name(), 0, 0, &status);
125 // Generate the default task config path from PluginManager.
126 std::string config_path_ =
128 ->GetPluginConfPath<ControlTask>(class_name,
129 "conf/controller_conf.pb.txt");
130
131 if (!apollo::cyber::common::GetProtoFromFile(config_path_, config)) {
132 AERROR << "Load config of " << class_name << " failed!";
133 return false;
134 }
135 AINFO << "Load the [" << class_name
136 << "] config file successfully, file path: " << config_path_;
137 return true;
138}
ControlTask()=default
constructor
std::string GetPluginConfPath(const std::string &class_name, const std::string &conf_name)
get plugin configuration file location
static PluginManager * Instance()
get singleton instance of PluginManager

◆ Name()

virtual std::string apollo::control::ControlTask::Name ( ) const
pure virtual

controller name

返回
string controller name in string

apollo::control::DemoControlTask, apollo::control::LatController, apollo::control::LonController , 以及 apollo::control::MPCController 内被实现.

◆ Reset()

virtual common::Status apollo::control::ControlTask::Reset ( )
pure virtual

◆ Stop()

virtual void apollo::control::ControlTask::Stop ( )
pure virtual

该类的文档由以下文件生成: