class mola::ScanImuWaitList

Overview

Holds LiDAR scans back until the IMU covering their whole time span has been received, so a scan always runs against a fixed set of IMU samples.

Pure timestamp bookkeeping: no threads, no locks, no clocks.

#include <ImuScanSync.h>

class ScanImuWaitList
{
public:
    // structs

    struct Entry;

    // methods

    void add(
        double scanTimestamp,
        const Entry& e
        );

    std::vector<Entry> take_ready(double latestImuTime);
    std::size_t trim_to(std::size_t maxSize);
    std::size_t size() const;
};

Methods

std::vector<Entry> take_ready(double latestImuTime)

Removes and returns, in timestamp order, every scan whose IMU window is already covered by data received up to latestImuTime.

std::size_t trim_to(std::size_t maxSize)

Drops the oldest scans until at most maxSize remain.

Returns:

How many were dropped.