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

Revision history [back]

When a publisher is created, there is some setup performed "behind the scenes", such as registering with the ROS Master and potential subscribers. This means that when one publishes immediately after creation of the publisher, messages might not actually get out because the Publisher wasn't "ready" yet. See for instance also other Q/As such as this one. Pretty sure that adding a sleep here in line 13 would fix the issue.