ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You didn't post the whole code, so I can only guess what is happening.
My suspicion is that this is called somewhere once from your main after startup. In that case the publish line is called, but there are no subscribers connected yet. Just wait until vel_pub_.getNumSubscribers() > 0 and then execute one command.