Class AlignBase

Inheritance Relationships

Derived Types

Class Documentation

class AlignBase

Base class for IMU alignment algorithms.

Subclassed by navtk::inertial::CoarseDynamicAlignment, navtk::inertial::ManualAlignment, navtk::inertial::StaticAlignment

Public Types

enum class AlignmentStatus

The possible states of the return value of get_computed_alignment().

Values:

enumerator ALIGNING_COARSE

We are attempting to align the inertial.

The requires_dynamic() function should be checked to determine if the aligning algorithm requires movement to align.

enumerator ALIGNING_FINE

A coarse alignment has been calculated, and the alignment is being tested and/or adjusted before setting the inertial.

enumerator ALIGNED_GOOD

We have a good INS alignment which can be used to initialize an inertial class and INS error state block.

enum class CovarianceFormat

Supported filtering::StateBlock types for returned covariance size/units.

Values:

enumerator PINSON15NEDBLOCK

Position, velocity, attitude and sensor biases.

See navtk::filtering::Pinson15NedBlock.

enumerator PINSON21NEDBLOCK

Position, velocity, attitude, sensor biases and scale factors.

See navtk::filtering::Pinson21NedBlock.

Public Functions

virtual ~AlignBase() = default
AlignBase(bool supports_static, bool supports_dynamic, const filtering::ImuModel &model = filtering::stim300_model())

Base constructor which sets supports_static and supports_dynamic

Parameters
  • supports_static – Indicates the alignment algorithm supports static data

  • supports_dynamic – Indicates the alignment algorithm supports dynamic data

  • model – Model for IMU measurements used in alignment, typically used in calculating covariance of alignment solution.

AlignBase(const AlignBase &other) = default

Copy constructor for AlignBase.

Performs a shallow copy of other except for computed_alignment which is deep copied.

Parameters

otherAlignBase object to copy.

AlignBase(AlignBase &&other) = default

Default move constructor for AlignBase.

Parameters

otherAlignBase object to move.

AlignBase &operator=(const AlignBase &other) = default

Copy assignment operator for AlignBase.

Performs a shallow copy of other except for computed_alignment which is deep copied.

Parameters

otherAlignBase object to copy.

Returns

Copy of other .

AlignBase &operator=(AlignBase &&other) = default

Default move assignment operator for AlignBase.

Parameters

otherAlignBase object to move.

Returns

Reference to the moved other .

virtual AlignmentStatus process(std::shared_ptr<aspn_xtensor::AspnBase> message) = 0

Supply new data to alignment estimation algorithm.

Behavior may vary based on current alignment_status.

Parameters

message – Pointer to aspn_xtensor::AspnBase.

Returns

Current alignment status following message processing.

bool requires_dynamic()

Allows caller to determine if alignment requires movement.

Throws

std::runtime_error – if class has not been flagged for supporting static or dynamic and the error mode is ErrorMode::DIE.

Returns

true if movement required for alignment.

AlignmentStatus check_alignment_status()

Determine the current alignment status.

Returns

Current alignment status.

virtual std::pair<bool, filtering::NavSolution> get_computed_alignment() const

Get the computed alignment if one has been calculated.

Returns

A pair with a bool representing validity of the attached solution, along with a copy of the computed alignment if one has been calculated.

virtual std::pair<bool, Matrix> get_computed_covariance(const CovarianceFormat format = CovarianceFormat::PINSON15NEDBLOCK) const

Get the computed position, velocity and attitude covariance matrix if one has been calculated.

Parameters

format – Format for the covariance block. Covariance, if able to be generated, will be of the correct size and units for the requested block type.

Returns

A pair with a bool representing validity of the attached matrix, and an NxN covariance matrix where N is the number of states requested in format.

virtual std::pair<bool, ImuErrors> get_imu_errors() const

Get any estimated inertial sensor errors.

Returns

A pair with a bool representing validity of the attached ImuErrors, and the current estimates of the IMU errors.

virtual MotionNeeded motion_needed() const = 0
Returns

Indicates whether the alignment strategy requires stationary data, motion, or doesn’t care.

Protected Functions

Matrix bias_stats_from_model(const CovarianceFormat format = CovarianceFormat::PINSON15NEDBLOCK) const

Extract the initial bias covariance etc.from model and generate a covariance block.

Does not include PVA terms (cov block will just be sensor errors, for example CovarianceFormat::PINSON15NEDBLOCK format will be 6x6)

Parameters

format – Partial covariance type to return.

Returns

Covariance, initialized from model.

Protected Attributes

AlignmentStatus alignment_status = AlignmentStatus::ALIGNING_COARSE

Current alignment status.

std::pair<bool, filtering::NavSolution> computed_alignment

Current available alignment.

std::vector<aspn_xtensor::MeasurementImu> align_buffer

Buffer for IMU data.

std::vector<aspn_xtensor::MeasurementPosition> gps_buffer

Buffer for position data.

bool supports_static

Flag indicating the alignment algorithm supports static data.

bool supports_dynamic

Flag indicating the alignment algorithm supports dynamic data.

filtering::ImuModel model

IMU model for incoming measurements.