Apollo 11.0
自动驾驶开放平台
apollo::external_command::SpeedCommandProcessor类 参考

#include <speed_command_processor.h>

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

Public 成员函数

bool Init (const std::shared_ptr< cyber::Node > &node) override
 
bool GetCommandStatus (int64_t command_id, CommandStatus *status) const override
 Get the command status.
 
- Public 成员函数 继承自 apollo::external_command::CommandProcessorBase
 CommandProcessorBase ()
 
virtual ~CommandProcessorBase ()=default
 

额外继承的成员函数

- Protected 成员函数 继承自 apollo::external_command::CommandProcessorBase
const CommandProcessorConfig & GetProcessorConfig () const
 
const std::shared_ptr< cyber::Node > & Node () const
 

详细描述

在文件 speed_command_processor.h 第 39 行定义.

成员函数说明

◆ GetCommandStatus()

bool apollo::external_command::SpeedCommandProcessor::GetCommandStatus ( int64_t  command_id,
CommandStatus *  status 
) const
overridevirtual

Get the command status.

参数
command_idId of the command.
statusOutput command status.

实现了 apollo::external_command::CommandProcessorBase.

在文件 speed_command_processor.cc 第 55 行定义.

55 {
56 CHECK_NOTNULL(status);
57 if (command_id != last_received_command_.command_id()) {
58 return false;
59 }
60 status->set_command_id(command_id);
61 // todo: Get planning speed setting status.
63 return true;
64}

◆ Init()

bool apollo::external_command::SpeedCommandProcessor::Init ( const std::shared_ptr< cyber::Node > &  node)
overridevirtual

重载 apollo::external_command::CommandProcessorBase .

在文件 speed_command_processor.cc 第 32 行定义.

32 {
33 // hook: Apollo License Verification: v_apollo_park
34 if (!CommandProcessorBase::Init(node)) {
35 return false;
36 }
37 last_received_command_.set_command_id(-1);
38 message_reader_ = MessageReader::Instance();
39 const auto& config = GetProcessorConfig();
40 command_service_ = node->CreateService<SpeedCommand, CommandStatus>(
41 config.input_command_name(),
42 [this](const std::shared_ptr<SpeedCommand>& command, std::shared_ptr<CommandStatus>& status) {
43 this->OnCommand(command, status);
44 });
45 // Create writer for output command.
46 CHECK(config.output_command_name().size() > 0 && config.input_command_status_name().size() > 0);
47 auto message_writer = MessageWriter::Instance();
48 planning_command_writer_
49 = message_writer->RegisterMessage<apollo::planning::PlanningCommand>(config.output_command_name().Get(0));
50 planning_command_status_name_ = config.input_command_status_name().Get(0);
51 message_reader_->RegisterMessage<CommandStatus>(planning_command_status_name_);
52 return true;
53}
virtual bool Init(const std::shared_ptr< cyber::Node > &node)
const CommandProcessorConfig & GetProcessorConfig() const
void RegisterMessage(const std::string &channel_name)
Register the message reader with the given channel name.

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