#ifndef feature_INC #define feature_INC #include #include #include "types.h" using Eigen::Vector2d; using Eigen::Vector3d; using Eigen::Matrix; using Eigen::MatrixXd; using Eigen::Quaterniond; using std::cout; using std::cerr; using std::endl; /* * ===================================================================================== * Class: Feature * Description: * ===================================================================================== */ class Feature { public: /* ==================== LIFECYCLE ======================================= */ Feature ( int id, const Vector3d &xs, const Vector3d &xr, const Vector3d &xbw, const Quaterniond &q, double z ); /* constructor */ /* ==================== ACCESSORS ======================================= */ int id(); Matrix P0(); UTM utm(Vector3d &xbw, Quaterniond &q); /* ==================== MUTATORS ======================================= */ void motionModel ( const Vector3d &ang, const Vector3d &vel, const double dt); void dx( const Vector3d &del); /* ==================== OPERATORS ======================================= */ bool sane(); bool inFOV(); Vector3d findDepth( const Quaterniond &q, double z, const Vector3d &xs, const Vector3d &xr); Matrix Fx( double dt ); Matrix Fy( const Vector3d &vel, const Vector3d &ang, double dt); Matrix Hx( const Vector3d &pos, const Quaterniond &q); Matrix Hy( const Vector3d &pos, const Quaterniond &q); Matrix h( const Vector3d &x, const Quaterniond &q); Matrix L(); Matrix measurement_vector(const Vector3d &xs, const Vector3d &xr); Matrix Q(const double dt); Matrix R(); Matrix S ( const Matrix &Pxx, const Matrix &Pxy, const Matrix &Pyy, const Vector3d &pos, const Quaterniond &q); Vector3d p2x(const Vector3d &p); Vector3d x2p(const Vector3d &x); protected: /* ==================== METHODS ======================================= */ /* ==================== DATA MEMBERS ======================================= */ private: /* ==================== METHODS ======================================= */ /* ==================== DATA MEMBERS ======================================= */ int _id; Vector3d X; Vector3d X0; Quaterniond q0; Vector3d xb0w; }; /* ----- end of class Feature ----- */ #endif /* ----- #ifndef feature_INC ----- */