Class BufferedImu
Defined in File BufferedImu.hpp
Inheritance Relationships
Base Type
public navtk::inertial::BufferedPva(Class BufferedPva)
Class Documentation
Class that wraps Inertial and maintains a time history of and provides access to calculated PVAs, processed measurements and other values of interest.
Public Functions
Constructor with initial PVA.
- Parameters
pva – Time-tagged initial position, velocity and attitude. Attitude in PVA should be w.r.t. frame of IMU measurements to be mechanized.
initial_imu – IMU measurement measured over the expected_dt period prior to PVA measurement time;
nullptrif unknown. Failure to provide an appropriate value will result in possibly inaccurate IMU-based values (specific forces, rotation rates) being returned from their respective functions over the first mechanization period.expected_dt – The typical delta time over which an IMU measurement is measured, in seconds.
imu_errs – Initial values of IMU error parameters. Time of validity is assumed to be the same as that of
pva.mech_options – Options for underlying mechanization process.
buffer_length – Amount of data, in seconds, this class should keep in history. Max number of accessible buffer elements is
buffer_length/expected_dt + 2.
Reset some combination of inertial PVA and IMU error model to new values, and recalculate the trajectory from that point.
Reset time ‘t’ is taken to be
pva->time_validityif provided, otherwiseimu_errs->time_validity. All historical data prior to ‘t’ contained in buffers will be untouched; all data equal to and after ‘t’ will be overwritten.- Parameters
pva – Time-tagged position, velocity and attitude. Must be within the range of times contained in the buffered PVA history (i.e.
in_range(pva->time_validity) is true). Ifnullptr, onlyimu_errswill be considered for reset.imu_errs – Estimated IMU errors at reset time. If both
imu_errsandpvaare valid pointers but have differenttime_validityfields,imu_errswill be assumed valid at the same time aspva. Ifnullptr, no changes to the error model will be made.previous – Time-tagged position, velocity and attitude, at 1
dtearlier thanpva. Useful for some higher-order integration algorithms that rely on multiple data points, such as trapezoidal. If not provided (nullptr),pvawill be used instead; the resulting error should be minimal, especially for low-dynamic situations. This value is only used in mechanization and will not be inserted into the time history of solutions.
- Returns
trueif position was reset to requested PVA, false if the reset was rejected.
Get solution at time, with the guarantee that there have been no resets since requested time.
This is accomplished by repropagating IMU data from
sincetotime, ignoring any resets that were performed in the interim. If a clean repropagation is not possible, anullptris returned.- Parameters
time – Requested solution time.
since – Time after which no resets should be present in the solution. Resets at exactly
sincewill be included.
- Returns
Solution at time, or nullptr if requested time doesn’t lie in time_span().
Propagate the current inertial solution by integrating the supplied IMU measurement.
- Parameters
data – IMU measurement to mechanize; only accepts data of the type aspn_xtensor::MeasurementImu. IMU must be of ASPN_MEASUREMENT_IMU_IMU_TYPE_INTEGRATED type. IMU data with a delta time between measurements that varies by 50% or more from the average delta will generate a warning. To account for the possibility that this class may have been initialized ‘between’ IMU measurements, the input to the first call of this function may be scaled accordingly.
- Throws
If – error mode is DIE and
datais a type other than aspn_xtensor::MeasurementImu, or if a type other than ASPN_MEASUREMENT_IMU_IMU_TYPE_INTEGRATED is received.
Propagate the current inertial solution by integrating the supplied IMU measurement.
- Parameters
imu – IMU measurement to mechanize. IMU must be of ASPN_MEASUREMENT_IMU_IMU_TYPE_INTEGRATED type. IMU data with a delta time between measurements that varies by 50% or more from the average delta will generate a warning. To account for the possibility that this class may have been initialized ‘between’ IMU measurements, the input to the first call of this function may be scaled accordingly.
- Throws
std::invalid_argument – If error mode is DIE and a type other than ASPN_MEASUREMENT_IMU_IMU_TYPE_INTEGRATED is received.
Propagate the current inertial solution by integrating the supplied IMU measurement.
- Parameters
imu – IMU measurement to mechanize. IMU must be of ASPN_MEASUREMENT_IMU_IMU_TYPE_INTEGRATED type. IMU data with a delta time between measurements that varies by 50% or more from the average delta will generate a warning. To account for the possibility that this class may have been initialized ‘between’ IMU measurements, the input to the first call of this function may be scaled accordingly.
- Throws
std::invalid_argument – If error mode is DIE and a type other than ASPN_MEASUREMENT_IMU_IMU_TYPE_INTEGRATED is received.
Propagate the current inertial solution by integrating the supplied IMU measurement.
- Parameters
time – IMU measurement time of validity.
delta_v – Delta velocity measurement in inertial sensor frame, m/s.
delta_theta – Delta rotation measurement in inertial sensor frame, rad.
Get specific force and inertial sensor frame rotation rate at requested time.
- Parameters
time – Requested time of force and rate.
- Returns
If time is within the available history of solutions, the specific force in the NED frame, in m/s^2, and inertial sensor frame rotation rate in inertial sensor frame in rad/s calculated from the single IMU measurement that spans time. Otherwise, a nullptr. This force and rate will be returned as an
aspn_xtensor::MeasurementImuwith the imu type set to ASPN_MEASUREMENT_IMU_IMU_TYPE_SAMPLED.
Get average specific force and rotation rate over a range of times.
- Parameters
time1 – Start time of range, inclusive.
time2 – Stop time of range, inclusive.
- Returns
Average specific force in the NED frame in m/s^2, and average inertial sensor frame rotation rate, in the inertial sensor frame in rad/s over the requested time range. This force and rate will be returned as an
aspn_xtensor::MeasurementImuwith the imu type set to ASPN_MEASUREMENT_IMU_IMU_TYPE_SAMPLED. The frames are approximations of the frames midway betweentime1andtime2. If bothtime1andtime2occurred within the same mechanization period, then result is same ascalc_force_and_rate_rate(time2). If eithertime1ortime2are not within the available history of solutions, returns anullptr.
Error params at time.
- Parameters
t – Time of request.
- Returns
Bias and scale factor values for accel and gyro supplied during the last reset prior to
t, if available. If there is no such record, returns the IMU error parameter record nearest tot. If never explicitly provided via a reset, the return value will be the ImuErrors provided at construction of this instance.