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::optional<mola::Georeferencing> geoReference;
    bool localizationConverged = 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.

std::optional<mola::Georeferencing> geoReference

Current georeference (fixed or estimated), if any.

bool localizationConverged = false

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