ov_type::Landmark class

Type that implements a persistant 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) -> 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 _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.
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)

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

CASE: Global 3d feature representation CASE: Anchored 3D feature representation

CASE: Global inverse depth feature representation CASE: Anchored full inverse depth feature representation

CASE: Anchored MSCKF inverse depth feature representation

CASE: Estimate single depth of the feature using the initial bearing

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

CASE: Global 3d feature representation CASE: Anchored 3d feature representation

CASE: Global inverse depth feature representation CASE: Anchored inverse depth feature representation

CASE: MSCKF anchored inverse depth representation

CASE: Estimate single depth of the feature using the initial bearing