]> git.mxchange.org Git - flightgear.git/commitdiff
20000803 updates.
authorcurt <curt>
Fri, 4 Aug 2000 03:20:09 +0000 (03:20 +0000)
committercurt <curt>
Fri, 4 Aug 2000 03:20:09 +0000 (03:20 +0000)
src/FDM/JSBSim.cxx
src/FDM/JSBSim/FGAuxiliary.cpp
src/FDM/JSBSim/FGAuxiliary.h
src/FDM/JSBSim/FGDefs.h
src/FDM/JSBSim/FGMatrix.cpp
src/FDM/JSBSim/FGTank.cpp
src/FDM/JSBSim/JSBSim.cpp
src/FDM/flight.hxx

index bca731b59ccc39b90f45866977ce3b170212e6ca..376afdfc28198a2653572fd0814cd0ba868cf731 100644 (file)
@@ -160,7 +160,8 @@ int FGJSBsim::init( double dt ) {
   FG_LOG( FG_FLIGHT, FG_INFO, "Finished initializing JSBSim" );
 
   copy_from_JSBsim();
-
+  
+  
   return 1;
 }
 
@@ -344,6 +345,12 @@ int FGJSBsim::copy_from_JSBsim() {
   set_Euler_Angles( FDMExec.GetRotation()->Getphi(),
                     FDMExec.GetRotation()->Gettht(),
                     FDMExec.GetRotation()->Getpsi() );
+                    
+  for(int i=0; i<3; i++ ) {
+    for (int j=0; j<3; j++ ) {
+      set_T_Local_to_Body(i,j,FDMExec.GetState()->GetTl2b()(i,j));
+    }
+  }     
 
   set_Alpha( FDMExec.GetTranslation()->Getalpha() );
   set_Beta( FDMExec.GetTranslation()->Getbeta() );
@@ -365,7 +372,7 @@ int FGJSBsim::copy_from_JSBsim() {
   set_Static_pressure( FDMExec.GetAtmosphere()->GetPressure() );
   set_Static_temperature ( FDMExec.GetAtmosphere()->GetTemperature() );
   
-  
+  set_Earth_position_angle( FDMExec.GetAuxiliary()->GetEarthPositionAngle() );
   
   /* **FIXME*** */ set_Sea_level_radius( sl_radius2 * METER_TO_FEET );
   /* **FIXME*** */ set_Earth_position_angle( 0.0 );
index 618fbc74dfec2ffb3294ef52e16ee554054a3522..71cf25b26463d51727b4ebe3821e4e15030c1a0c 100644 (file)
@@ -60,6 +60,7 @@ FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex) {
   Name = "FGAuxiliary";
   vcas = veas = mach = qbar = pt = 0;
   psl = rhosl = 1;
+  earthPosAngle = 0.0;
 }
 
 
@@ -93,8 +94,10 @@ bool FGAuxiliary::Run() {
     veas = sqrt(2*qbar/rhosl);
     
     vPilotAccel = Translation->GetUVWdot() + Aircraft->GetXYZep() * Rotation->GetPQRdot();
-
-
+    
+    
+    
+    earthPosAngle += State->Getdt()*OMEGA_EARTH;
 
   } else {
   }
index f3b6e87de9a7d03843d663dacfaa05a118d131ba..08fba1e3444724e5430f441a083aff07831c0447 100644 (file)
@@ -65,6 +65,8 @@ public:
   inline FGColumnVector GetPilotAccel(void) { return vPilotAccel; }
   inline FGColumnVector GetNpilot(void) { return vPilotAccel*INVGRAVITY; }
   
+  inline float GetEarthPositionAngle(void) { return earthPosAngle; }
+  
  
 protected:
 
@@ -83,6 +85,8 @@ private:
  
   
   FGColumnVector vPilotAccel;
+  
+  float earthPosAngle;
 
   void GetState(void);
 };
