API to know whether node is active or not
Hi, I would like to know what is the API in roscpp which can be used whether particular node is active or not.
~can-43811
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Hi, I would like to know what is the API in roscpp which can be used whether particular node is active or not.
~can-43811
Hey
There's a way to get the current nodes registered with ros master using the ros::master::getNodes(v)
This will push the names of the nodes registered into the vector of strings, v.
while (ros::ok())
{
if(!ros::master::getNodes(v))
{
ROS_INFO("Error");
}
else
{
//do your stuff
}
}
You will have to include the libraries
#include "ros/this_node.h"
#include "ros/master.h"
Use rosnode list
to see active nodes that are being running in command window, also by using rqt_graph
is possible to visualize and debug active nodes and topics graphically. For other wanted applications please detail more what you want to do.
Asked: 2017-03-21 20:30:32 -0600
Seen: 2,326 times
Last updated: Mar 22 '17