]> git.mxchange.org Git - flightgear.git/commitdiff
Tweaks from Tony to JSBSim.cxx jsbsim interface to flightgear.
authorcurt <curt>
Tue, 9 Jan 2001 18:35:23 +0000 (18:35 +0000)
committercurt <curt>
Tue, 9 Jan 2001 18:35:23 +0000 (18:35 +0000)
Added ls_trim.c to the LaRCsim library.

src/FDM/JSBSim.cxx
src/FDM/JSBSim.hxx
src/FDM/LaRCsim/Makefile.am

index 998f23b30ffba6ab5df585a7be030f1a455af314..590ea136225138b0219b8cdaf6ec6309aa8f9dfa 100644 (file)
@@ -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;
index 90cd30a8294365123b05880e4b414d8a9e50f96b..980ba90187e68b9f2754429cbb7a09e0ddbcee93 100644 (file)
@@ -200,6 +200,7 @@ private:
     FGInitialCondition *fgic;
     bool needTrim;
 
+    int runcount;
     bool trimmed;
     float trim_elev;
     float trim_throttle;
index d50daf40204072408d87d5bfcecdf16307f9b655..6e53422f8c065a92f690cd33a606911ec321ae72 100644 (file)
@@ -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