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

Revision history [back]

click to hide/show revision 1
initial version

Don't move init_node as you suggest. The problem with your first code snippet is that you publish one single message and then exit. This means your publisher is destroyed immediately and no other nodes gets the chance of subscribing before it is too late.

Put the publish line inside a loop as the tutorials show.