Apollo 10.0
自动驾驶开放平台
apollo::external_command::ExternalCommandProcessComponent类 参考

The external interface for processing external commands. 更多...

#include <external_command_process_component.h>

类 apollo::external_command::ExternalCommandProcessComponent 继承关系图:
apollo::external_command::ExternalCommandProcessComponent 的协作图:

Public 成员函数

 ExternalCommandProcessComponent ()=default
 
 ~ExternalCommandProcessComponent ()=default
 
bool Init () override
 
- Public 成员函数 继承自 apollo::cyber::Component< M0, M1, M2, M3 >
 Component ()
 
 ~Component () override
 
bool Initialize (const ComponentConfig &config) override
 init the component by protobuf object.
 
bool Process (const std::shared_ptr< M0 > &msg0, const std::shared_ptr< M1 > &msg1, const std::shared_ptr< M2 > &msg2, const std::shared_ptr< M3 > &msg3)
 
- Public 成员函数 继承自 apollo::cyber::ComponentBase
virtual ~ComponentBase ()
 
virtual bool Initialize (const TimerComponentConfig &config)
 
virtual void Shutdown ()
 
template<typename T >
bool GetProtoConfig (T *config) const
 

额外继承的成员函数

- Public 类型 继承自 apollo::cyber::ComponentBase
template<typename M >
using Reader = cyber::Reader< M >
 
- Protected 成员函数 继承自 apollo::cyber::ComponentBase
virtual void Clear ()
 
const std::string & ConfigFilePath () const
 
void LoadConfigFiles (const ComponentConfig &config)
 
void LoadConfigFiles (const TimerComponentConfig &config)
 
- Protected 属性 继承自 apollo::cyber::ComponentBase
std::atomic< bool > is_shutdown_ = {false}
 
std::shared_ptr< Nodenode_ = nullptr
 
std::string config_file_path_ = ""
 
std::vector< std::shared_ptr< ReaderBase > > readers_
 

详细描述

The external interface for processing external commands.

在文件 external_command_process_component.h43 行定义.

构造及析构函数说明

◆ ExternalCommandProcessComponent()

apollo::external_command::ExternalCommandProcessComponent::ExternalCommandProcessComponent ( )
default

◆ ~ExternalCommandProcessComponent()

apollo::external_command::ExternalCommandProcessComponent::~ExternalCommandProcessComponent ( )
default

成员函数说明

◆ Init()

bool ExternalCommandProcessComponent::Init ( )
overridevirtual

实现了 apollo::cyber::ComponentBase.

在文件 external_command_process_component.cc34 行定义.

34 {
35 // Load the external command processors according to the config.
36 ProcessComponentConfig config;
37 if (!GetProtoConfig(&config)) {
38 AERROR << "Unable to load ExternalCommandProcessComponent conf file: "
39 << ConfigFilePath();
40 return false;
41 }
42 const auto& plugin_manager = cyber::plugin_manager::PluginManager::Instance();
43 for (const auto& processor_class_name : config.processor()) {
44 command_processors_.emplace_back(
45 plugin_manager->CreateInstance<CommandProcessorBase>(
46 processor_class_name));
47 command_processors_.back()->Init(node_);
48 }
49 command_status_service_ =
50 node_->CreateService<CommandStatusRequest, CommandStatus>(
51 config.output_command_status_name(),
52 [this](const std::shared_ptr<CommandStatusRequest>& request,
53 std::shared_ptr<CommandStatus>& response) {
54 bool is_get_status = false;
55 // Get the command status from command processors.
56 for (const auto& processor : command_processors_) {
57 if (processor->GetCommandStatus(request->command_id(),
58 response.get())) {
59 is_get_status = true;
60 break;
61 }
62 }
63 if (!is_get_status) {
64 response->set_status(CommandStatusType::UNKNOWN);
65 response->set_message("Cannot get the status of command.");
66 }
67 });
68 AINFO << "ExternalCommandProcessComponent init finished.";
69 return true;
70}
bool GetProtoConfig(T *config) const
const std::string & ConfigFilePath() const
std::shared_ptr< Node > node_
static PluginManager * Instance()
get singleton instance of PluginManager
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42

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