X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2FFGRotation.h;h=d072bda1e1a46c677f3b081da1896b9e40cd9820;hb=74fbaa8f5e085d1c7a70e9ecd9e0494b75b5908c;hp=01fa8aed0d6b084a3714dc5938d77a701dd83706;hpb=ea80ed959e180356dc03b62484477bdfcf20952b;p=flightgear.git diff --git a/src/FDM/JSBSim/FGRotation.h b/src/FDM/JSBSim/FGRotation.h index 01fa8aed0..d072bda1e 100644 --- a/src/FDM/JSBSim/FGRotation.h +++ b/src/FDM/JSBSim/FGRotation.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGRotation.h Author: Jon Berndt @@ -27,9 +27,9 @@ HISTORY -------------------------------------------------------------------------------- 12/02/98 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMENTS, REFERENCES, and NOTES -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate School, January 1994 @@ -45,16 +45,16 @@ COMMENTS, REFERENCES, and NOTES The order of rotations used in this class corresponds to a 3-2-1 sequence, or Y-P-R, or Z-Y-X, if you prefer. -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGROTATION_H #define FGROTATION_H -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -67,45 +67,66 @@ INCLUDES # include #endif +#ifndef M_PI +# include +# define M_PI FG_PI +#endif + #include "FGModel.h" #include "FGMatrix.h" -using namespace std; +#define ID_ROTATION "$Id$" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION -*******************************************************************************/ - -#pragma warn -8026 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGRotation : public FGModel { - FGColumnVector vPQR; - FGColumnVector vPQRdot; - FGColumnVector vMoments; - FGColumnVector vEuler; - - float Ixx, Iyy, Izz, Ixz; - float dt; - - void GetState(void); - public: FGRotation(FGFDMExec*); - ~FGRotation(void); + ~FGRotation(); bool Run(void); inline FGColumnVector GetPQR(void) {return vPQR;} inline FGColumnVector GetPQRdot(void) {return vPQRdot;} inline FGColumnVector GetEuler(void) {return vEuler;} + inline FGColumnVector GetEulerRates(void) { return vEulerRates; } inline void SetPQR(FGColumnVector tt) {vPQR = tt;} inline void SetEuler(FGColumnVector tt) {vEuler = tt;} + inline float Getphi(void) {return vEuler(1);} inline float Gettht(void) {return vEuler(2);} inline float Getpsi(void) {return vEuler(3);} + + inline float GetCosphi(void) {return cPhi;} + inline float GetCostht(void) {return cTht;} + inline float GetCospsi(void) {return cPsi;} + + inline float GetSinphi(void) {return sPhi;} + inline float GetSintht(void) {return sTht;} + inline float GetSinpsi(void) {return sPsi;} + +private: + FGColumnVector vPQR; + FGColumnVector vPQRdot; + FGColumnVector vMoments; + FGColumnVector vEuler; + FGColumnVector vEulerRates; + + float cTht,sTht; + float cPhi,sPhi; + float cPsi,sPsi; + + float Ixx, Iyy, Izz, Ixz; + float dt; + + void GetState(void); + + void Debug(void); }; -#pragma warn .8026 -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif +