Well, my first guesses were wrong, but I have found what JSBSim does now:

The code in question is in FGJSBSim::do_trim():

  if ( fgGetBool("/sim/presets/onground") )
  {
    fgic->SetVcalibratedKtsIC(0.0);
    fgtrim = new FGTrim(fdmex,tGround);
  } else {
    fgtrim = new FGTrim(fdmex,tLongitudinal);
  }

At initialization time /sim/presets/onground is true, at reset time it is 
false.
It lookes like tGround triming also adjusts the height of the aircraft so that 
it does not get pushed into the air by the gear springs. Whereas 
tLongitudinal triming does not adjust the altitude.

Just taking tGround triming all the time fixes the reset issue. But this is 
obviously not the right fix here.

On Samstag, 3. April 2004 23:22, Jim Wilson wrote:
> There's a patch at the end of this that works around the issue by adding
> yet another setter for the preset altitude,  but I would much rather see
> something improved in the ground trimming that makes it a little less
> problematic.
>
> This has been an ongoing issue with the trimming code in JSBSim.  Is it
> possible to fix it?  I take it the ac is "bouncing" like a hard landing or
> something like that.
>
> Best,
>
> Jim
>
>
> cvs diff: Diffing src/GUI
> Index: src/GUI/gui_local.cxx
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/GUI/gui_local.cxx,v
> retrieving revision 1.11
> diff -u -r1.11 gui_local.cxx
> --- a/src/GUI/gui_local.cxx     31 Mar 2004 21:10:32 -0000      1.11
> +++ b/src/GUI/gui_local.cxx     3 Apr 2004 21:07:43 -0000
> @@ -45,7 +45,6 @@
>      build_rotmatrix(GuiQuat_mat, curGuiQuat);
>  }
>
> -
>  void reInit(puObject *cb)
>  {
>      // BusyCursor(0);
> @@ -70,6 +69,10 @@
>
>      globals->restoreInitialState();
>
> +    if ( fgGetBool("/sim/presets/onground") ) {
> +        fgSetDouble("/sim/presets/altitude-ft", -9999.0 );
> +    }
> +
>      // update our position based on current presets
>      fgInitPosition();

Looking at this patch and the fact that this also works, I would guess that 
normally /sim/presets/onground seems to be reset to false. Setting 
the /sim/presets/altitude-ft to -9999 seems to trigger the onground value 
later to be true again ...

    Greetings

      Mathias

-- 
Mathias FrÃhlich, email: [EMAIL PROTECTED]

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to