]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPosition.h
Added recent ground effect modeling changes.
[flightgear.git] / src / FDM / JSBSim / FGPosition.h
index 423889bc35ab5ea29fa3f1360f176ead854d71eb..ca93d258a2441e02b0050b4d7a74cabb3d25687d 100644 (file)
@@ -1,5 +1,5 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
  Header:       FGPosition.h
  Author:       Jon S. Berndt
  Date started: 1/5/99
@@ -27,63 +27,80 @@ HISTORY
 --------------------------------------------------------------------------------
 01/05/99   JSB   Created
  
-********************************************************************************
-COMMENTS, REFERENCES,  and NOTES
-********************************************************************************
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGPOSITION_H
 #define FGPOSITION_H
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGModel.h"
 #include "FGMatrix.h"
 
-/*******************************************************************************
-CLASS DECLARATION
-*******************************************************************************/
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGPosition : public FGModel {
-  FGColumnVector vUVW;
-  FGColumnVector vVel;
+#define ID_POSITION "$Id$"
 
-  double Vee, invMass, invRadius;
-  double Radius, h;
-  double LatitudeDot, LongitudeDot, RadiusDot;
-  double lastLatitudeDot, lastLongitudeDot, lastRadiusDot;
-  double Longitude, Latitude;
-  float dt;
-  double RunwayRadius;
-  double DistanceAGL;
-  double SeaLevelRadius;
-  double gamma;
-  double Vt;
-  double hoverb,b;
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-  void GetState(void);
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES,  and NOTES
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+/** Models the lateral and longitudinal translational EOM.
+    @author Jon S. Berndt
+    @version $Id$
+  */
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DECLARATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+class FGPosition : public FGModel {
 public:
+  /** Constructor
+      @param Executive a pointer to the parent executive object */
   FGPosition(FGFDMExec*);
-  ~FGPosition(void);
+  /// Destructor
+  ~FGPosition();
 
+  /** Runs the Position model; called by the Executive
+      @see JSBSim.cpp documentation
+      @return false if no error */
+  bool Run(void);
+  
   inline FGColumnVector GetVel(void) { return vVel; }
-  inline FGColumnVector GetUVW(void) { return vUVW; }
+  inline FGColumnVector GetVelDot(void) { return vVelDot; }
   inline double GetVn(void)  { return vVel(eX); }
   inline double GetVe(void)  { return vVel(eY); }
   inline double GetVd(void)  { return vVel(eZ); }
+  inline double GetVground(void) { return Vground; }
+  inline double GetGroundTrack(void) { return psigt; }
   inline double Geth(void)  { return h; }
   inline double Gethdot(void) { return RadiusDot; }
   inline double GetLatitude(void) { return Latitude; }
+  inline double GetLatitudeDot(void) { return LatitudeDot; }
   inline double GetLongitude(void) { return Longitude; }
+  inline double GetLongitudeDot(void) { return LongitudeDot; }
   inline double GetRunwayRadius(void) { return RunwayRadius; }
   inline double GetDistanceAGL(void)  { return DistanceAGL; }
+  inline double GetRadius(void) { return Radius; }
+  inline FGColumnVector GetRunwayNormal(void) { return vRunwayNormal; }
+  
   inline double GetGamma(void) { return gamma; }
+  inline void SetGamma(float tt) { gamma = tt; }
   inline double GetHOverB(void) { return hoverb; }
   void SetvVel(const FGColumnVector& v) { vVel = v; }
   void SetLatitude(float tt) { Latitude = tt; }
@@ -92,9 +109,34 @@ public:
   void SetRunwayRadius(double tt) { RunwayRadius = tt; }
   void SetSeaLevelRadius(double tt) { SeaLevelRadius = tt;}
   void SetDistanceAGL(double tt);
+  inline void SetRunwayNormal(double fgx, double fgy, double fgz ) {
+      vRunwayNormal << fgx << fgy << fgz;
+  }
+  
+private:  
+  FGColumnVector vVel;
+  FGColumnVector vVelDot;
+  FGColumnVector vRunwayNormal;
+  
+  double Vee, invMass, invRadius;
+  double Radius, h;
+  double LatitudeDot, LongitudeDot, RadiusDot;
+  double lastLatitudeDot, lastLongitudeDot, lastRadiusDot;
+  double Longitude, Latitude;
+  float dt;
+  double RunwayRadius;
+  double DistanceAGL;
+  double SeaLevelRadius;
+  double gamma;
+  double Vt, Vground;
+  float hoverb,b;
 
-  bool Run(void);
+  double psigt;
+
+  void GetState(void);
+  void Debug(void);
 };
 
-/******************************************************************************/
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
+