index 05b5cc79f777ea13e5309920fad32ecaec422201..8ebf61a7873a2d2466c1c85c439d1f2755e04a53 100644 (file)
@@ -54,6 +54,7 @@ SENTRY
 #define KTSTOFPS        1.68781
 #define FPSTOKTS        0.592484
 #define INCHTOFT        0.08333333
+#define OMEGA_EARTH .00007272205217  
 #define NEEDED_CFG_VERSION "1.30"
 
 #define HPTOFTLBSSEC 550
index 5b4f5da10ba5937b5f0495d92a53517c19144544..6e51fa17d633cb70852e6a56066f1fe3f0f9f2d6 100644 (file)
@@ -344,24 +344,22 @@ FGMatrix FGMatrix::operator/(const double scalar)
       }
     }
     
-  } else
-    cerr << "Attempt to divide by zero in method FGMatrix::operator/(const double scalar), object at " << this << endl; 
-  return Quot;  
+  }
+  return Quot;
 }
 
 /******************************************************************************/
 
 void FGMatrix::operator/=(const double scalar)
 {
-  
+
   if(scalar != 0) {
     for (unsigned int i=1; i<=Rows(); i++)  {
       for (unsigned int j=1; j<=Cols(); j++) {
         data[i][j]/=scalar;
       }
     }
-  } else 
-    cerr << "Attempt to divide by zero in method FGMatrix::operator/=(const double scalar), object " << this << endl; 
+  }
 }
 
 /******************************************************************************/
@@ -521,15 +519,9 @@ FGColumnVector FGColumnVector::operator/(const double scalar)
 {
   FGColumnVector Quotient(Rows());
   if(scalar != 0) {
-    
-
     for (unsigned int i=1; i<=Rows(); i++) Quotient(i) = data[i][1] / scalar;
-
-  } else 
-    cerr << "Attempt to divide by zero in method FGColumnVector::operator/(const double scalar), object " << this << endl; 
+  }
   return Quotient;
-  
-    
 }
 
 /******************************************************************************/
index 22a6113441481c2a57ffd6617f9f49fbd8eefc8d..12fdf2ae004a0423e6f4269539c33bed410699dc 100644 (file)
@@ -58,11 +58,12 @@ FGTank::FGTank(FGConfigFile* AC_cfg)
   *AC_cfg >> Capacity;                          // pounds (amount it can hold)
   *AC_cfg >> Contents;                          // pounds  (amount it is holding)
   Selected = true;
-  if(Capacity != 0)
+
+  if (Capacity != 0) {
     PctFull = 100.0*Contents/Capacity;            // percent full; 0 to 100.0
-  else {
-    Contents=0;
-    PctFull=0;
+  else {
+    Contents = 0;
+    PctFull  = 0;
   }     
 }
 
index aff77319c18fc4abfe2d2787f142ecac250c533e..7e2790d790a1fdba3afaa6fe36bf39fd574928ec 100644 (file)
@@ -120,7 +120,7 @@ int main(int argc, char** argv)
 
   float cmd = 0.0;
 
-  while (FDMExec->GetState()->Getsim_time() <= 145.0)
+  while (FDMExec->GetState()->Getsim_time() <= 10.0)
   {
     // Fake an elevator ramp here after 1 second, hold for one second, ramp down
     /*
index dad9bacd80eb30b2eb4205ef0727e7d6e0f133fd..ea54f977b66c66022eb39b43fd5b3c31f4d63f74 100644 (file)
@@ -637,6 +637,9 @@ public:
     inline double get_T_local_to_body_33() const {
        return t_local_to_body_m[2][2];
     }
+    inline void set_T_Local_to_Body( int i, int j, double value) {
+      t_local_to_body_m[i-1][j-1] = value;
+    }  
     inline void set_T_Local_to_Body( double m[3][3] ) {
        int i, j;
        for ( i = 0; i < 3; i++ ) {