struct mola::GravityLeveler::Parameters

Overview

#include <GravityLeveler.h>

struct Parameters
{
    // fields

    double window = 10.0;
    double epoch_period = 1.0;
    double tilt_random_walk = 0.1;
    double reading_sigma = 0.15;
    double deadband = 2.0;
    double up_reading_deadband = 0.0;
    double up_reading_random_walk = 0.3;
    double up_reading_hold = 30.0;
    double up_reading_ramp = 30.0;
    double up_reading_sigma_floor = 0.1;
    double up_reading_place_radius = 5.0;
    double up_reading_place_max_dz = 1.5;
    double revisit_radius = 0.0;
    double revisit_fade = 5.0;
    double up_reading_warmup = 0.0;
    double max_tilt = 5.0;
    double max_up_tilt = 15.0;
    bool max_up_tilt_needs_accelerometer = true;
    double initial_tilt_sigma = 3.0;
    double initial_acc_error_sigma = 0.3;
    double velocity_span = 1.0;
    std::size_t min_readings_per_window = 10;
    double max_imu_gap = 0.5;
    std::size_t max_consecutive_rejections = 5;
    double gravity = 9.81;
};

Fields

double window = 10.0

Trailing window of the gravity reading [s]

double epoch_period = 1.0

Period between filter updates [s]

double tilt_random_walk = 0.1

Random walk of the frame tilt [deg/sqrt(s)]

double reading_sigma = 0.15

Noise of each tilt reading [deg]

double deadband = 2.0

Tilt left uncorrected [deg]

double up_reading_deadband = 0.0

Tilt left uncorrected while up readings are recent [deg]. 0: their own covariance already weighs them, a deadband only biases.

double up_reading_random_walk = 0.3

Random walk of the frame tilt while up readings are recent: precise readings let the filter follow a faster wander [deg/sqrt(s)]

double up_reading_hold = 30.0

An up reading keeps up_reading_deadband in force this long [s]

double up_reading_ramp = 30.0

After the hold, time for the deadband to grow back to deadband [s]

double up_reading_sigma_floor = 0.1

Added in quadrature to the sigmas of each up reading [deg], > 0

double up_reading_place_radius = 5.0

A pose within this horizontal distance [m] of accepted up readings that came with their place, and on the same floor (see up_reading_place_max_dz), is leveled with them, 0: by time only. Their mean is weighted by their covariance and by a Gaussian of the horizontal distance (sigma = radius/2, lowered to zero at the radius), with up_reading_deadband. Where those Gaussians sum to less than 0.5 (1 is a reading right at the pose), the mean and that deadband are blended in proportion with the filter’s state and its deadband, so the correction fades into the state toward the edge of the readings instead of jumping at the radius. While poses are leveled by place alone, up_reading_deadband stays in force as if a reading had just been accepted (see up_reading_hold).

double up_reading_place_max_dz = 1.5

Readings more than this above or below a pose [m] are another place: another floor of the map carries its own tilt error. A ramp of 10 % rises 0.5 m within the radius. > 0

double revisit_radius = 0.0

Corrections consistent by place: a pose within this horizontal distance [m] of the first visit of a place (on the same floor, and more than 2 revisit_fade of path ago) takes that visit’s output offset (output minus input position) and applied tilt, a Gaussian mean with sigma = this, instead of the offset integrated along the path and the current tilt. Integrated, the two visits of a place are split by the integral of the correction in between (a floor drawn twice). The weight of the first visit falls linearly to zero at revisit_fade, in height from up_reading_place_max_dz /2 to up_reading_place_max_dz, and with the path since it (from 2 to 4 revisit_fade), and the output moves toward it in proportion: a revisit is taken up gradually over the approach. 0 (default): off, positions are integrated along the path only.

double revisit_fade = 5.0

See revisit_radius [m], > revisit_radius

double up_reading_warmup = 0.0

Up readings in the first seconds after the first pose are ignored. Where the trajectory starts level (initialized from the accelerometer), the readings of its first places can only add their own error, and a height step taken early is never recovered. Where it starts tilted, ignoring them leaves that tilt in for this long, so 0 by default [s]

double max_tilt = 5.0

Accelerometer readings beyond this tilt are ignored: they mean a failing attitude of the trajectory, not a tilt of its frame [deg]

double max_up_tilt = 15.0

Up readings beyond this tilt are ignored [deg], in (0, 90). They are measured on the structure, so they can read a frame tilted beyond max_tilt, but see max_up_tilt_needs_accelerometer.

bool max_up_tilt_needs_accelerometer = true

If true, up readings beyond max_tilt are taken (up to max_up_tilt) only while the latest accelerometer reading also sees the frame beyond max_tilt (with gravity of a plausible magnitude, pointing up). Before that, and without an accelerometer, they are held to max_tilt : a frame the accelerometer sees nearly level is not tilted by 10 deg, and such a reading comes from structure that is not plumb or level (rock faces, slopes). Set it to false to take them up to max_up_tilt with no accelerometer.

double initial_tilt_sigma = 3.0

Prior sigma of the initial tilt [deg], > 0

double initial_acc_error_sigma = 0.3

Prior sigma of the body-frame accelerometer error [m/s^2]

double velocity_span = 1.0

Time span for the trajectory’s own velocity [s]

std::size_t min_readings_per_window = 10

Minimum number of IMU readings in a window to take a reading

double max_imu_gap = 0.5

Longest time without IMU readings within a window to take a reading [s]

std::size_t max_consecutive_rejections = 5

Consecutive gated readings after which the filter restarts

double gravity = 9.81

Standard gravity [m/s^2]