Class StaticAlignment
Defined in File StaticAlignment.hpp
Inheritance Relationships
Base Type
public navtk::inertial::AlignBase(Class AlignBase)
Derived Types
public navtk::inertial::ManualHeadingAlignment(Class ManualHeadingAlignment)public navtk::inertial::StaticWahbaAlignment(Class StaticWahbaAlignment)
Class Documentation
Class implementing a gyrocompassed static alignment.
In general, the goal of this class is to produce an inertial alignment that it transmits to the inertial instance, returning what the status of the alignment is to the message sender.
To enable an alignment calculation, all provided measurements should be from a stationary vehicle, IMU measurements must span a user-specified length of time, and at least one MeasurementPosition measurement must be provided. Imu data (specifically gyro measurements) must generally be navigation-grade or higher; low sensitivity or highly-biased gyros will produce a poor result.
Subclassed by navtk::inertial::ManualHeadingAlignment, navtk::inertial::StaticWahbaAlignment
Public Functions
Constructor.
- Parameters
model – The model of the inertial being aligned. Used in approximating the uncertainty of the orientation in the alignment solution.
align_time – The amount of IMU data that must be collected before calculating an alignment, in seconds. Once this threshold has been reached an alignment and covariance are calculated and status will change to AlignmentStatus::ALIGNED_GOOD.
vel_cov – Initial covariance to attach to the stationary NED velocity.
Add a measurement to be used in the alignment.
- Parameters
message – Measurement to use. Currently, only aspn_xtensor::MeasurementPosition and aspn_xtensor::MeasurementImu are recognized. All others will be ignored. Measurements provided after status has changed to AlignmentStatus::ALIGNED_GOOD are discarded and a warning logged; the alignment will not incorporate new information.
- Returns
Status of alignment after incorporating the input.
Get the covariance associated with the computed alignment.
- Parameters
format – Format for the covariance block.
- Returns
A pair consisting of a boolean indicating usability of covariance, and the covariance itself. If no alignment has been computed (status != AlignmentStatus::ALIGNED_GOOD), then the bool is false and the covariance invalid. Otherwise the bool is true and the covariance is a block diagonal 9x9 Matrix of position covariance (m^2 NED), velocity covariance (m^2/s^2, NED), and tilt covariance (rad^2, NED). The position covariance is the covariance of all provided MeasurementPosition measurements, or in the case of only a single measurement being available, a copy of that measurements’ covariance field. Velocity covariance is fixed at 1e-4. The tilt covariance is a first-order approximation assuming only zero-mean constant biases on the IMU measurements based on the supplied ImuModel. Cross-terms between blocks are all 0.
- Returns
Indicates whether the alignment strategy requires stationary data, motion, or doesn’t care.
Protected Functions
Do the actual alignment algorithm once sufficient data is available.
- Parameters
imu_time – Latest received IMU time, to be affixed to the generated solution.
Calculate the mean and cov of all entries in gps_buffer.
- Returns
Mean pos (llh in rad, rad, m) and cov (in m^2 NED).
Averages measurements in align_buffer and returns avg dv and dth.
It does not account for dt and therefore assumes constant rate of IMU data.
- Returns
Average delta velocity (m/s) and delta theta (rad) from buffered measurements.
- Returns
The average delta time between measurements in the alignment buffer, in seconds.
Protected Attributes
Minimum time in seconds for recording of sensor inputs before alignment is attempted.