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 -0600
Seen: 6,701 times
Last updated: Jan 16 '13
Access ROS command-line tools via Java
ROS sans Master Server/Parameter Server?
using the rosnode python API for introspection
rosnode kill doesn't kill a node
infinite "node restart" when using roslaunch
Is it possible to have 2 nodehandlers for a single node
Help with writing a subscriber node for an existing publisher
did you manage to find out a way to do that?