#ifndef body_INC #define body_INC #include #include #include "types.h" #define R_HEIGHT 2.5e-3 /* measurement noise of height measurement */ #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 /* */ #define FULLSTATE /* Uncomment to estimate quaternion */ using Eigen::Matrix; using Eigen::Vector3d; using Eigen::Quaterniond; /* * ===================================================================================== * Class: Body * Description: State representation of body. * ===================================================================================== */ class Body { public: /* ==================== LIFECYCLE ======================================= */ Body (){ gravity_world << 0.,0.,9.80655; }; /* constructor */ /* ==================== ACCESSORS ======================================= */ #ifdef FULLSTATE Matrix asVector(); void asVector(const Matrix &m); void dx( const Matrix &del); Matrix F(const Vector3d &ang, const Quaterniond &q, double dt); Matrix H(); Matrix Q(double dt); Matrix S(const Matrix &Pxx); #else Matrix F(const Vector3d &ang, const Quaterniond &q, double dt); Matrix asVector(); void asVector(const Matrix &m); void dx( const Matrix &del); Matrix H(); Matrix Q(double dt); Matrix S(const Matrix &Pxx); #endif Vector3d ned(); Vector3d vel(); /* ==================== MUTATORS ======================================= */ void accelerometer_bias( const Vector3d &b); void clamp(); void pos( const UTM &utm); void vel(const Matrix &v); /* ==================== OPERATORS ======================================= */ Matrix h(); void motionModel ( const Vector3d &acc, const Vector3d &ang, const Quaterniond &q, const double dt); Matrix R(); Matrix skewSymmetric(const Vector3d &x); Matrix omega(const Vector3d &x); void unicsv(); protected: /* ==================== METHODS ======================================= */ /* ==================== DATA MEMBERS ======================================= */ private: /* ==================== METHODS ======================================= */ /* ==================== DATA MEMBERS ======================================= */ #ifdef FULLSTATE Matrix X; #else Matrix X; #endif char utm_c; int utm_i; Vector3d gravity_world; }; /* ----- end of class Body ----- */ #endif /* ----- #ifndef body_INC ----- */