Giulio,
 
distance=sqrt { (y_final-y_initial)*(y_final-y_initial) + (i_final-i_initial)*(i_final-i_initial) }
 
the above formula tells you the actual distance that you're robot has covered from the starting/initial point
to the final/destination point.
 
if you also want the theta of orientation then
 
theta=atan { (y_final-y_initial) / (i_final-i_initial) }
 
go to cplusplus.com for details on atan and atan2 which is actually theta inverse.
 
Hope this helps!
 


 
On Tue, Apr 29, 2008 at 5:39 PM, Richard Vaughan <rtvaughan@gmail.com> wrote:
There isn't one. You'll need to do the geometry.

Richard/

On Wed, Apr 23, 2008 at 7:55 PM, Giulio Zecca <Giulio.Zecca@irisa.fr> wrote:
> Thanks for the answer, but that function only prints:
>  xpos   ypos    theta   speed   sidespeed       turn    stall
>
>  I need instead a function to show how many meters the robot covered up
>  to the time of the call, which, of course, is quite different from the
>  mere linear distance.
>  i.e. when the robot reaches its target, my code will print both the
>  shortest path and the real distance made by the robot.
>
>  So, is there a function to show the accumulated distance?
>  Or do I have to write one? (in that case, any hint will be appreciated)
>
>  Thanks
>
>
>  On Mon, 2008-04-14 at 22:53 +0500, Sohaib Rashid wrote:
>  > you can display the odometry at any time by the following commands
>  >
>  > robot.Read();
>  > std::cout<<pp<<std::endl;
>  >
>  > you can reset the odometry by the following commands
>  >
>  > robot.Read();
>  > pp.ResetOdometry(0,0,0);
>  >
>  >
>  > On Mon, Apr 14, 2008 at 10:17 PM, <gzecca@irisa.fr> wrote:
>  >         Hi, I am using Player 2.0.5 and I would like the robots to
>  >         print at
>  >         certain times of the execution the distance covered from the
>  >         start.
>  >         Is it possible with simulated drivers or odometry or
>  >         position2dProxy or
>  >         other?
>  >
>  >         If so, is there a command to reset this distance when needed,
>  >         during the
>  >         execution?
>  >
>  >         Thanks
>  >
>  >
>  >
>  >         -------------------------------------------------------------------------
>  >         This SF.net email is sponsored by the 2008 JavaOne(SM)
>  >         Conference
>  >         Don't miss this year's exciting event. There's still time to
>  >         save $100.
>  >         Use priority code J8TL2D2.
>  >         http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>  >         _______________________________________________
>  >         Playerstage-users mailing list
>  >         Playerstage-users@lists.sourceforge.net
>  >         https://lists.sourceforge.net/lists/listinfo/playerstage-users
>  >
>  >
>  >
>  > --
>  > Sohaib Rashid
>  > Voice +92-321-5876844
>  > -------------------------------------------------------------------------
>  > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>  > Don't miss this year's exciting event. There's still time to save $100.
>  > Use priority code J8TL2D2.
>  > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>  > _______________________________________________ Playerstage-users mailing list Playerstage-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-users
>
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>  Don't miss this year's exciting event. There's still time to save $100.
>  Use priority code J8TL2D2.
>  http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>  _______________________________________________
>  Playerstage-users mailing list
>  Playerstage-users@lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/playerstage-users
>

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users



--
Sohaib Rashid
Voice +92-321-5876844