Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: <gzecca@ir...> - 2008-04-14 17:17:37
|
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 |
From: Sohaib Rashid <sohaibr@gm...> - 2008-04-14 17:53:52
Attachments:
Message as HTML
|
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@...> 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@... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > -- Sohaib Rashid Voice +92-321-5876844 |
From: Giulio Zecca <Giulio.Zecca@ir...> - 2008-04-23 18:56:04
|
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@...> 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@... > 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@... https://lists.sourceforge.net/lists/listinfo/playerstage-users |
From: Richard Vaughan <rtvaughan@gm...> - 2008-04-29 12:39:44
|
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@...> 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@...> 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@... > > 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@... 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@... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > |
From: Sohaib Rashid <sohaibr@gm...> - 2008-04-29 13:22:00
Attachments:
Message as HTML
|
Giulio <Giulio.Zecca@...>, 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@...> 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@...> > 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@...> 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@... > > > > 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@... > 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@... > > 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@... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > -- Sohaib Rashid Voice +92-321-5876844 |
From: Kevin Barry <barryk@gm...> - 2008-04-23 19:26:40
Attachments:
Message as HTML
|
You will have to write one. Something like (this is untested) oldpx = 0; oldpy = 0; dist = 0; while(1) { player_client_read(client); /* Add distance traveled this cycle to total distance traveled */ dist += sqrt( pow(pos2d.px - oldpx, 2), pow(pos2d.py - oldpy, 2) ); /* Save current position for next cycle */ oldpx = pos2d.px; oldpy = pos2d.py; } On Wed, Apr 23, 2008 at 2:55 PM, Giulio Zecca <Giulio.Zecca@...> 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@...> 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@... > > 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@... > 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@... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > |
From: Giulio Zecca <Giulio.Zecca@ir...> - 2008-04-23 20:03:47
|
Yes, that's kinda what I was thinking about. The matter is: - isn't it getting too much computational power/time for the infinite loop? - I suppose that should run on a separate thread, ain't it? Thanks On Wed, 2008-04-23 at 15:26 -0400, Kevin Barry wrote: > You will have to write one. > > Something like (this is untested) > > oldpx = 0; > oldpy = 0; > dist = 0; > while(1) { > player_client_read(client); > /* Add distance traveled this cycle to total distance traveled */ > dist += sqrt( pow(pos2d.px - oldpx, 2), pow(pos2d.py - oldpy, 2) ); > > /* Save current position for next cycle */ > oldpx = pos2d.px; > oldpy = pos2d.py; > } > > > > > On Wed, Apr 23, 2008 at 2:55 PM, Giulio Zecca <Giulio.Zecca@...> > 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 |
From: Kevin Barry <barryk@gm...> - 2008-04-23 22:39:04
Attachments:
Message as HTML
|
it is an infinite loop, however computational time is pretty low. Most of the time is spent waiting for playerc_client_read(client); to have new data available. You could run it in a separate thread, but then you need some method of communicating between the two threads. Easier would be to put that code inside your main loop, and assuming your main loop completes often enough it would be fine. ie while(1) { playerc_client_read(client); /* distance code from above */ /* The code inside your main loop from your existing project */ } It could also be implemented as a driver, either that requires a position2d device and does similar to what i posted, or that exists as part of the existing driver and also supports a position1d device with distance. However modifying the driver might be more difficult than it is worth. On Wed, Apr 23, 2008 at 4:03 PM, Giulio Zecca <Giulio.Zecca@...> wrote: > Yes, that's kinda what I was thinking about. > The matter is: > - isn't it getting too much computational power/time for the infinite > loop? > - I suppose that should run on a separate thread, ain't it? > > Thanks > > > On Wed, 2008-04-23 at 15:26 -0400, Kevin Barry wrote: > > You will have to write one. > > > > Something like (this is untested) > > > > oldpx = 0; > > oldpy = 0; > > dist = 0; > > while(1) { > > player_client_read(client); > > /* Add distance traveled this cycle to total distance traveled */ > > dist += sqrt( pow(pos2d.px - oldpx, 2), pow(pos2d.py - oldpy, 2) ); > > > > /* Save current position for next cycle */ > > oldpx = pos2d.px; > > oldpy = pos2d.py; > > } > > > > > > > > > > On Wed, Apr 23, 2008 at 2:55 PM, Giulio Zecca <Giulio.Zecca@...> > > 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 > > > > > ------------------------------------------------------------------------- > 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@... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > |
From: Giulio Zecca <Giulio.Zecca@ir...> - 2008-04-23 22:47:07
|
I think that assumption is too strong, that's why I thought about another thread: in the main loop I need some usleep and blocking operations, that can interfere, and i just need to have the total distance at the end of the execution, so the comm is quite low. Anyway, before messing with redundant threads I'll try if adding that snippet in the main loop gives a fair enough result. Thanks! On Wed, 2008-04-23 at 18:38 -0400, Kevin Barry wrote: > it is an infinite loop, however computational time is pretty low. Most > of the time is spent waiting for playerc_client_read(client); to have > new data available. > > You could run it in a separate thread, but then you need some method > of communicating between the two threads. Easier would be to put that > code inside your main loop, and assuming your main loop completes > often enough it would be fine. > > ie > > while(1) { > playerc_client_read(client); > /* distance code from above */ > > /* The code inside your main loop from your existing project */ > } > > > It could also be implemented as a driver, either that requires a > position2d device and does similar to what i posted, or that exists as > part of the existing driver and also supports a position1d device with > distance. However modifying the driver might be more difficult than it > is worth. > > On Wed, Apr 23, 2008 at 4:03 PM, Giulio Zecca <Giulio.Zecca@...> > wrote: > Yes, that's kinda what I was thinking about. > The matter is: > - isn't it getting too much computational power/time for the > infinite > loop? > - I suppose that should run on a separate thread, ain't it? > > Thanks > > > > On Wed, 2008-04-23 at 15:26 -0400, Kevin Barry wrote: > > You will have to write one. > > > > Something like (this is untested) > > > > oldpx = 0; > > oldpy = 0; > > dist = 0; > > while(1) { > > player_client_read(client); > > /* Add distance traveled this cycle to total distance > traveled */ > > dist += sqrt( pow(pos2d.px - oldpx, 2), pow(pos2d.py - > oldpy, 2) ); > > > > /* Save current position for next cycle */ > > oldpx = pos2d.px; > > oldpy = pos2d.py; > > } > > > > > > > > > > On Wed, Apr 23, 2008 at 2:55 PM, Giulio Zecca > <Giulio.Zecca@...> > > 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 > > > > > > > ------------------------------------------------------------------------- > 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@... > 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@... https://lists.sourceforge.net/lists/listinfo/playerstage-users |
From: Edward Rankin <erankin@gm...> - 2008-04-29 13:46:28
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> That only gives you the linear distance from the starting point. <br> <br> Giulio is asking for accumulated distance which is has to be computed cumulatively. What you want to do is to pull the current x/y of the robot at regular intervals use the below formula to find the distance travelled since the last time you obtained the x/y and add it to the distance already computed in past intervals.<br> <br> Regards,<br> <br> Edward<br> <br> Sohaib Rashid wrote: <blockquote cite="mid:ed87bef50804290621g1e54bb9cvdac185f40a6b00d@..." type="cite"> <div><a moz-do-not-send="true" href="mailto:Giulio.Zecca@...">Giulio</a>,</div> <div> </div> <div>distance=sqrt { (y_final-y_initial)*(y_final-y_initial) + (i_final-i_initial)*(i_final-i_initial) }</div> <div> </div> <div>the above formula tells you the actual distance that you're robot has covered from the starting/initial point</div> <div>to the final/destination point.</div> <div> </div> <div>if you also want the theta of orientation then</div> <div> </div> <div>theta=atan { (y_final-y_initial) / (i_final-i_initial) }</div> <div> </div> <div>go to <a moz-do-not-send="true" href="http://cplusplus.com">cplusplus.com</a> for details on atan and atan2 which is actually theta inverse. </div> <div> </div> <div>Hope this helps!</div> <div> </div> <div><br> <br> </div> <div class="gmail_quote">On Tue, Apr 29, 2008 at 5:39 PM, Richard Vaughan <<a moz-do-not-send="true" href="mailto:rtvaughan@...">rtvaughan@...</a>> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">There isn't one. You'll need to do the geometry.<br> <br> Richard/<br> <br> On Wed, Apr 23, 2008 at 7:55 PM, Giulio Zecca <<a moz-do-not-send="true" href="mailto:Giulio.Zecca@...">Giulio.Zecca@...</a>> wrote:<br> > Thanks for the answer, but that function only prints:<br> > xpos ypos theta speed sidespeed turn stall<br> ><br> > I need instead a function to show how many meters the robot covered up<br> > to the time of the call, which, of course, is quite different from the<br> > mere linear distance.<br> > i.e. when the robot reaches its target, my code will print both the<br> > shortest path and the real distance made by the robot.<br> ><br> > So, is there a function to show the accumulated distance?<br> > Or do I have to write one? (in that case, any hint will be appreciated)<br> ><br> > Thanks<br> ><br> ><br> > On Mon, 2008-04-14 at 22:53 +0500, Sohaib Rashid wrote:<br> > > you can display the odometry at any time by the following commands<br> > ><br> > > robot.Read();<br> > > std::cout<<pp<<std::endl;<br> > ><br> > > you can reset the odometry by the following commands<br> > ><br> > > robot.Read();<br> > > pp.ResetOdometry(0,0,0);<br> > ><br> > ><br> > > On Mon, Apr 14, 2008 at 10:17 PM, <<a moz-do-not-send="true" href="mailto:gzecca@...">gzecca@...</a>> wrote:<br> > > Hi, I am using Player 2.0.5 and I would like the robots to<br> > > print at<br> > > certain times of the execution the distance covered from the<br> > > start.<br> > > Is it possible with simulated drivers or odometry or<br> > > position2dProxy or<br> > > other?<br> > ><br> > > If so, is there a command to reset this distance when needed,<br> > > during the<br> > > execution?<br> > ><br> > > Thanks<br> > ><br> > ><br> > ><br> > > -------------------------------------------------------------------------<br> > > This SF.net email is sponsored by the 2008 JavaOne(SM)<br> > > Conference<br> > > Don't miss this year's exciting event. There's still time to<br> > > save $100.<br> > > Use priority code J8TL2D2.<br> > > <a moz-do-not-send="true" href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone"; target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone</a><br> > > _______________________________________________<br> > > Playerstage-users mailing list<br> > > <a moz-do-not-send="true" href="mailto:Playerstage-users@...">Playerstage-users@...</a><br> > > <a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/playerstage-users"; target="_blank">https://lists.sourceforge.net/lists/listinfo/playerstage-users</a><br> > ><br> > ><br> > ><br> > > --<br> > > Sohaib Rashid<br> > > Voice +92-321-5876844<br> > > -------------------------------------------------------------------------<br> > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference<br> > > Don't miss this year's exciting event. There's still time to save $100.<br> > > Use priority code J8TL2D2.<br> > > <a moz-do-not-send="true" href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone"; target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone</a><br> > > _______________________________________________ Playerstage-users mailing list <a moz-do-not-send="true" href="mailto:Playerstage-users@...">Playerstage-users@...</a> <a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/playerstage-users"; target="_blank">https://lists.sourceforge.net/lists/listinfo/playerstage-users</a><br> ><br> ><br> > -------------------------------------------------------------------------<br> > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference<br> > Don't miss this year's exciting event. There's still time to save $100.<br> > Use priority code J8TL2D2.<br> > <a moz-do-not-send="true" href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone"; target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone</a><br> > _______________________________________________<br> > Playerstage-users mailing list<br> > <a moz-do-not-send="true" href="mailto:Playerstage-users@...">Playerstage-users@...</a><br> > <a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/playerstage-users"; target="_blank">https://lists.sourceforge.net/lists/listinfo/playerstage-users</a><br> ><br> <br> -------------------------------------------------------------------------<br> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference<br> Don't miss this year's exciting event. There's still time to save $100.<br> Use priority code J8TL2D2.<br> <a moz-do-not-send="true" href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone"; target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone</a><br> _______________________________________________<br> Playerstage-users mailing list<br> <a moz-do-not-send="true" href="mailto:Playerstage-users@...">Playerstage-users@...</a><br> <a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/playerstage-users"; target="_blank">https://lists.sourceforge.net/lists/listinfo/playerstage-users</a><br> </blockquote> </div> <br> <br clear="all"> <br> -- <br> Sohaib Rashid<br> Voice +92-321-5876844 <pre wrap=""> <hr size="4" width="90%"> ------------------------------------------------------------------------- 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. <a class="moz-txt-link-freetext" href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone">http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone</a></pre> <pre wrap=""> <hr size="4" width="90%"> _______________________________________________ Playerstage-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Playerstage-users@...">Playerstage-users@...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/playerstage-users">https://lists.sourceforge.net/lists/listinfo/playerstage-users</a> </pre> </blockquote> <br> </body> </html> |
From: Giulio Zecca <Giulio.Zecca@ir...> - 2008-04-29 20:23:04
|
Yes that was the idea. Anyway, it has already been answered by Kevin Barry on Wed, 23 Apr 2008 :D I finally put the function in the main loop, the result is not so accurate, due to sleeps and blocking functions, but it still does the trick for now. I will treat it in a different thread when I'll have some time to spend on it ;) Thanks On Tue, 2008-04-29 at 21:46 +0800, Edward Rankin wrote: > That only gives you the linear distance from the starting point. > > Giulio is asking for accumulated distance which is has to be computed > cumulatively. What you want to do is to pull the current x/y of the > robot at regular intervals use the below formula to find the distance > travelled since the last time you obtained the x/y and add it to the > distance already computed in past intervals. > > Regards, > > Edward > > Sohaib Rashid wrote: > > 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@...> 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@...> 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@...> > > 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@... > > > > > > 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@... > > 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@... > > > > > 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@... > > 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@... > > 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@... https://lists.sourceforge.net/lists/listinfo/playerstage-users |