#ifndef body_INC #define body_INC #include #include #include "types.h" #define R_HEIGHT 2.5e-3 /* measurement noise of height measurement */ #define ACC_STD 28e-3 #define ANG_STD 9e-3 #define ACC_BIAS_STD 22e-3 #define ANG_BIAS_STD 3e-3 #define IMU_NOISE 800e-6 /* IMU process noise */ #define IMU_RANDOMWALK 50e-6 /* Bias process noise */ //#define DOCLAMP #define MAXHEIGHT -1.5 /* Notion of max and min is reversed due to z pointing down */ #define MINHEIGHT -0.3 /* */ using Eigen::Matrix; using Eigen::Matrix3d; using Eigen::Matrix4d; using Eigen::Vector3d; using Eigen::Vector4d; using Eigen::Quaterniond; using std::cout; using std::cerr; using std::endl; /* * ===================================================================================== * Class: Body * Description: State representation of body. * ===================================================================================== */ class Body { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW /* ==================== LIFECYCLE ======================================= */ Body (){ gravity_world << 0.,0.,9.80655; }; /* constructor */ /* ==================== ACCESSORS ======================================= */ #if STATESIZE==13 Matrix F(const Vector3d &ang, double dt); Quaterniond qhat(); void qhat(const Quaterniond &q); void normalizeQuaternion(); #else Matrix F(const Vector3d &ang, const Quaterniond &q, double dt); #endif Matrix asVector(); void asVector(const Matrix &m); void dx( const Matrix &del); Matrix H(); Matrix Q(double dt); Matrix S(const Matrix &Pxx); Vector3d ned(); Vector3d vel(); Vector3d accelerometer_bias( ); /* ==================== MUTATORS ======================================= */ void accelerometer_bias( const Vector3d &b); void clamp(); void pos( const UTM &utm); void vel(const Matrix &v); /* ==================== OPERATORS ======================================= */ Matrix h(); #if STATESIZE==13 void motionModel ( const Vector3d &acc, const Vector3d &ang, const double dt); #else void motionModel ( const Vector3d &acc, const Vector3d &ang, const Quaterniond &q, const double dt); #endif Matrix R(); Matrix skewSymmetric(const Vector3d &x); Matrix omega(const Vector3d &x); Matrix qomega(const Quaterniond &q); void unicsv(const double time); protected: /* ==================== METHODS ======================================= */ /* ==================== DATA MEMBERS ======================================= */ private: /* ==================== METHODS ======================================= */ /* ==================== DATA MEMBERS ======================================= */ Matrix X; char utm_c; int utm_i; Vector3d gravity_world; }; /* ----- end of class Body ----- */ #endif /* ----- #ifndef body_INC ----- */