#ifndef feature_INC #define feature_INC #include #include #include "types.h" #define FEATURE_NOISE 1 /* Feature process noise */ #define VIEW_NOISE .33 /* */ #define INITIAL_VIEW_NOISE .33 /* */ #define REFLECTION_VIEW_NOISE 1.1 /* */ #define FEATURECOVX .33 /* */ #define FEATURECOVY .33 /* */ #define FEATURECOVRHO 5e-2 /* */ #define FEATURECOVRHO_MONO 0.5 /* */ #define RHO_0 1./10. /* */ using Eigen::Dynamic; using Eigen::Matrix; using Eigen::MatrixXd; using Eigen::Quaterniond; using Eigen::Vector2d; using Eigen::Vector3d; 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); Feature ( int id, const Vector3d &xs, const Vector3d &xbw, const Quaterniond &q); /* ==================== ACCESSORS ======================================= */ int id(); Matrix P0(measurement_type t); 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 measurement_vector( const Vector3d &xs ); 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 ----- */