fix error default_topic
This commit is contained in:
@@ -1098,6 +1098,23 @@ std::string CerebellumNode::ResolveTopicForSkill(const std::string & skill) cons
|
||||
return c.topic;
|
||||
}
|
||||
}
|
||||
|
||||
if (skill_manager_) {
|
||||
const auto & skills = skill_manager_->skills();
|
||||
auto it = skills.find(skill);
|
||||
if (it != skills.end()) {
|
||||
const auto & spec = it->second;
|
||||
for (const auto & iface : spec.interfaces) {
|
||||
if (iface.find(".action") != std::string::npos) {
|
||||
auto topic_it = spec.interface_default_topics.find(iface);
|
||||
if (topic_it != spec.interface_default_topics.end()) {
|
||||
return topic_it->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const std::string snake = ToSnake(skill);
|
||||
if (action_clients_->has_client(snake)) {return snake;}
|
||||
if (action_clients_->has_client(skill)) {return skill;}
|
||||
|
||||
Reference in New Issue
Block a user