Expose get_node_names API from node. (#508)

* Exposing get_node_names from node handle

Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>

* Exposing get_node_names from node handle for lifecycle_nodes

Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>

* Fix stray demangle type
This commit is contained in:
Sriram Raghunathan 2018-07-06 06:15:09 +05:30 committed by Shane Loretz
parent 4507d7a40b
commit 93e2945802
4 changed files with 20 additions and 0 deletions

View file

@ -341,6 +341,10 @@ public:
void void
register_param_change_callback(CallbackT && callback); register_param_change_callback(CallbackT && callback);
RCLCPP_PUBLIC
std::vector<std::string>
get_node_names() const;
RCLCPP_PUBLIC RCLCPP_PUBLIC
std::map<std::string, std::vector<std::string>> std::map<std::string, std::vector<std::string>>
get_topic_names_and_types() const; get_topic_names_and_types() const;

View file

@ -173,6 +173,12 @@ Node::list_parameters(
return node_parameters_->list_parameters(prefixes, depth); return node_parameters_->list_parameters(prefixes, depth);
} }
std::vector<std::string>
Node::get_node_names() const
{
return node_graph_->get_node_names();
}
std::map<std::string, std::vector<std::string>> std::map<std::string, std::vector<std::string>>
Node::get_topic_names_and_types() const Node::get_topic_names_and_types() const
{ {

View file

@ -300,6 +300,10 @@ public:
void void
register_param_change_callback(CallbackT && callback); register_param_change_callback(CallbackT && callback);
RCLCPP_LIFECYCLE_PUBLIC
std::vector<std::string>
get_node_names() const;
RCLCPP_LIFECYCLE_PUBLIC RCLCPP_LIFECYCLE_PUBLIC
std::map<std::string, std::vector<std::string>> std::map<std::string, std::vector<std::string>>
get_topic_names_and_types(bool no_demangle = false) const; get_topic_names_and_types(bool no_demangle = false) const;

View file

@ -193,6 +193,12 @@ LifecycleNode::list_parameters(
return node_parameters_->list_parameters(prefixes, depth); return node_parameters_->list_parameters(prefixes, depth);
} }
std::vector<std::string>
LifecycleNode::get_node_names() const
{
return node_graph_->get_node_names();
}
std::map<std::string, std::vector<std::string>> std::map<std::string, std::vector<std::string>>
LifecycleNode::get_topic_names_and_types(bool no_demangle) const LifecycleNode::get_topic_names_and_types(bool no_demangle) const
{ {