# Calculating distance using linear velocity and time.

The general simplest approach in ROS is to calculate the distance by multiplying the time elapsed with the linear velocity. As can be seen from this link http://wiki.ros.org/turtlesim/Tutoria...

Since, i am a beginner in ROS i tried the approach used in games. Which is adding the velocity every time to a current_distance variable initialized to zero. But this approach doesn't work well. Code here https://pastebin.com/c0dJB4XQ

if i want to travel 5 meters in the first method, i will have to enter 50,000 meters to travel the same distance on the screen. I don't seem to figure out this anomaly.

I used turtlesim for my practice and learning.