Re: Torcs bug: old speed data used to derive tire forces

Bernhard Wymann <[email protected]> Sat, 15 Oct 2016 01:14:31 +0200
Newsgroups gmane.games.torcs.general
Organization wytec
Message-ID <[email protected]>
Hi David

This patch is wrong, the original is correct. The differential equations 
are calculated with an euler step, so:
1. Calculate Forces F(t)
2. Calculate accelerations : a(t) = f(F(t))
3. Calculate speed, v(t) = v(t-1) + a(t)*dt
4. Calculate positions, s(t) = s(t-1) + v(t)*dt

10 years ago or so we tried an alternative integration scheme for some 
forces (e.g. tires), but the calculation/complexity overhead was not 
worth the effect.

Kind regards

Bernhard

On 14.10.2016 01:45, David Savinkoff wrote:
> Tire forces are calculated in:
> torcs-1.3.7/src/modules/simu/simuv2/wheel.cpp :: SimWheelUpdateForce()
>
> Torcs now drives and slides with less swaying and spinning instabilities.
>
> See following in patch (torcs-1.3.7/src/modules/simu/simuv2/car.cpp):
>
> @@ -400,10 +384,10 @@
>  void
>  SimCarUpdate(tCar *car, tSituation * /* s */)
>  {
> -	SimCarUpdateForces(car);
> -	CHECK(car);
>  	SimCarUpdateSpeed(car);
>  	CHECK(car);
> +	SimCarUpdateForces(car);
> +	CHECK(car);
>  	SimCarUpdateCornerPos(car);
>  	CHECK(car);
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>
>
>
> _______________________________________________
> Torcs-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/torcs-users
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot