Postpone running the simulation until after initialization and do an extra trim right after creation to properly initialize the output parameters.
This commit is contained in:
parent
db295a9afc
commit
94b12aa992
1 changed files with 7 additions and 0 deletions
|
@ -198,6 +198,7 @@ FGJSBsim::FGJSBsim( double dt )
|
|||
|
||||
PropertyManager = new FGPropertyManager( (FGPropertyNode*)globals->get_props() );
|
||||
fdmex = new FGFDMExec( PropertyManager );
|
||||
fdmex->Hold();
|
||||
|
||||
// Register ground callback.
|
||||
fdmex->SetGroundCallback( new FGFSGroundCallback(this) );
|
||||
|
@ -383,6 +384,11 @@ FGJSBsim::FGJSBsim( double dt )
|
|||
|
||||
mesh = new AircraftMesh(fgGetDouble("/fdm/jsbsim/metrics/bw-ft"),
|
||||
fgGetDouble("/fdm/jsbsim/metrics/cbarw-ft"));
|
||||
|
||||
// Trim once to initialize all output parameters
|
||||
FGTrim *fgtrim = new FGTrim(fdmex,tFull);
|
||||
fgtrim->DoTrim();
|
||||
delete fgtrim;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -427,6 +433,7 @@ void FGJSBsim::init()
|
|||
common_init();
|
||||
|
||||
copy_to_JSBsim();
|
||||
fdmex->Resume();
|
||||
fdmex->RunIC(); //loop JSBSim once w/o integrating
|
||||
if (fgGetBool("/sim/presets/running")) {
|
||||
Propulsion->InitRunning(-1);
|
||||
|
|
Loading…
Add table
Reference in a new issue