 How to calculate distance using arduino

I am using GSM module with arduino and also drive motors of robot. so I want to calculate how much distance covered by robot linearly and print that distance in message which will send through GSM module.

i tried this formula in void loop pathcovered = 2*3.14*radius*rps of motor but its not working. plz help me.

Post your whole code, and also explain in what way it's not working, not just that "its not working"....

You need some kind of position sensor in at least one wheel so you can count the number of revolutions the wheel has completed. You plug THAT number into the 2*Pi*r formula to get distance.

sagarsukoshe: I am using GSM module with arduino and also drive motors of robot. so I want to calculate how much distance covered by robot linearly and print that distance in message which will send through GSM module.

i tried this formula in void loop pathcovered = 2*3.14*radius*rps of motor but its not working. plz help me.

Assuming that "rps" = revolutions per second That should give you your rate (speed). Distance = Rate * Time You need to multiply by the number of seconds to get distance traveled at that rate.