From: Edward R. <er...@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:ed8...@ma..." type="cite"> <div><a moz-do-not-send="true" href="mailto:Giu...@ir...">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:rtv...@gm...">rtv...@gm...</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:Giu...@ir...">Giu...@ir...</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:gz...@ir...">gz...@ir...</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:Pla...@li...">Pla...@li...</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:Pla...@li...">Pla...@li...</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:Pla...@li...">Pla...@li...</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:Pla...@li...">Pla...@li...</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:Pla...@li...">Pla...@li...</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> |