From 623f94f85a49f1b720a025c680769ba2ba028ba0 Mon Sep 17 00:00:00 2001 From: Martin Miller Date: Tue, 4 Apr 2017 13:59:03 -0500 Subject: Update Body to use STATESIZE --- src/body.h | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'src/body.h') diff --git a/src/body.h b/src/body.h index 5544bba..97df1e9 100644 --- a/src/body.h +++ b/src/body.h @@ -9,7 +9,7 @@ //#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 */ +#define STATESIZE 13 using Eigen::Matrix; @@ -29,27 +29,21 @@ class Body 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); +#if STATESIZE==13 + Matrix F(const Vector3d &ang, double dt); Quaterniond qhat(); #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); + 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(); @@ -58,8 +52,12 @@ class Body /* ==================== 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); @@ -74,11 +72,7 @@ class Body /* ==================== METHODS ======================================= */ /* ==================== DATA MEMBERS ======================================= */ -#ifdef FULLSTATE - Matrix X; -#else - Matrix X; -#endif + Matrix X; char utm_c; int utm_i; Vector3d gravity_world; -- cgit v1.1