22 #ifndef OV_CORE_FEATURE_DATABASE_H 23 #define OV_CORE_FEATURE_DATABASE_H 25 #include <Eigen/Eigen> 28 #include <unordered_map> 68 std::shared_ptr<Feature>
get_feature(
size_t id,
bool remove =
false);
91 void update_feature(
size_t id,
double timestamp,
size_t cam_id,
float u,
float v,
float u_n,
float v_n);
108 std::vector<std::shared_ptr<Feature>>
features_containing_older(
double timestamp,
bool remove =
false,
bool skip_deleted =
false);
116 std::vector<std::shared_ptr<Feature>>
features_containing(
double timestamp,
bool remove =
false,
bool skip_deleted =
false);
139 std::lock_guard<std::mutex> lck(
mtx);
147 std::lock_guard<std::mutex> lck(
mtx);
std::vector< std::shared_ptr< Feature > > features_containing_older(double timestamp, bool remove=false, bool skip_deleted=false)
Get features that has measurements older then the specified time.
std::mutex mtx
Mutex lock for our map.
void update_feature(size_t id, double timestamp, size_t cam_id, float u, float v, float u_n, float v_n)
Update a feature object.
size_t size()
Returns the size of the feature database.
void cleanup_measurements(double timestamp)
This function will delete all feature measurements that are older then the specified timestamp...
std::shared_ptr< Feature > get_feature(size_t id, bool remove=false)
Get a specified feature.
void cleanup_measurements_exact(double timestamp)
This function will delete all feature measurements that are at the specified timestamp.
Sparse feature class used to collect measurements.
double get_oldest_timestamp()
Gets the oldest time in the database.
Database containing features we are currently tracking.
FeatureDatabase()
Default constructor.
std::unordered_map< size_t, std::shared_ptr< Feature > > features_idlookup
Our lookup array that allow use to query based on ID.
void append_new_measurements(const std::shared_ptr< FeatureDatabase > &database)
Will update the passed database with this database's latest feature information.
Core algorithms for OpenVINS.
bool get_feature_clone(size_t id, Feature &feat)
Get a specified feature clone (pointer is thread safe)
void cleanup()
This function will delete all features that have been used up.
std::vector< std::shared_ptr< Feature > > features_not_containing_newer(double timestamp, bool remove=false, bool skip_deleted=false)
Get features that do not have newer measurement then the specified time.
std::vector< std::shared_ptr< Feature > > features_containing(double timestamp, bool remove=false, bool skip_deleted=false)
Get features that has measurements at the specified time.
std::unordered_map< size_t, std::shared_ptr< Feature > > get_internal_data()
Returns the internal data (should not normally be used)