VR-Link API Documentation for HLA Evolved
smoother.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 
00008 
00009 #ifndef smoother_H_
00010 #define smoother_H_
00011 
00012 #include "deadReckoner.h"
00013 
00022 class DT_DLL_VLPROTIND DtSmoother : public DtDeadReckoner
00023 {
00024 public:
00026    DtSmoother();
00028    virtual ~DtSmoother();
00030    DtSmoother( const DtSmoother& src );
00032    DtSmoother& operator=( const DtSmoother& src );
00033 
00036    virtual DtApproximator* clone() const;
00037 
00038 protected:
00039    virtual void resetPosSmoother( DtTime t );
00040    virtual void resetOriSmoother( DtTime t );
00041 
00042 public:
00044    virtual void setLocation( const DtVector& loc, DtTime t );
00046    virtual const DtVector& approxLocation( DtTime t ) const;
00047 
00049    virtual void setVelocity( const DtVector& vel, DtTime t );
00051    virtual const DtVector& approxVelocity( DtTime t ) const;
00052 
00054    virtual void setOrientation( const DtTaitBryan& ori, DtTime t );
00056    virtual const DtTaitBryan& approxEuler( DtTime t ) const;
00057 
00059    virtual void setAcceleration( const DtVector& acc, DtTime t );
00060    virtual const DtVector& acceleration( DtTime t ) const;
00061 
00063    virtual void setRotationalVelocity( const DtVector& vel, DtTime t );
00064    virtual const DtVector& rotationalVelocity( DtTime t ) const;
00065 
00067    virtual const DtDcm& approxBodyToGeoc( DtTime t ) const;
00068 
00072    virtual void setSmoothPeriod( DtTime t );
00073    virtual DtTime smoothPeriod() const;
00074 
00078    virtual void setOriSmoothPeriod( DtTime t );
00079    virtual DtTime oriSmoothPeriod() const;
00080 
00081    virtual void setSmoothEnable(bool onOff);
00082    virtual bool smoothEnable() const;
00083 
00084 protected:
00085    virtual const DtVector& smoothPosition( DtTime t );
00086    virtual const DtVector& smoothVelocity( DtTime t );
00087    virtual const DtDcm& smoothBodyToGeoc( DtTime t );
00088    virtual void initSmootherParams();
00089    virtual void initSmoothOriParams();
00090 
00098    inline DtSmoother* self() const;
00099 
00100 public:
00102    static void setDfltSmoothPeriod(DtTime smoothPeriod);
00103    static DtTime dfltSmoothPeriod();
00104 
00107    static void setMasterSmoothEnable(bool onOff);
00108    static bool masterSmoothEnable();
00109 
00110 
00111    static void rotAngleAndAxisFromRotMatrix(
00112       DtVector& n, double& phi, const DtDcm& m );
00113    static void rotMatrixFromRotRatesAndTime(
00114       DtDcm& m, DtDcm& o, DtVector& n, double& w, const DtVector& r, double t );
00115 
00116 protected:
00117    static double theTimeTolerance;
00118    static bool   theMasterSmoothEnable;
00119    static DtTime theDfltSmoothPeriod;
00120 
00121 protected:
00122    DtVector    myLastDrPos;
00123    DtVector    myLastDrVel;
00124    DtVector    mySmoothPos;
00125    DtVector    mySmoothVel;
00126    DtVector    myX1;
00127    DtVector    myV1;
00128    DtVector    myA1;
00129    DtVector    myA2;
00130    DtTime      myTau;
00131    DtTime      myTau2;
00132    DtTime      myTau2Inv;
00133    DtTime      myTauSq4;
00134    DtTime      myTauSq4Inv;
00135    DtTime      myLastSetTime;
00136    DtTime      myPostSmoothTime;
00137    DtTime      myHalfSmoothTime;
00138    DtTime      myOriTau;
00139    DtTime      myLastSetOriTime;
00140    DtTime      myPostSmoothOriTime;
00141    DtTime      myLastSmoothOriTime;
00142    DtTime      myLastSmoothTbTime;
00143    double      mySmoothRotRate;
00144    DtDcm       myLastDrOri;
00145    DtDcm       mySmoothOri;
00146    DtDcm       mySmoothOmegaMx;
00147    DtVector    mySmoothRotAxis;
00148    DtTaitBryan mySmoothTb;
00149    bool        myIsDirty;
00150    bool        myOriIsDirty;
00151    bool        myTbIsDirty;
00152    bool        mySmoothEnable;
00153 };
00154 
00155 
00156 inline DtSmoother* DtSmoother::self() const
00157 {
00158    return (DtSmoother*)this;
00159 }
00160 
00161 #endif   //! DtFxdSmoother_H_
00162 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)