class mola::AdaptiveDecimation¶
Overview¶
Decides whether a LiDAR scan can be skipped, from the motion since the last processed scan. A scan is skipped only if, by the next scan, every budget would still hold: rotation (integrated gyroscope, or the estimator angular velocity if allowed without gyroscope readings), distance (estimator linear speed times the gap), time gap and number of consecutive skipped scans. Every scan is also processed after a bad registration, and for a while after one whose quality fell below its recent median: in scenes where registration gets marginal, the larger steps of skipped scans are what makes it fail.
Uses sensor time only, so its decisions are deterministic. Not thread safe.
#include <AdaptiveDecimation.h> class AdaptiveDecimation { public: // structs struct Budgets; struct Scan; // methods void addGyro(double t, const mrpt::math::TVector3D& w); const char* decide(const Scan& scan, const Budgets& budgets); void onScanDropped(); void addRegistrationQuality(double t, double quality, const Budgets& budgets); double gyroRotation() const; };
Methods¶
void addGyro(double t, const mrpt::math::TVector3D& w)
Integrates a gyroscope reading [rad/s] at sensor time t [s]. The rotation angle does not depend on the frame the readings are in.
const char* decide(const Scan& scan, const Budgets& budgets)
Returns nullptr if the scan can be skipped, or the reason why it has to be processed (“start”, “dropped_scan”, “bad_registration”, “max_skipped_scans”, “quality”, “time_gap”, “no_gyro”, “no_motion_model”, “distance” or “rotation”). In the latter case, the accumulated motion restarts.
void onScanDropped()
Makes the next decision process its scan: the last scan that passed was dropped before being registered.
void addRegistrationQuality(double t, double quality, const Budgets& budgets)
Records the quality of a registration done at sensor time t [s].
double gyroRotation() const
[rad] Rotation since the last processed scan, from the gyroscope.