Am 22.01.2011 22:36, schrieb Andreas Gaeb:
> [...]
> The second place where an FPE shows is kt_70.cxx:211 which seems to be
> the first place where the value of /position/altitude-ft is read after a
> reset.
ok, I found the cause for this one. FGPropagate's members
LocalTerrainRadius, SeaLevelRadius and VehicleRadius are not initialized
in the constructor but only later in InitModel(). FGInitialCondition
then calls SetAltitudeASL() in its constructor before
FGPropagate::InitModel has been called. The radiuses were frequently
NaN, so altitude was NaN, leading to the above FPE. Besides, pressure
at this altitude is also NaN and therefore the Mach calculation fails.
The attached patch initializes the radiuses to zero in the FGPropagate
constructor. I assume there was a reason not to call InitModel() in the
constructor, so I left it this way.
With both patches applied, I can't seem to produce any more NaNs by
resetting, though one never knows for sure...
Best regards,
Andreas
diff --git a/src/FDM/JSBSim/models/FGPropagate.cpp b/src/FDM/JSBSim/models/FGPropagate.cpp
index 5405c86..62ecfd1 100644
--- a/src/FDM/JSBSim/models/FGPropagate.cpp
+++ b/src/FDM/JSBSim/models/FGPropagate.cpp
@@ -78,7 +78,8 @@ static const char *IdHdr = ID_PROPAGATE;
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-FGPropagate::FGPropagate(FGFDMExec* fdmex) : FGModel(fdmex)
+FGPropagate::FGPropagate(FGFDMExec* fdmex) : FGModel(fdmex),
+LocalTerrainRadius(0), SeaLevelRadius(0), VehicleRadius(0)
{
Debug(0);
Name = "FGPropagate";
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel