This is actually a good question to pass along to the FlightGear developers 
list, too.
I'll repost any good answers here to the JSBSim list.

> Andreas wrote:
>
> > I want to use JSBSim to simulate an airplane (no matter which airplane, so 
> > I use
> > the Cessna).
> ...
> > The problem now is that the simulation time is not the real time, e.g. 20
> > "simulation seconds" are executed in only 1 "real" second (clock time). But 
> > I
> > need the simulation time to be equal (or almost equal) to the real time. I
> > guess I can correct it by changing the value of 'dt' (e.g. 'dt=0.0001' 
> > instead
> > of the default 'dt=0.0083333'), but then the autopilot cannot hold the 
> > altitude
> > and always crashes :(
>
> ... interesting ...
>
> > Maybe someone can help me. It should not be that difficult, as FlightGear
> > already does it (with 't' or 'T' you can change the speed of the time).
>
> Yes, this would probably be a simple change. It would involve creating a 
> timing loop in
> JSBSim.cpp (for the standalone version), so that the FGFDMExec::Run() method 
> would be
> called at the same rate as the "dt" value - in this case, at 120 Hz (0.008333
> seconds per
> "frame").
>
> Now that you bring this up, it sounds like a good option to have for the 
> standalone
> version. That is, there could be an option:
>
> ./jsbsim --script=scripts/c1723.xml --realtime
>
> or, the script itself could specify "realtime" as an XML directive.
>
> I see a problem, though, because it is very OS-dependent. A Mac, a PC running 
> Linux,
> Cygwin, Windows, and IRIX, etc. all will do timing differently. Yet, as you 
> mention,
> FlightGear seems to do it OK.
>
> Any comments from anyone else?
>
> Jon


_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to