ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

It appears your node is only very short lived. When your code runs, it inits ROS, creates publishers, tries to publish and then exits. You'll be able to see it in the node list if you add a rospy.spin() at the end as that prevents the direct exit. That won't help with the functionality you want to use, however.

When creating publishers and directly afterwards publishing on them you have to be aware that this won't work in most cases as detailed here, as publishers need to register with the master before they actually become active. The quick fix to that is adding a sleep after publisher creation.