API to know if a node is alive?
I could run a system("rosnode ping -c1 /nodeName"), but this always return return code 0. I could grep the standard output of rosnode, but it sounds quite dirty.
thanks
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
I could run a system("rosnode ping -c1 /nodeName"), but this always return return code 0. I could grep the standard output of rosnode, but it sounds quite dirty.
thanks
I don't know why you're checking for existence, but if your node provides an action, you can wait for the server to start with waitForServer. You can also wait for a transform to become available with waitForTransform.
If you have other reasons, there's apparently a package, interface tester, that was designed to do this, but I can only find the tutorial, not the source. Maybe you'll have better luck finding it.
You could also use the rosnode api. It's in python, and there might be zombie nodes, but it should give you what you need.
To extend what others said: rosnode _sub_rosnode_listnodes() shows that rosnode list
gets nodes ...
Asked: 2013-01-16 01:44:28 -0500
Seen: 6,616 times
Last updated: Jan 16 '13
node on rqt_graph is in red color always
ros node, ros driver and ros wrapper
using the rosnode python API for introspection
rosout keeps respawning even after killall
How to avoid hard coding the node name prefixes while setting ros parameter ?
Why is my_turtle alive even after I finished it?
Create a generic node in python
Node naming and running. rospy.init_node() and .launch file nodes.
did you manage to find out a way to do that?