]> git.mxchange.org Git - flightgear.git/commitdiff
Updates from Jon's official CVS tree.
authorcurt <curt>
Thu, 6 Jul 2000 21:02:46 +0000 (21:02 +0000)
committercurt <curt>
Thu, 6 Jul 2000 21:02:46 +0000 (21:02 +0000)
23 files changed:
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGAircraft.h
src/FDM/JSBSim/FGCoefficient.cpp
src/FDM/JSBSim/FGConfigFile.h
src/FDM/JSBSim/FGControls.cpp
src/FDM/JSBSim/FGControls.h
src/FDM/JSBSim/FGEngine.cpp
src/FDM/JSBSim/FGEngine.h
src/FDM/JSBSim/FGFCS.cpp
src/FDM/JSBSim/FGInitialCondition.cpp
src/FDM/JSBSim/FGLGear.cpp
src/FDM/JSBSim/FGLGear.h
src/FDM/JSBSim/FGMatrix.cpp
src/FDM/JSBSim/FGMatrix.h
src/FDM/JSBSim/FGModel.h
src/FDM/JSBSim/FGPosition.cpp
src/FDM/JSBSim/FGRotation.cpp
src/FDM/JSBSim/FGRotation.h
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGState.h
src/FDM/JSBSim/FGTranslation.h
src/FDM/JSBSim/FGUtility.cpp
src/FDM/JSBSim/JSBSim.cpp

index 316356337b7228e305daa2ac94f3d251f28b8cc8..e16070305b73f17dc088ffe64f3d8f21c40fd837 100644 (file)
@@ -135,12 +135,13 @@ INCLUDES
 FGAircraft::FGAircraft(FGFDMExec* fdmex) : FGModel(fdmex),
     vMoments(3),
     vForces(3),
+    vFs(3),
     vXYZrp(3),
     vbaseXYZcg(3),
     vXYZcg(3),
     vXYZep(3),
