From 816411abf8e9ff633a29449cc0ac445c11f73a1c Mon Sep 17 00:00:00 2001 From: Martin Miller Date: Sat, 18 Mar 2017 20:32:08 -0500 Subject: Major rewrite moves state variables into state. Rather than maintain X and P in the main function they are moved into the body and state classes, respectively. This will become much more important when features are added and the accounting becomes more complicated. --- src/state.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'src/state.h') diff --git a/src/state.h b/src/state.h index 743f5d8..1efb0c2 100644 --- a/src/state.h +++ b/src/state.h @@ -1,7 +1,14 @@ #ifndef state_INC #define state_INC #include +#include "body.h" +#include "types.h" + +#define MAXFEATURES 30 using Eigen::Matrix; +using Eigen::Dynamic; +using Eigen::Vector3d; +using Eigen::Quaternion; /* * ===================================================================================== * Class: State @@ -12,18 +19,23 @@ class State { public: /* ==================== LIFECYCLE ======================================= */ - State (){}; /* constructor */ + State (); /* constructor */ /* ==================== ACCESSORS ======================================= */ /* ==================== MUTATORS ======================================= */ + void accelerometer_bias(const Vector3d &b); + void enu(const UTM &utm); + void motionModel(const Vector3d &acc, const Vector3d &ang, + const Quaternion &q, const double dt); + void position_covariance(const Matrix &p); + void velocity_covariance(const Matrix &p); + void vel(const Matrix &v); + void Pkk1 ( const Vector3d &ang, const Quaternion &q, const double dt); /* ==================== OPERATORS ======================================= */ - void Pkk1 ( Matrix &P, const Matrix &F, - const Matrix &Q ); - void update (Matrix &X, Matrix &P, - const Matrix H, const Matrix &h, - const Matrix &z, const Matrix &R); + void update ( const Matrix &z); + void unicsv(); protected: /* ==================== METHODS ======================================= */ @@ -34,6 +46,11 @@ class State /* ==================== METHODS ======================================= */ /* ==================== DATA MEMBERS ======================================= */ + Body *body; + Matrix P; + char utm_c; + int utm_i; + }; /* ----- end of class State ----- */ -- cgit v1.1