]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGLGear.h
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGLGear.h
index 0b2536a187e002f21c3492eb1499e4a784ee005a..9b4e02db6af7afed7957b9bb1bfe325cec809780 100644 (file)
@@ -42,31 +42,32 @@ INCLUDES
 #  include <simgear/compiler.h>
 #endif
 
-#include <string>
-#include "FGConfigFile.h"
-#include "FGMatrix.h"
+#include "FGJSBBase.h"
 #include "FGFDMExec.h"
-#include "FGState.h"
+#include "FGConfigFile.h"
+#include "FGColumnVector3.h"
+#include <string>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_LGEAR "$Header"
+#define ID_LGEAR "$Id$"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGAircraft;
-class FGPosition;
-class FGRotation;
+class FGPropagate;
+class FGFCS;
+class FGState;
+class FGMassBalance;
+class FGAuxiliary;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
@@ -143,6 +144,7 @@ CLASS DOCUMENTATION
     length times the spring coefficient and the gear velocity times the damping
     coefficient.</li>
     <li>The lateral/directional force acting on the aircraft through the landing
+
     gear (along the local frame X and Y axes) is calculated next. First, the
     friction coefficient is multiplied by the recently calculated Z-force. This
     is the friction force. It must be given direction in addition to magnitude.
@@ -158,51 +160,67 @@ CLASS DOCUMENTATION
     @author Jon S. Berndt
     @version $Id$
     @see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
-          NASA-Ames", NASA CR-2497, January 1975
+     NASA-Ames", NASA CR-2497, January 1975
     @see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
