The TORCS Racing Board
Username: Password: Remember Me?
Lost Password Register
Author: wdbee | Created: 2017-06-20 19:08:52
Subject: WHEEL-2 - Issues
Hi All

To switch off the wdbee's debug output to the console just set
<attnum name="show index" min="0" max="1" val="0"/>

Here again TORCS crashes.

Wolf-Dieter

Edit: DanDroid and DummyDrivers:

ClothoidPath::CurveType ClothoidPath::getCurveType( double fromstart )
{
int index = getIndex(fromstart);
return mPath[index].curveType;
}

fromstart = 6205.46289 -> index = 2068 but size of mPath = 2068 (0..2067) -> Index out of range exception
Last Edited: 2017-06-20 21:05:37 by wdbee
    Author: timfoden | Created: 2017-06-21 09:27:17
    Subject: Re: WHEEL-2 - Issues
    Thanks for finding the problem. I fixed it and got my race to run all the way through by changing:

    int ClothoidPath::getIndex( double fromstart )
    {
    int i = (int)floor(fromstart / mTrack->segLen());
    return i;
    }

    to

    int ClothoidPath::getIndex( double fromstart )
    {
    const int NSEG = mTrack->getSize();
    int i = ((int)floor(fromstart / mTrack->segLen()) + NSEG) % NSEG;
    return i;
    }

    in both robots.

    Cheers, Tim.
    Last Edited: 2017-06-21 09:27:17 by timfoden
      Author: firechief | Created: 2017-06-21 10:03:20
      Subject: Re: WHEEL-2 - Issues
      Strange - I didn't get a crash. Just lucky I guess!
      Last Edited: 2017-06-21 10:04:16 by firechief
      Author: dummy | Created: 2017-06-21 16:51:56
      Subject: Re: WHEEL-2 - Issues
      Thanks Tim and Wolf-Dieter. I changed a lot and thought there could be some problem, but it didn't show up in my race. I hope you could enjoy the race anyway ;)

      Danny
      Last Edited: 2017-06-21 16:51:56 by dummy