Hi Thorsten,
I was looking into a crash earlier today, and I think I traced it down to
"dt" being zero.
My little nasal script I was playing around used the simple d = r*t formula
rearranged to read vel = dist / dt. I was using the result of this
computation to compute an autopilot target (target rate of climb in my
case.)
So what I think was happening is that the autopilot then tried to compute an
elevator position to achieve a nan rate of climb, which yielded a nan
elevator position. This nan elevator position was fed into the flight
dynamics model (yasim in this case) and everything blew up from that point
on.
It might be interesting to baracade the flight dynamics models a bit better
against nan input values, and then as you suggest, trap errors where they
occur so we can find them and fix them.
For what it's worth I just pushed a small fix to AIShip to handle a dt=0
situation more gracefully and cured one of the fpe's I was seeing.
Regards,
Curt.
On Mon, Dec 20, 2010 at 12:58 PM, ThorstenB wrote:
> On Mon, Dec 20, 2010 at 9:12 AM, Roland Haeder wrote:
> > I got another FPE with GIT version while in-flight with the A380 (recent
> > updates of fgdata). I flew with auto-pilot turned on from EDDL to EHAM
> > and suddenly the FPE happens:
>
> I had a look into some of these FPEs. However, there's tons of places
> where FG runs into such problems. May be caused by
> incorrect/incomplete FDM configurations (e.g. affects specific
> aircraft only), due to computation on unused/uninitialized data (e.g.
> since a feature is disabled but the associated computation is still
> executed), due to plain programming bugs - or even used deliberately
> ("...we don't need a division-by-zero check here since FPEs are
> disabled anyway..."). And it affects the FG core - but also aircraft
> specific Nasal scripts.
> So, unfortunately, divisons-by-zero, processing with "infinity" or
> "NaN" (not-a-number) values isn't really uncommon for FG. And since
> the FG default is to ignore any FPE (i.e. not to use the
> "--enable-fpe" option), few people care (I guess).
> Personally I don't like ignoring such exceptions, since it often hides
> real programming errors. So, yes, I think it'd be great if someone had
> a look into these issues, finds all the bad computations and fixes
> them. However, since everyone (?) else in FlightGear keeps FPEs
> disabled, it may turn out to be a Sisyphean task to rid _all_ such
> occurrences...
>
> cheers,
> Thorsten
>
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>
--
Curtis Olson:
http://www.atiak.com - http://aem.umn.edu/~uav/
http://www.flightgear.org -
http://www.flightgear.org/blogs/category/curt/<http://www.flightgear.org/blogs/category/personal/curt/>
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel