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

You have to enter 50,000 because you are running a while loop which adds the current velocity to a "distance", publishes a command, and then immediately repeats, with no delay. The while loop will run as fast as it can, repeating distance/linearVel times (ie, 100,000 times) and then exiting, no matter how far the turtle actually traveled. It just so happened that 50,000 was the magic number for you, and it has no real relationship to the desired 5 metres.

I don't know where your idea came from to take time out of the equation, but please forget it. Distance is always speed integrated over time. Never use anything else.