Earlier we had a report of a reset issue on the list. It appears that the
problem only affects a couple JSBSim aircraft...the c172 (all of them) and the
737. Everything else seems to trim fine.
The issue appears to be due to a difference between how the FDM is initialized
on startup and how it is initialized on restart. On startup the FDM
initialization is delayed until a tile is loaded for the startup location,
giving an accurate ground elevation value (test for gound_elev > -9990). This
test is not possible during the reinit phase, because we're only passing
through the reinitialize routine once.
The more I look at the workarounds we have been accumulating for making
flightgear initialize and reinitialize the more I realize that we may be
frequently taking the wrong approach to solving such issues. We are failing
to build self-sufficient and self-protecting subsystems.
Which is why I'm calling this a JSBSim bug. If the altitude is < -9990 and/or
the ground_elelvation is < -9990, would it be possible for JSBSim to not
ground trim and instead go for a coffee or freeze or whatever it needs to do
while the scenery system gets wound up?
In other words, rather than try and find another bandaid, what I would like
to do is remove the elevation test from following code in main.cxx and let the
fdm take care of itself:
if ( !cur_fdm_state->get_inited() &&
globals->get_scenery()->get_cur_elev() > -9990 )
{
SG_LOG(SG_FLIGHT,SG_INFO, "Finally initializing fdm");
cur_fdm_state->init();
if ( cur_fdm_state->get_bound() ) {
cur_fdm_state->unbind();
}
cur_fdm_state->bind();
}
Best,
Jim
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel