class mrpt::maps::CLandmark

The class for storing “landmarks” (visual or laser-scan-extracted features,…)

The descriptors for each kind of descriptor are stored in the vector “features”, which will typically consists of only 1 element, or 2 elements for landmarks obtained from stereo images.

See also:

CLandmarksMap

#include <mrpt/maps/CLandmark.h>

class CLandmark: public mrpt::serialization::CSerializable
{
public:
    // typedefs

    typedef int64_t TLandmarkID;

    //
fields

    std::vector<mrpt::vision::CFeature> features;
    mrpt::math::TPoint3D pose_mean;
    mrpt::math::TPoint3D normal;
    float pose_cov_11 {};
    float pose_cov_22 {};
    float pose_cov_33 {};
    float pose_cov_12 {};
    float pose_cov_13 {};
    float pose_cov_23 {};
    TLandmarkID ID = mrpt::obs::INVALID_LANDMARK_ID;
    mrpt::system::TTimeStamp timestampLastSeen {INVALID_TIMESTAMP};
    uint32_t seenTimesCount {0};

    // construction

    CLandmark();

    //
methods

    void getPose(mrpt::poses::CPointPDFGaussian& p) const;

    void getPose(
        mrpt::poses::CPoint3D& p,
        mrpt::math::CMatrixDouble& COV
        ) const;

    void setPose(const mrpt::poses::CPointPDFGaussian& p);
    mrpt::vision::TKeyPointMethod getType() const;
    void createOneFeature();
};

Typedefs

typedef int64_t TLandmarkID

The type for the IDs of landmarks.

Fields

std::vector<mrpt::vision::CFeature> features

The set of features from which the landmark comes.

mrpt::math::TPoint3D pose_mean

The mean of the landmark 3D position.

mrpt::math::TPoint3D normal

The “normal” to the landmark, i.e.

a unitary 3D vector towards the viewing direction, or a null vector if not applicable

TLandmarkID ID = mrpt::obs::INVALID_LANDMARK_ID

An ID for the landmark (see details next…) This ID was introduced in the version 3 of this class (21/NOV/2006), and its aim is to provide a way for easily establishing correspondences between landmarks detected in sequential image frames.

Thus, the management of this field should be:

  • In ‘servers’ (classes/modules/… that detect landmarks from images): A different ID must be assigned to every landmark (e.g. a sequential counter), BUT only in the case of being sure of the correspondence of one landmark with another one in the past (e.g. tracking).

  • In ‘clients’: This field can be ignored, but if it is used, the advantage is solving the correspondence between landmarks detected in consequentive instants of time: Two landmarks with the same ID correspond to the same physical feature, BUT it should not be expected the inverse to be always true.

Note that this field is never fill out automatically, it must be set by the programmer if used.

mrpt::system::TTimeStamp timestampLastSeen {INVALID_TIMESTAMP}

The last time that this landmark was observed.

uint32_t seenTimesCount {0}

The number of times that this landmark has been seen.

Construction

CLandmark()

Default constructor.

Methods

void getPose(mrpt::poses::CPointPDFGaussian& p) const

Returns the pose as an object:

void setPose(const mrpt::poses::CPointPDFGaussian& p)

Sets the pose from an object:

mrpt::vision::TKeyPointMethod getType() const

Gets the type of the first feature in its feature vector.

The vector must not be empty.

void createOneFeature()

Creates one feature in the vector “features”, calling the appropriate constructor of the smart pointer, so after calling this method “features[0]” is a valid pointer to a CFeature object.