-          Wiley & Sons, 1979 ISBN 0-471-03032-5
+     Wiley & Sons, 1979 ISBN 0-471-03032-5
+    @see W. A. Ragsdale, "A Generic Landing Gear Dynamics Model for LASRS++",
+     AIAA-2000-4303
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGLGear
+class FGLGear : public FGJSBBase
 {
 public:
   /// Brake grouping enumerators
-  enum eBrakeGroup {bgNone=0, bgLeft, bgRight, bgCenter, bgNose, bgTail };
+  enum BrakeGroup {bgNone=0, bgLeft, bgRight, bgCenter, bgNose, bgTail };
+  /// Steering group membership enumerators
+  enum SteerType {stSteer, stFixed, stCaster};
+  /// Report type enumerators
+  enum ReportType {erNone=0, erTakeoff, erLand};
   /** Constructor
       @param Executive a pointer to the parent executive object
       @param File a pointer to the config file instance */
-  FGLGear(FGConfigFile* File, FGFDMExec* Executive);
+  FGLGear(FGConfigFile* File, FGFDMExec* Executive, int number);
   /** Constructor
       @param lgear a reference to an existing FGLGear object     */
   FGLGear(const FGLGear& lgear);
   /// Destructor
-  ~FGLGear(void);
+  ~FGLGear();
 
 
   /// The Force vector for this gear
-  FGColumnVector Force(void);
+  FGColumnVector3& Force(void);
   /// The Moment vector for this gear
-  FGColumnVector Moment(void) {return vMoment;}
+  FGColumnVector3& Moment(void) {return vMoment;}
+
   /// Gets the location of the gear in Body axes
-  FGColumnVector GetBodyLocation(void) { return vWhlBodyVec; }
-  
-  FGColumnVector GetLocalGear(void) { return vLocalGear; }
+  FGColumnVector3& GetBodyLocation(void) { return vWhlBodyVec; }
+  double GetBodyLocation(int idx) { return vWhlBodyVec(idx); }
+
+  FGColumnVector3& GetLocalGear(void) { return vLocalGear; }
+  double GetLocalGear(int idx) { return vLocalGear(idx); }
 
   /// Gets the name of the gear
   inline string GetName(void)      {return name;          }
   /// Gets the Weight On Wheels flag value
   inline bool   GetWOW(void)       {return WOW;           }
   /// Gets the current compressed length of the gear in feet
-  inline float  GetCompLen(void)   {return compressLength;}
+  inline double  GetCompLen(void)   {return compressLength;}
   /// Gets the current gear compression velocity in ft/sec
-  inline float  GetCompVel(void)   {return compressSpeed; }
+  inline double  GetCompVel(void)   {return compressSpeed; }
   /// Gets the gear compression force in pounds
-  inline float  GetCompForce(void) {return Force()(3);    }
-  
+  inline double  GetCompForce(void) {return Force()(3);    }
+  inline double  GetBrakeFCoeff(void) {return BrakeFCoeff;}
+  inline double GetXYZ(int i) {return vXYZ(i);}
+
+  /// Gets the current normalized tire pressure
+  inline double  GetTirePressure(void) { return TirePressureNorm; }
+  /// Sets the new normalized tire pressure
+  inline void    SetTirePressure(double p) { TirePressureNorm = p; }
+
   /// Sets the brake value in percent (0 - 100)
   inline void SetBrake(double bp) {brakePct = bp;}
 
@@ -212,47 +230,100 @@ public:
   /** Get the console touchdown reporting feature
       @return true if reporting is turned on */
   inline bool GetReport(void)    { return ReportEnable; }
+  double GetSteerNorm(void) const { return radtodeg/maxSteerAngle*SteerAngle; }
+  double GetDefaultSteerAngle(double cmd) const { return cmd*maxSteerAngle; }
+  double GetstaticFCoeff(void) { return staticFCoeff; }
+  double GetdynamicFCoeff(void) { return dynamicFCoeff; }
+  double GetrollingFCoeff(void) { return rollingFCoeff; }
+
+  inline int GetBrakeGroup(void) { return (int)eBrakeGrp; }
+  inline int GetSteerType(void)  { return (int)eSteerType; }
+
+  bool GetSteerable(void) const { return eSteerType != stFixed; }
+  inline bool GetRetractable(void)      const  { return isRetractable;   }
+  inline bool GetGearUnitUp(void)       const  { return GearUp;          }
+  inline bool GetGearUnitDown(void)     const  { return GearDown;        }
+  inline double GetWheelSideForce(void) const  { return SideForce;       }
+  inline double GetWheelRollForce(void) const  { return RollingForce;    }
+  inline double GetBodyXForce(void)     const  { return vLocalForce(eX); }
+  inline double GetBodyYForce(void)     const  { return vLocalForce(eY); }
+  inline double GetWheelSlipAngle(void) const  { return WheelSlip;       }
+  double GetWheelVel(int axis)          const  { return vWhlVelVec(axis);}
+  double GetkSpring(void)               const  { return kSpring;         }
+  double GetbDamp(void)                 const  { return bDamp;           }
+  double GetmaxSteerAngle(void)         const  { return maxSteerAngle;   }
+  string GetsBrakeGroup(void)           const  { return sBrakeGroup;     }
+  string GetsRetractable(void)          const  { return sRetractable;    }
+  string GetsSteerType(void)            const  { return sSteerType;      }
 
 private:
-  enum {eX=1, eY, eZ};
-  FGColumnVector vXYZ;
-  FGColumnVector vMoment;
-  FGColumnVector vWhlBodyVec;
-  FGColumnVector vLocalGear;
-  float kSpring;
-  float bDamp;
-  float compressLength;
-  float compressSpeed;
-  float staticFCoeff, dynamicFCoeff;
-  float brakePct;
-  float maxCompLen;
+  int GearNumber;
+  FGColumnVector3 vXYZ;
+  FGColumnVector3 vMoment;
+  FGColumnVector3 vWhlBodyVec;
+  FGColumnVector3 vLocalGear;
+  FGColumnVector3 vForce;
+  FGColumnVector3 vLocalForce;
+  FGColumnVector3 vWhlVelVec;     // Velocity of this wheel (Local)
+  double SteerAngle;
+  double kSpring;
+  double bDamp;
+  double compressLength;
+  double compressSpeed;
+  double staticFCoeff, dynamicFCoeff, rollingFCoeff;
+  double brakePct;
+  double BrakeFCoeff;
+  double maxCompLen;
   double SinkRate;
   double GroundSpeed;
-  double DistanceTraveled;
+  double TakeoffDistanceTraveled;
+  double TakeoffDistanceTraveled50ft;
+  double LandingDistanceTraveled;
   double MaximumStrutForce;
   double MaximumStrutTravel;
+  double SideWhlVel, RollingWhlVel;
+  double RollingForce, SideForce, FCoeff;
+  double WheelSlip;
+  double lastWheelSlip;
+  double TirePressureNorm;
   bool WOW;
+  bool lastWOW;
   bool FirstContact;
-  bool Reported;
+  bool StartedGroundRun;
+  bool LandingReported;
+  bool TakeoffReported;
   bool ReportEnable;
+  bool isRetractable;
+  bool GearUp, GearDown;
+  bool Servicable;
   string name;
-  string SteerType;
-  string BrakeGroup;
-  eBrakeGroup eBrakeGrp;
-  float  maxSteerAngle;
+  string sSteerType;
+  string sBrakeGroup;
+  string sRetractable;
+
+  BrakeGroup eBrakeGrp;
+  SteerType  eSteerType;
+  double  maxSteerAngle;
 
   FGFDMExec*     Exec;
   FGState*       State;
   FGAircraft*    Aircraft;
-  FGPosition*    Position;
-  FGRotation*    Rotation;
+  FGPropagate*   Propagate;
+  FGAuxiliary*   Auxiliary;
+  FGFCS*         FCS;
+  FGMassBalance* MassBalance;
 
-  void Report(void);
+  void Report(ReportType rt);
+  void Debug(int from);
 };
-
+}
 #include "FGAircraft.h"
-#include "FGPosition.h"
-#include "FGRotation.h"
+#include "FGPropagate.h"
+#include "FGAuxiliary.h"
+#include "FGFCS.h"
+#include "FGMassBalance.h"
+#include "FGState.h"
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 #endif