ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
First you should monitor the cmd_vel topic from the command line using "rostopic echo /cmd_vel" or using the rqt Topic Monitor plugin. After verifying that no messages are showing up on that topic you can look at the code to see why.
Some new users think that the "cmd_vel_pub.publish(twist_msg)" calls will actually "publish" their data. That call actually queues up the data for publication. You need at least one "ros::spinOnce()" call inside the while loop which will send out the queued messages.