class mola::FactorBase

Overview

Base class for all “factors” in the world model

#include <FactorBase.h>

class FactorBase: public mrpt::serialization::CSerializable
{
public:
    // fields

    mola::fid_t my_id_ {mola::INVALID_FID};
    mola::Robust robust_type_ {mola::Robust::REGULAR_L2};
    double robust_param_ {1.0};

    // methods

    virtual std::size_t edge_count() const = 0;
    virtual mola::id_t edge_indices(const std::size_t i) const = 0;
};

// direct descendants

class FactorDynamicsConstVel;
class FactorRelativePose3;
class FactorStereoProjectionPose;
class SmartFactorIMU;
class SmartFactorStereoProjectionPose;

Fields

mola::fid_t my_id_ {mola::INVALID_FID}

The unique ID of this factor in the world model. Stored here for convenience, notice that it is redundant since entities are already stored in the WorldModel indexed by ID.

mola::Robust robust_type_ {mola::Robust::REGULAR_L2}

Type of robust error function to use

double robust_param_ {1.0}

Parameter for the robust error function, if so defined in robust_type_

Methods

virtual std::size_t edge_count() const = 0

Number of entities involved in this factor: 1 for unary factors, 2 for binary, etc.

virtual mola::id_t edge_indices(const std::size_t i) const = 0

Access entity indices involved in this factor