#ifndef feature_INC #define feature_INC #include #include #include "types.h" #define FEATURE_NOISE 1e-3 /* Feature process noise */ #define VIEW_NOISE 1e-3 /* */ #define INITIAL_VIEW_NOISE 1e-3 /* */ #define REFLECTION_VIEW_NOISE 1e-2 /* */ #define FEATURECOVX 1e-4 /* */ #define FEATURECOVY 1e-4 /* */ #define FEATURECOVRHO 5e-3 /* */ #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(); 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; measurement_type fType; }; /* ----- end of class Feature ----- */ #endif /* ----- #ifndef feature_INC ----- */