ov_type::Landmark class

Type that implements a persistent SLAM feature.

We store the feature ID that should match the IDs in the trackers. Additionally if this is an anchored representation we store what clone timestamp this is anchored from and what camera. If this features should be marginalized its flag can be set and during cleanup it will be removed.

Base classes

class Vec
Derived Type class that implements vector variables.

Constructors, destructors, conversion operators

Landmark(int dim)
Default constructor (feature is a Vec of size 3 or Vec of size 1)

Public functions

void update(const Eigen::VectorXd& dx) override
Overrides the default vector update rule We want to selectively update the FEJ value if we are using an anchored representation.
auto get_xyz(bool getfej) const -> Eigen::Matrix<double, 3, 1>
Will return the position of the feature in the global frame of reference.
void set_from_xyz(Eigen::Matrix<double, 3, 1> p_FinG, bool isfej)
Will set the current value based on the representation.

Public variables

size_t _featid
Feature ID of this landmark (corresponds to frontend id)
int _unique_camera_id
What unique camera stream this slam feature was observed from.
int _anchor_cam_id
What camera ID our pose is anchored in!! By default the first measurement is the anchor.
double _anchor_clone_timestamp
Timestamp of anchor clone.
bool has_had_anchor_change
Boolean if this landmark has had at least one anchor change.
bool should_marg
Boolean if this landmark should be marginalized out.
int update_fail_count
Number of times the update has failed for this feature (we should remove if it fails a couple times!)
Eigen::Vector3d uv_norm_zero
First normalized uv coordinate bearing of this measurement (used for single depth representation)
Eigen::Vector3d uv_norm_zero_fej
First estimate normalized uv coordinate bearing of this measurement (used for single depth representation)
LandmarkRepresentation::Representation _feat_representation
What feature representation this feature currently has.

Function documentation

void ov_type::Landmark::update(const Eigen::VectorXd& dx) override

Overrides the default vector update rule We want to selectively update the FEJ value if we are using an anchored representation.

Parameters
dx Additive error state correction

Eigen::Matrix<double, 3, 1> ov_type::Landmark::get_xyz(bool getfej) const

Will return the position of the feature in the global frame of reference.

Parameters
getfej Set to true to get the landmark FEJ value
Returns Position of feature either in global or anchor frame

void ov_type::Landmark::set_from_xyz(Eigen::Matrix<double, 3, 1> p_FinG, bool isfej)

Will set the current value based on the representation.

Parameters
p_FinG Position of the feature either in global or anchor frame
isfej Set to true to set the landmark FEJ value