ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to calculate the time when robot moved from one position to another or to a some distance?

asked 2013-05-14 23:01:45 -0500

Astronaut gravatar image

Hello

I would like to know the travel time for my robot when he move from one position to another. So for example I wont to know the time needed that my robot move 10 m forwards. So I have a map ov the environment and my platform has IMU, laser, Kinect and encoders. So I do not do any navigation just driving the platform for example 20 m forwards and wont to know the time needed to complete that task. Any help?

Thanks

edit retag flag offensive close merge delete

Comments

Are you driving yourself by hand? In that case, you'd anyways have inaccuracies in the measurements and you can just use a stopwatch instead of software.

dornhege gravatar image dornhege  ( 2013-05-15 04:04:16 -0500 )edit

I need a software ROS solution and not a stopwatch. So I need to know the time when platforms move from one position in the map to other.

Astronaut gravatar image Astronaut  ( 2013-05-15 05:01:37 -0500 )edit

Im not driving by my self. Im observing when someone else is driving it.

Astronaut gravatar image Astronaut  ( 2013-05-15 05:28:24 -0500 )edit

You can read out the encoders to measure the travelled distance and run a timer in parallel?

davinci gravatar image davinci  ( 2013-05-15 06:52:56 -0500 )edit

the encoders are drifted. So maybe better to use the pose, How to run a ROS timer??

Astronaut gravatar image Astronaut  ( 2013-05-15 11:57:11 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-05-15 22:30:39 -0500

Bill Smart gravatar image

You can just use the system clock, and subtract the start time from the end time. In python

import time

start = time.clock()
# Do something
end = time.clock()

print end-start, 'seconds'

and in C++, use gettimeofday() or some similar function.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-05-14 23:01:45 -0500

Seen: 604 times

Last updated: May 15 '13