struct mola::state_estimation_smoother::Snapshot

Overview

An immutable snapshot of everything the read side of the smoother needs, produced once per backend solve and published atomically as a std::shared_ptr<const Snapshot>.

In synchronous mode it is built at the end of each process_pending_gtsam_updates() so the getters can read a consistent set of values; in async mode it is what the FastPredictor and the lock-free getters read while the backend thread holds stateMutex_ for the next solve.

#include <Snapshot.h>

struct Snapshot
{
    // typedefs

    typedef uint8_t odometry_frameid_t;

    // structs

    struct RawSourcePose;

    // fields

    bool valid = false;
    mrpt::Clock::time_point anchorStamp;
    NavState anchor;
    std::map<odometry_frameid_t, mrpt::poses::CPose3DPDFGaussian> frameTransforms;
    mrpt::containers::bimap<std::string, odometry_frameid_t> frameNames;
    std::map<odometry_frameid_t, RawSourcePose> lastRawPoseBySource;
    std::map<odometry_frameid_t, std::array<double, 6>> predictionVarRate;
    std::optional<mola::Georeferencing> geoReference;
    std::optional<mola::Georeferencing> currentGeoReference;
    bool localizationConverged = false;
    bool mapPositionObserved = false;
};

Fields

bool valid = false

False until the first successful solve, and again after a reset(): a consumer must treat an invalid snapshot as “not ready”, never as stale certainty.

mrpt::Clock::time_point anchorStamp

Newest keyframe stamp and its optimized state (in the reference {map} frame). This is the anchor the fast predictor extrapolates from.

std::map<odometry_frameid_t, mrpt::poses::CPose3DPDFGaussian> frameTransforms

Latest estimated T_map_to_odom_i, keyed by numeric odometry frame id, plus the name<->id mapping so a query by frame name can be resolved. The covariance is only filled in for sources without a raw pose yet (the only case FastPredictor reads it); the mean is always valid.

std::map<odometry_frameid_t, std::array<double, 6>> predictionVarRate

Sources with enough prediction errors: their mean squared error per unit time squared (see State::prediction_residuals).

std::optional<mola::Georeferencing> geoReference

Current georeference (fixed or estimated), if any.

std::optional<mola::Georeferencing> currentGeoReference

The geo-reference served by get_geo_reference(): like geoReference, but with the latest T_enu_to_map estimate even while not “converged”. Used to serve poses in the ENU frame.

bool localizationConverged = false

Whether localization has converged (mode-aware, mirrors has_converged_localization()).

bool mapPositionObserved = false

Whether some source has observed the position of {map} in the solved estimate (GNSS, or a pose in {map}). Until then, with a fixed geo-reference, it is only the position of the first odometry frame.