36 {
38 return false;
39 }
40 message_reader_ = MessageReader::Instance();
42
43 int status = 0;
44 std::string class_name =
45 abi::__cxa_demangle(typeid(*this).name(), nullptr, nullptr, &status);
46 std::string special_config_path =
49 class_name, "conf/special_config.pb.txt");
50 if (!cyber::common::LoadConfig<ActionCommandConfig>(special_config_path,
51 &special_config_)) {
52 AERROR <<
"Cannot get special config of ActionCommandProcessor";
53 return false;
54 }
55
56 command_service_ = node->CreateService<ActionCommand, CommandStatus>(
57 config.input_command_name(),
58 [this](const std::shared_ptr<ActionCommand>& command,
59 std::shared_ptr<CommandStatus>& status) {
60 this->OnCommand(command, status);
61 });
62
63 CHECK_GT(config.output_command_name().size(), 1);
64 auto message_writer = MessageWriter::Instance();
65 planning_action_writer_ =
67 config.output_command_name().Get(0));
68 control_action_writer_ =
70 config.output_command_name().Get(1));
71
72 CHECK_GT(config.input_command_status_name().size(), 2);
73
74 chassis_status_name_ = config.input_command_status_name().Get(0);
75 planning_status_name_ = config.input_command_status_name().Get(1);
76 planning_command_status_name_ = config.input_command_status_name().Get(2);
78 chassis_status_name_);
80 planning_status_name_);
82 planning_command_status_name_);
83 return true;
84}
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
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.