-    vEuler(3),
-    vFs(3)
+    vEuler(3)
+    
 {
   Name = "FGAircraft";
 
@@ -214,7 +215,6 @@ bool FGAircraft::Run(void) {
     for (int i = 1; i <= 3; i++)  vForces(i) = vMoments(i) = 0.0;
 
     MassChange();
-
     FMProp();
     FMAero();
     FMGear();
@@ -234,7 +234,7 @@ void FGAircraft::MassChange() {
   static FGColumnVector vXYZtank(3);
   float Tw;
   float IXXt, IYYt, IZZt, IXZt;
-  int t;
+  unsigned int t;
   unsigned int axis_ctr;
 
   for (axis_ctr=1; axis_ctr<=3; axis_ctr++) vXYZtank(axis_ctr) = 0.0;
@@ -250,7 +250,7 @@ void FGAircraft::MassChange() {
 
   float Oshortage, Fshortage;
 
-  for (int e=0; e<numEngines; e++) {
+  for (unsigned int e=0; e<numEngines; e++) {
     Fshortage = Oshortage = 0.0;
     for (t=0; t<numTanks; t++) {
       switch(Engine[e]->GetType()) {
@@ -326,6 +326,7 @@ void FGAircraft::MassChange() {
 
 void FGAircraft::FMAero(void) {
   static FGColumnVector vDXYZcg(3);
+  static FGColumnVector vAeroBodyForces(3);
   unsigned int axis_ctr,ctr;
 
   for (axis_ctr=1; axis_ctr<=3; axis_ctr++) vFs(axis_ctr) = 0.0;
@@ -336,8 +337,8 @@ void FGAircraft::FMAero(void) {
     }
   }
 
-  vForces += State->GetTs2b(alpha, beta)*vFs;
-
+  vAeroBodyForces = State->GetTs2b(alpha, beta)*vFs;
+  vForces += vAeroBodyForces;
   // The d*cg distances below, given in inches, are the distances FROM the c.g.
   // TO the reference point. Since the c.g. and ref point are given in inches in
   // the structural system (X positive rearwards) and the body coordinate system
@@ -348,10 +349,10 @@ void FGAircraft::FMAero(void) {
   vDXYZcg(eY) =  (vXYZrp(eY) - vXYZcg(eY))/12.0;
   vDXYZcg(eZ) = -(vXYZrp(eZ) - vXYZcg(eZ))/12.0;
 
-  vMoments(eL) += vForces(eZ)*vDXYZcg(eY) - vForces(eY)*vDXYZcg(eZ); // rolling moment
-  vMoments(eM) += vForces(eX)*vDXYZcg(eZ) - vForces(eZ)*vDXYZcg(eX); // pitching moment
-  vMoments(eN) += vForces(eY)*vDXYZcg(eX) - vForces(eX)*vDXYZcg(eY); // yawing moment
-
+  vMoments(eL) += vAeroBodyForces(eZ)*vDXYZcg(eY) - vAeroBodyForces(eY)*vDXYZcg(eZ); // rolling moment
+  vMoments(eM) += vAeroBodyForces(eX)*vDXYZcg(eZ) - vAeroBodyForces(eZ)*vDXYZcg(eX); // pitching moment
+  vMoments(eN) += vAeroBodyForces(eY)*vDXYZcg(eX) - vAeroBodyForces(eX)*vDXYZcg(eY); // yawing moment
+  
   for (axis_ctr = 0; axis_ctr < 3; axis_ctr++) {
     for (ctr = 0; ctr < Coeff[axis_ctr+3].size(); ctr++) {
       vMoments(axis_ctr+1) += Coeff[axis_ctr+3][ctr].TotalValue();
@@ -384,9 +385,13 @@ void FGAircraft::FMMass(void) {
 /******************************************************************************/
 
 void FGAircraft::FMProp(void) {
-  for (int i=0;i<numEngines;i++) {
+  for (unsigned int i=0;i<numEngines;i++) {
+
+    // Changes required here for new engine placement parameters (i.e. location and direction)
+
     vForces(eX) += Engine[i]->CalcThrust();
   }
+  
 }
 
 /******************************************************************************/
@@ -409,18 +414,54 @@ void FGAircraft::ReadMetrics(FGConfigFile* AC_cfg) {
 
   while ((token = AC_cfg->GetValue()) != "/METRICS") {
     *AC_cfg >> parameter;
-    if (parameter == "AC_WINGAREA") *AC_cfg >> WingArea;
-    else if (parameter == "AC_WINGSPAN") *AC_cfg >> WingSpan;
-    else if (parameter == "AC_CHORD") *AC_cfg >> cbar;
-    else if (parameter == "AC_IXX") *AC_cfg >> baseIxx;
-    else if (parameter == "AC_IYY") *AC_cfg >> baseIyy;
-    else if (parameter == "AC_IZZ") *AC_cfg >> baseIzz;
-    else if (parameter == "AC_IXZ") *AC_cfg >> baseIxz;
-    else if (parameter == "AC_EMPTYWT") *AC_cfg >> EmptyWeight;
-    else if (parameter == "AC_CGLOC") *AC_cfg >> vbaseXYZcg(eX) >> vbaseXYZcg(eY) >> vbaseXYZcg(eZ);
-    else if (parameter == "AC_EYEPTLOC") *AC_cfg >> vXYZep(eX) >> vXYZep(eY) >> vXYZep(eZ);
-    else if (parameter == "AC_AERORP") *AC_cfg >> vXYZrp(eX) >> vXYZrp(eY) >> vXYZrp(eZ);
-    else if (parameter == "AC_ALPHALIMITS") *AC_cfg >> alphaclmin >> alphaclmax;
+    if (parameter == "AC_WINGAREA") {
+        *AC_cfg >> WingArea;
+        cout << "    WingArea: " << WingArea  << endl; 
+    } else if (parameter == "AC_WINGSPAN") {
+        *AC_cfg >> WingSpan;
+        cout << "    WingSpan: " << WingSpan  << endl;
+    } else if (parameter == "AC_CHORD") {
+        *AC_cfg >> cbar;
+        cout << "    Chord: " << cbar << endl;
+    } else if (parameter == "AC_IXX") {
+        *AC_cfg >> baseIxx;
+        cout << "    baseIxx: " << baseIxx << endl;
+    } else if (parameter == "AC_IYY") {
+        *AC_cfg >> baseIyy;
+        cout << "    baseIyy: " << baseIyy << endl;
+    } else if (parameter == "AC_IZZ") { 
+        *AC_cfg >> baseIzz;
+        cout << "    baseIzz: " << baseIzz << endl;
+    } else if (parameter == "AC_IXZ") { 
+        *AC_cfg >> baseIxz;
+        cout << "    baseIxz: " << baseIxz  << endl;
+    } else if (parameter == "AC_EMPTYWT") {
+        *AC_cfg >> EmptyWeight;
+        cout << "    EmptyWeight: " << EmptyWeight  << endl;
+    } else if (parameter == "AC_CGLOC") {
+        *AC_cfg >> vbaseXYZcg(eX) >> vbaseXYZcg(eY) >> vbaseXYZcg(eZ);
+        cout << "    Xcg: " << vbaseXYZcg(eX) 
+             << " Ycg: " << vbaseXYZcg(eY)
+             << " Zcg: " << vbaseXYZcg(eZ)
+             << endl;
+    } else if (parameter == "AC_EYEPTLOC") {
+        *AC_cfg >> vXYZep(eX) >> vXYZep(eY) >> vXYZep(eZ);
+        cout << "    Xep: " << vXYZep(eX) 
+             << " Yep: " << vXYZep(eY)
+             << " Zep: " << vXYZep(eZ)
+             << endl;
+    } else if (parameter == "AC_AERORP") {
+        *AC_cfg >> vXYZrp(eX) >> vXYZrp(eY) >> vXYZrp(eZ);
+        cout << "    Xrp: " << vXYZrp(eX) 
+             << " Yrp: " << vXYZrp(eY)
+             << " Zrp: " << vXYZrp(eZ)
+             << endl;
+    } else if (parameter == "AC_ALPHALIMITS") {
+        *AC_cfg >> alphaclmin >> alphaclmax;
+        cout << "    Maximum Alpha: " << alphaclmax
+             << " Minimum Alpha: " << alphaclmin 
+             << endl;
+    }         
   }
 }
 
index db7ca5e5e0aa7c928e090a80f81c186247f9ff72..e71e47850cfdf53234ee4db3cf75c2c6bf2ee628 100644 (file)
@@ -155,8 +155,9 @@ public:
   inline float GetIyy(void) { return Iyy; }
   inline float GetIzz(void) { return Izz; }
   inline float GetIxz(void) { return Ixz; }
-  inline int   GetNumEngines(void) { return numEngines; }
+  inline unsigned int GetNumEngines(void) { return numEngines; }
   inline FGColumnVector GetXYZcg(void) { return vXYZcg; }
+  inline FGColumnVector GetXYZrp(void) { return vXYZrp; }
   inline float GetNlf(void) { return nlf; }
   inline float GetAlphaCLMax(void) { return alphaclmax; }
   inline float GetAlphaCLMin(void) { return alphaclmin; }
@@ -199,7 +200,6 @@ private:
   FGColumnVector vEuler;
   float baseIxx, baseIyy, baseIzz, baseIxz, EmptyMass, Mass;
   float Ixx, Iyy, Izz, Ixz;
-  float rho, qbar, Vt;
   float alpha, beta;
   float WingArea, WingSpan, cbar;
   float Weight, EmptyWeight;
index 0251aa44cfe4dff55d86e560146443b0a89dc5bb..849611ea0d27e43a254cec34403a7a57aa2c4df4 100644 (file)
@@ -102,7 +102,7 @@ FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg)
     if (type == TABLE) {
       *AC_cfg >> multparms;
       if (multparms.substr(0,1) == "F") {
-        LookupR = State->GetParameterIndex(multparms);
+        LookupC = State->GetParameterIndex(multparms);
         cout << "   Column indexing parameter: " << multparms << endl;
       } else {
         LookupC = atoi(multparms.c_str());
@@ -120,7 +120,7 @@ FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg)
     n     = multparms.find("|");
     start = mult_count = multipliers = 0;
 
-    while(n < end && n >= 0) {
+    while (n < end && n >= 0) {
       n -= start;
       mult_idx[mult_count] = State->GetParameterIndex(multparms.substr(start,n));
       multipliers += mult_idx[mult_count];
index e5d1ab32fb5473505f43d90a9e38d349b0eb66a5..72da4bf0509c52e00c2102103c8bd7a5a1021f21 100644 (file)
@@ -55,10 +55,8 @@ INCLUDES
 DEFINES
 *******************************************************************************/
 
-#ifndef FGFS
 using std::string;
 using std::ifstream;
-#endif
 
 /*******************************************************************************
 CLASS DECLARATION
index 277db5c528cd0bd3b660f74e0944041da87ac06b..d9031d6a40397d5f0f899637c887fee583e8d15e 100644 (file)
@@ -51,9 +51,8 @@ FGControls::~FGControls() {
 
 
 // $Log$
-// Revision 1.12  2000/05/30 14:48:53  curt
-// 05/30/2000 updates from Jon Berdnt.  Landing gear code now is beginning to
-// work.
+// Revision 1.13  2000/07/06 19:02:46  curt
+// Updates from Jon's official CVS tree.
 //
 // Revision 1.3  2000/04/26 10:55:57  jsb
 // Made changes as required by Curt to install JSBSim into FGFS
index a85c4ccb73dcd18044f3748b88d5f5210e56fc88..3c61c9e6981b6c18cf39b2a19d2661829c9a6c56 100644 (file)
@@ -36,11 +36,13 @@ class FGControls {
 
 public:
 
-    static const int ALL_ENGINES = -1;
-    static const int MAX_ENGINES = 10;
+    enum {
+      ALL_ENGINES = -1,
+      MAX_ENGINES = 10,
 
-    static const int ALL_WHEELS = -1;
-    static const int MAX_WHEELS = 3;
+      ALL_WHEELS = -1,
+      MAX_WHEELS = 3
+    };
 
 private:
 
@@ -175,9 +177,11 @@ extern FGControls controls;
 
 
 // $Log$
-// Revision 1.11  2000/05/30 14:48:53  curt
-// 05/30/2000 updates from Jon Berdnt.  Landing gear code now is beginning to
-// work.
+// Revision 1.12  2000/07/06 19:02:46  curt
+// Updates from Jon's official CVS tree.
+//
+// Revision 1.6  2000/06/03 13:59:52  jsb
+// Changes for compatibility with MSVC
 //
 // Revision 1.5  2000/05/12 22:45:35  jsb
 // Removed extraneous namespace identifiers and header files
index d22a36cc58f89b26cd9bc62a1dc7978650c952f4..664b6b23d25c91f6cf98efebcb1f7457659f9049 100644 (file)
@@ -104,6 +104,8 @@ FGEngine::FGEngine(FGFDMExec* fdex, string enginePath, string engineName, int nu
       enginefile >> X;
       enginefile >> Y;
       enginefile >> Z;
+      enginefile >> EnginePitch;
+      enginefile >> EngineYaw;
       enginefile >> BrakeHorsePower;
       enginefile >> MaxThrottle;
       enginefile >> MinThrottle;
@@ -117,6 +119,8 @@ FGEngine::FGEngine(FGFDMExec* fdex, string enginePath, string engineName, int nu
       enginefile >> X;
       enginefile >> Y;
       enginefile >> Z;
+      enginefile >> EnginePitch;
+      enginefile >> EngineYaw;
       enginefile >> SLThrustMax;
       enginefile >> VacThrustMax;
       enginefile >> MaxThrottle;
index f346cef7b86992c98ddb61ef9f9330e3071fb724..da8879f98a3e5129ca6aba3970afa6696635ffd3 100644 (file)
@@ -104,6 +104,8 @@ private:
   string Name;
   EngineType Type;
   float X, Y, Z;
+  float EnginePitch;
+  float EngineYaw;
   float SLThrustMax;
   float VacThrustMax;
   float SLFuelFlowMax;
index c98bf9fe1aa56161dbaab0aa1ec7e8d78987e6c5..b162ad9f48c30621310c26230e4d56c7ee35420e 100644 (file)
@@ -94,7 +94,7 @@ bool FGFCS::Run(void) {
 
 void FGFCS::SetThrottleCmd(int engineNum, float setting) {
   if (engineNum < 0) {
-    for (int ctr=0;ctr<Aircraft->GetNumEngines();ctr++) ThrottleCmd[ctr] = setting;
+    for (unsigned int ctr=0;ctr<Aircraft->GetNumEngines();ctr++) ThrottleCmd[ctr] = setting;
   } else {
     ThrottleCmd[engineNum] = setting;
   }
@@ -104,7 +104,7 @@ void FGFCS::SetThrottleCmd(int engineNum, float setting) {
 
 void FGFCS::SetThrottlePos(int engineNum, float setting) {
   if (engineNum < 0) {
-    for (int ctr=0;ctr<=Aircraft->GetNumEngines();ctr++) ThrottlePos[ctr] = ThrottleCmd[ctr];
+    for (unsigned int ctr=0;ctr<=Aircraft->GetNumEngines();ctr++) ThrottlePos[ctr] = ThrottleCmd[ctr];
   } else {
     ThrottlePos[engineNum] = setting;
   }
@@ -164,5 +164,3 @@ string FGFCS::GetComponentName(int idx) {
   return Components[idx]->GetName();
 }
 
-#pragma warn .8030
-
index 06a499c61bbb614e6d6e15477bb41184d2b8cb20..056689e66148177c0e69da7a50ddaff635e76836 100644 (file)
@@ -82,7 +82,6 @@ FGInitialCondition::FGInitialCondition(FGFDMExec *FDMExec) {
 
 
 FGInitialCondition::~FGInitialCondition(void) {}
-;
 
 
 void FGInitialCondition::SetVcalibratedKtsIC(float tt) {
index ca7235ca798adcf1866f09b79a070ecc1edb57b9..f55895f40ad008b6064fe5c05fbb5a4990bf2206 100644 (file)
@@ -57,6 +57,10 @@ FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : vXYZ(3),
   Rotation    = Exec->GetRotation();
 
   WOW = false;
+  FirstContact = false;
+  Reported = false;
+  DistanceTraveled = 0.0;
+  MaximumStrutForce = MaximumStrutTravel = 0.0;
 }
 
 
@@ -87,11 +91,17 @@ FGColumnVector FGLGear::Force(void)
   if (compressLength > 0.00) {
 
     WOW = true;
-
     vWhlVelVec      =  State->GetTb2l() * (Rotation->GetPQR() * vWhlBodyVec);
     vWhlVelVec     +=  Position->GetVel();
+
     compressSpeed   =  vWhlVelVec(eZ);
 
+    if (!FirstContact) {
+      FirstContact  = true;
+      SinkRate      =  compressSpeed;
+      GroundSpeed   =  Position->GetVel().Magnitude();
+    }
+
     vWhlVelVec      = -1.0 * vWhlVelVec.Normalize();
     vWhlVelVec(eZ)  =  0.00;
 
@@ -99,19 +109,53 @@ FGColumnVector FGLGear::Force(void)
     vLocalForce(eX) =  fabs(vLocalForce(eZ) * statFCoeff) * vWhlVelVec(eX);
     vLocalForce(eY) =  fabs(vLocalForce(eZ) * statFCoeff) * vWhlVelVec(eY);
 
+    MaximumStrutForce = max(MaximumStrutForce, fabs(vLocalForce(eZ)));
+    MaximumStrutTravel = max(MaximumStrutTravel, fabs(compressLength));
+
     vForce  = State->GetTl2b() * vLocalForce ;
     vMoment = vWhlBodyVec * vForce;
 
   } else {
 
     WOW = false;
+
+    if (Position->GetDistanceAGL() > 200.0) {
+      FirstContact = false;
+      Reported = false;
+      DistanceTraveled = 0.0;
+      MaximumStrutForce = MaximumStrutTravel = 0.0;
+    }
+
     vForce.InitMatrix();
     vMoment.InitMatrix();
   }
 
+  if (FirstContact) {
+    DistanceTraveled += Position->GetVel().Magnitude()*State->Getdt()*Aircraft->GetRate();
+  }
+
+  if (Position->GetVel().Magnitude() <= 0.05 && !Reported) {
+    Report();
+  }
 
   return vForce;
 }
 
 /******************************************************************************/
 
+void FGLGear::Report(void)
+{
+  cout << endl << "Touchdown report for " << name << endl;
+  cout << "  Sink rate at contact:  " << SinkRate                << " fps,    "
+                              << SinkRate*0.3408          << " mps"     << endl;
+  cout << "  Contact ground speed:  " << GroundSpeed*.5925       << " knots,  "
+                              << GroundSpeed*0.3408       << " mps"     << endl;
+  cout << "  Maximum contact force: " << MaximumStrutForce       << " lbs,    "
+                              << MaximumStrutForce*4.448  << " Newtons" << endl;
+  cout << "  Maximum strut travel:  " << MaximumStrutTravel*12.0 << " inches, "
+                              << MaximumStrutTravel*30.48 << " cm"      << endl;
+  cout << "  Distance traveled:     " << DistanceTraveled        << " ft,     "
+                              << DistanceTraveled*0.3408  << " meters"  << endl;
+  Reported = true;
+}
+
index 9b7fac0564f0934bf0e472653b5c6ff27d4a03bd..037e0f8248f5e22d4fbd6b781a14261909b218da 100644 (file)
@@ -99,7 +99,14 @@ private:
   float statFCoeff, rollFCoeff, skidFCoeff;
   float frictionForce, compForce;
   float brakePct, brakeForce, brakeCoeff;
+  double SinkRate;
+  double GroundSpeed;
+  double DistanceTraveled;
+  double MaximumStrutForce;
+  double MaximumStrutTravel;
   bool WOW;
+  bool FirstContact;
+  bool Reported;
   string name;
 
   FGFDMExec*     Exec;
@@ -107,6 +114,8 @@ private:
   FGAircraft*    Aircraft;
   FGPosition*    Position;
   FGRotation*    Rotation;
+
+  void Report(void);
 };
 
 #include "FGAircraft.h"
index c7f40c4b7f659163d3618bdf2b7d80f7e7d2e822..43caaf056ce8345bb5783d4e2410931addf7bb32 100644 (file)
@@ -582,3 +582,21 @@ FGColumnVector FGColumnVector::operator*(const FGColumnVector& V)
 
 /******************************************************************************/
 
+FGColumnVector FGColumnVector::multElementWise(const FGColumnVector& V)
+{
+  if (Rows() != 3 || V.Rows() != 3) {
+    MatrixException mE;
+    mE.Message = "Invalid row count in vector cross product function";
+    throw mE;
+  }
+
+  FGColumnVector Product(3);
+
+  Product(1) = data[1][1] * V(1);
+  Product(2) = data[2][1] * V(2);
+  Product(3) = data[3][1] * V(3);
+
+  return Product;
+}
+
+/******************************************************************************/
index 87af0a2c0e23f9611f952af073c08c677d820a4f..0a724f6848dd5cbfd6c855dbb931dca68fa76823 100644 (file)
@@ -25,11 +25,14 @@ INCLUDES
 #  include <simgear/compiler.h>
 #  ifdef FG_HAVE_STD_INCLUDES
 #    include <fstream>
+#    include <cmath>
 #  else
 #    include <fstream.h>
+#    include <math.h>
 #  endif
 #else
 #  include <fstream>
+#  include <cmath>
 #endif
 
 #include <string>
@@ -132,6 +135,8 @@ public:
   friend FGColumnVector operator*(const FGMatrix& M, const FGColumnVector& V);
 
   double& operator()(int m) const;
+  
+  FGColumnVector multElementWise(const FGColumnVector& V);
 };
 
 /******************************************************************************/
index 638782c981a815477798a2bef4c82fabc67791ad..c42f9075344e86cdc16df8a4182117e638526e3c 100644 (file)
@@ -84,7 +84,8 @@ public:
   string Name;
   virtual bool Run(void);
   virtual bool InitModel(void);
-  virtual void SetRate(int tt) {rate = tt;};
+  virtual void SetRate(int tt) {rate = tt;}
+  virtual int  GetRate(void)   {return rate;}
 
 protected:
   enum {eU=1, eV, eW};
index d6538a09611cd44ca4bece34cd18522a7557ae49..b3556ac32d6676fcccc2d833485eacdffbf48716 100644 (file)
@@ -94,7 +94,8 @@ FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex),
   LongitudeDot = LatitudeDot = RadiusDot = 0.0;
   lastLongitudeDot = lastLatitudeDot = lastRadiusDot = 0.0;
   Longitude = Latitude = 0.0;
-  h = gamma = Vt = 0.0;
+  gamma = Vt = 0.0;
+  h = 3.0;                                 // Est. height of aircraft cg off runway
   SeaLevelRadius = EARTHRAD;               // For initialization ONLY
   Radius         = SeaLevelRadius + h;
   RunwayRadius   = SeaLevelRadius;
index 8a80034a211abbbe69e39ad8b3f09303af584252..6041ef4ec451926fb83ca415d5ce68a4a93cbb8b 100644 (file)
@@ -66,12 +66,6 @@ INCLUDES
 #include "FGAuxiliary.h"
 #include "FGOutput.h"
 
-#ifndef M_PI
-/* get a definition for pi */
-#include <Include/fg_constants.h>
-#define M_PI FG_PI
-#endif
-
 /*******************************************************************************
 ************************************ CODE **************************************
 *******************************************************************************/
index ce568e308a8ac78f1599868d5a60c4c949db5f24..d2fb58b6f31782373c9110fd730db86df8d37008 100644 (file)
@@ -67,6 +67,11 @@ INCLUDES
 #  include <cmath>
 #endif
 
+#ifndef M_PI
+#  include <simgear/constants.h>
+#  define M_PI FG_PI
+#endif
+
 #include "FGModel.h"
 #include "FGMatrix.h"
 
@@ -74,8 +79,6 @@ INCLUDES
 CLASS DECLARATION
 *******************************************************************************/
 
-#pragma warn -8026
-
 class FGRotation : public FGModel
 {
   FGColumnVector vPQR;
@@ -103,7 +106,6 @@ public:
   inline float Gettht(void) {return vEuler(2);}
   inline float Getpsi(void) {return vEuler(3);}
 };
-#pragma warn .8026
 
 /******************************************************************************/
 #endif
index 15583cb2c724b90d927ef195710291b0f26a5014..285d844c09ecd9eb3145ad69a6378f354f11f466 100644 (file)
@@ -47,6 +47,11 @@ INCLUDES
 #  include <cmath>
 #endif
 
+#ifndef M_PI         // support for silly Microsoft compiler
+#  include <simgear/constants.h>
+#  define M_PI FG_PI
+#endif 
+
 #include "FGState.h"
 #include "FGFDMExec.h"
 #include "FGAtmosphere.h"
@@ -456,13 +461,12 @@ void FGState::IntegrateQuat(FGColumnVector vPQR, int rate) {
 FGColumnVector FGState::CalcEuler(void) {
   static FGColumnVector vEuler(3);
 
-  if (mTl2b(3,3) == 0)    vEuler(ePhi) = 0.0;
-  else                    vEuler(ePhi) = atan2(mTl2b(2,3), mTl2b(3,3));
+  if (mTl2b(3,3) == 0.0) mTl2b(3,3) = 0.0000001;
+  if (mTl2b(1,1) == 0.0) mTl2b(1,1) = 0.0000001;
 
+  vEuler(ePhi) = atan2(mTl2b(2,3), mTl2b(3,3));
   vEuler(eTht) = asin(-mTl2b(1,3));
-
-  if (mTl2b(1,1) == 0.0)  vEuler(ePsi) = 0.0;
-  else                    vEuler(ePsi) = atan2(mTl2b(1,2), mTl2b(1,1));
+  vEuler(ePsi) = atan2(mTl2b(1,2), mTl2b(1,1));
 
   if (vEuler(ePsi) < 0.0) vEuler(ePsi) += 2*M_PI;
 
index 6d4aa4a7ac35a7410e24ae8bedc78447438653ce..9aa3ca87e0e6071be5bb0523b7abb70c73653991 100644 (file)
@@ -84,7 +84,6 @@ public:
   inline float Getadot(void) { return adot; }
   inline float Getbdot(void) { return bdot; }
 
-  inline float GetLocalAltitudeOverRunway(void) { return LocalAltitudeOverRunway; }
   inline float Geta(void) { return a; }
 
   inline float Getsim_time(void) { return sim_time; }
@@ -97,7 +96,6 @@ public:
   inline void Setadot(float tt) { adot = tt; }
   inline void Setbdot(float tt) { bdot = tt; }
 
-  inline void SetLocalAltitudeOverRunway(float tt) { LocalAltitudeOverRunway = tt; }
   inline void Seta(float tt) { a = tt; }
 
   inline float Setsim_time(float tt) {
@@ -127,7 +125,6 @@ private:
   float sim_time, dt;
 
   FGFDMExec* FDMExec;
-  float LocalAltitudeOverRunway;
   FGMatrix mTb2l;
   FGMatrix mTl2b;
   FGMatrix mTs2b;
index abb78d70f0c7effa2805fc0dbcc9731eddbf86fe..5f9578e40e48ffe63566bbd6eddf905ab07a50a0 100644 (file)
@@ -74,8 +74,6 @@ INCLUDES
 CLASS DECLARATION
 *******************************************************************************/
 
-#pragma warn -8026
-
 class FGTranslation : public FGModel {
 public:
   FGTranslation(FGFDMExec*);
@@ -120,7 +118,6 @@ private:
 
   void GetState(void);
 };
-#pragma warn .8026
 
 /******************************************************************************/
 #endif
index ffd3de10eb8aabd7e289c4cd8a65a43bddc0e8af..32f290c49e26e6eba68b02ec9fa0904fef904bbc 100644 (file)
@@ -57,12 +57,6 @@ INCLUDES
 #include "FGState.h"
 #include "FGFDMExec.h"
 
-#ifndef M_PI_2
-/* get a definition for pi */
-#include <Include/fg_constants.h>
-#define M_PI_2 FG_PI_2
-#endif
-
 /*******************************************************************************
 ************************************ CODE **************************************
 *******************************************************************************/
index 017b5a9db764edb962ed06564a1ee50f04952dba..aff77319c18fc4abfe2d2787f142ecac250c533e 100644 (file)
@@ -120,10 +120,10 @@ int main(int argc, char** argv)
 
   float cmd = 0.0;
 
-  while (FDMExec->GetState()->Getsim_time() <= 5.0)
+  while (FDMExec->GetState()->Getsim_time() <= 145.0)
   {
     // Fake an elevator ramp here after 1 second, hold for one second, ramp down
-
+    /*
     if (FDMExec->GetState()->Getsim_time() >= 1.00 &&
         FDMExec->GetState()->Getsim_time() < 2.0)
     {
@@ -140,7 +140,7 @@ int main(int argc, char** argv)
       cmd = 0.00;
     }
     FDMExec->GetFCS()->SetDeCmd(cmd);    // input between -1 and 1
-
+    */
     FDMExec->Run();
   }