Re: How to compute distance between multiple cars
Bernhard Wymann <[email protected]>
| Newsgroups | gmane.games.torcs.general |
|---|---|
| Organization | wytec |
| Message-ID | <[email protected]> |
Hi What input, what is the question? The "issue" is covered in the robot tutorial, as well the "wrap around" on the start lane. Best regards Bernhard On 10/25/2012 10:04 PM, ANAND MADHUSOODANAN wrote: > Hi Berhard, > For calculating the distance between two cars in the simulator, can we use a simple formula like (car->_trkPos.seg->lgfromstart - car2->_trkPos.seg->lgfromstart). I tried it in the simulator and i seem to be getting values which seem correct when comparing visually with the two cars in the race. Can you give me some inputs on this? > > > > Regards, > Anand. > > > On Oct 24, 2012, at 6:42 PM, Bernhard Wymann <[email protected]> wrote: > >> Hi Anand >> >> Nothing is wrong, the practice session menu just allows one driver, try Quickrace. >> >> Best regards >> >> Bernhard >> >> On 10/25/2012 12:36 AM, Anand Madhusoodanan wrote: >>> Hi Bernhard, >>> Thanks for the suggestion. I tried calling the update >>> method of the Opponent class from within my defined driver class(the one >>> similar to bt.cpp in your tutorial). It compiles without error, but i >>> now i get this strange problem that i cannot add more than 1 car in >>> practice mode. I can see all my defined robots, but i can add only one >>> of them. Any ideas what could be wrong? >>> >>> >>> >>> Regards, >>> Anand. >>> >>> >>> On Mon, Oct 22, 2012 at 3:47 AM, Bernhard Wymann <[email protected] >>> <mailto:[email protected]>> wrote: >>> >>> Hi Anand >>> >>> I guess this is described here: >>> >>> http://www.berniw.org/torcs/__robot/ch7/opponents.html >>> <http://www.berniw.org/torcs/robot/ch7/opponents.html> >>> >>> If you want any other measure of distance (e.g. euclidean) just >>> adopt the opponent class accordingly. The update happens happens in >>> the driver, just skim the whole tutorial, everything is there. >>> >>> Beware, the simulation timestep and the robot calls are not the >>> same, see here (but this is just terminology): >>> >>> torcs.sourceforge.net/index.__php?name=Sections&op=__viewarticle&artid=30#c6_6 >>> <http://torcs.sourceforge.net/index.php?name=Sections&op=viewarticle&artid=30#c6_6> >>> >>> Hope this helps, enjoy:-) >>> >>> Best regards >>> >>> Bernhard >>> >>> >>> >>> On 10/21/2012 09:13 PM, Anand Madhusoodanan wrote: >>> >>> Hi, >>> I have managed to add multiple cars in the TORCS simulator and >>> having them run in hard coded scenarios. How can I calculate the >>> distance between two cars for every simulation time step? Could >>> someone help me out? >>> >>> Regards, >>> Anand. >>> >>> >>> >>> >>> ------------------------------__------------------------------__------------------ >>> Everyone hates slow websites. So do we. >>> Make your web apps faster with AppDynamics >>> Download AppDynamics Lite for free today: >>> http://p.sf.net/sfu/appdyn___sfd2d_oct >>> <http://p.sf.net/sfu/appdyn_sfd2d_oct> >>> >>> >>> >>> _________________________________________________ >>> Torcs-users mailing list >>> [email protected].__net >>> <mailto:[email protected]> >>> https://lists.sourceforge.net/__lists/listinfo/torcs-users >>> <https://lists.sourceforge.net/lists/listinfo/torcs-users> >>> >>> >>> >> > > ------------------------------------------------------------------------------ WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/