diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index 998f23b30..590ea1362 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -59,7 +59,9 @@ FGJSBsim::FGJSBsim(void) { bool result; - + + runcount=0; + fdmex=new FGFDMExec; fgic=new FGInitialCondition(fdmex); needTrim=true; @@ -203,12 +205,6 @@ bool FGJSBsim::update( int multiloop ) { double save_alt = 0.0; - - // lets try to avoid really screwing up the JSBsim model - if ( get_Altitude() < -9000 ) { - save_alt = get_Altitude(); - set_Altitude( 0.0 ); - } copy_to_JSBsim(); @@ -228,8 +224,9 @@ bool FGJSBsim::update( int multiloop ) { } fgtrim->ReportState(); delete fgtrim; - - needTrim=false; + + + needTrim=false; controls.set_elevator_trim(fdmex->GetFCS()->GetPitchTrimCmd()); @@ -264,9 +261,7 @@ bool FGJSBsim::update( int multiloop ) { // but lets restore our original bogus altitude when we are done - if ( save_alt < -9000.0 ) { - set_Altitude( save_alt ); - } + //climb rate now set from FDM in copy_from_x() return true; diff --git a/src/FDM/JSBSim.hxx b/src/FDM/JSBSim.hxx index 90cd30a82..980ba9018 100644 --- a/src/FDM/JSBSim.hxx +++ b/src/FDM/JSBSim.hxx @@ -200,6 +200,7 @@ private: FGInitialCondition *fgic; bool needTrim; + int runcount; bool trimmed; float trim_elev; float trim_throttle; diff --git a/src/FDM/LaRCsim/Makefile.am b/src/FDM/LaRCsim/Makefile.am index d50daf402..6e53422f8 100644 --- a/src/FDM/LaRCsim/Makefile.am +++ b/src/FDM/LaRCsim/Makefile.am @@ -27,7 +27,7 @@ libLaRCsim_a_SOURCES = \ ls_model.c ls_model.h \ ls_sim_control.h \ ls_step.c ls_step.h \ - ls_sym.h ls_types.h \ + ls_sym.h ls_trim.c ls_types.h \ $(AIRCRAFT_MODEL) \ ls_interface.c ls_interface.h