Class Inertial

Class Documentation

class Inertial

Provides an inertial mechanization capability with stored state and the ability to reset the position, velocity and attitude data in various formats or applying measurement error corrections.

The class currently supports two methods of mechanization, each drawn from different text sources. Additionally, each of these mechanization algorithms has a ‘native’ format of position, velocity and attitude (PVA) data. We commonly use shorthands taken from author names to refer to either algorithms or the common navigation quantity groupings that appear in their books.

The first group describes position as latitude, longitude and altitude in radians, radians and meters with respect to the WGS84 ellipsoid; velocity is in \(\frac{m}{s}\) in the North, East and Down frame; and attitude is represented as the sensor to NED frame DCM. This grouping is associated with the mechanization_standard function and StandardPosVelAtt class. We refer to this set of algorithms/navigation quantities as ‘Titterton’-style, ‘TW’-style, or occasionally ‘LLH NED’, in reference to ‘Strapdown Inertial Navigation Technology, 2nd Edition’ by D.H. Titterton and J.L. Weston.

The second grouping consists of slightly more complicated quantities- a DCM that encodes latitude, longitude and a wander azimuth angle; a separate altitude value; velocity in the ‘n’ frame (which is like an ENU frame that rotates with the wander angle as opposed to being pegged to North/East); and attitude as a DCM that rotates from the sensor frame to the ‘l’ frame (which is related to the ‘n’ frame as the NED frame is related to ENU). This grouping is associated with the mechanization_wander function and WanderPosVelAtt class. We refer to this set of algorithms/navigation quantities as ‘Savage’-style or sometimes ‘wander frame’, after Strapdown Analytics by Paul G. Savage.

It is highly recommended that you interact with this class using formats that ‘match’ the mechanization function supplied through the constructor.

Public Functions

explicit Inertial(const not_null<std::shared_ptr<InertialPosVelAtt>> start_pva = std::make_shared<StandardPosVelAtt>(), const MechanizationOptions &mech_options = MechanizationOptions{}, MechanizationFunction mech_fun = static_cast<not_null<std::shared_ptr<InertialPosVelAtt>> (*)(const Vector3&, const Vector3&, const double, const not_null<std::shared_ptr<InertialPosVelAtt>>, const not_null<std::shared_ptr<InertialPosVelAtt>>, const MechanizationOptions&, AidingAltData *aiding_alt_data)>(mechanization_standard))

Constructor.

Parameters
  • start_pva – Initial PVA of this inertial. Defaults to whatever the StandardPosVelAtt default constructor generates. If starting PVA is unknown at the time of creation, update it via one of the reset functions prior to mechanizing.

  • mech_options – Collection of options to pass into the mechanization function.

  • mech_fun – Function used to perform the actual mechanization. Must accept delta velocity( \(\frac{m}{s}\)), delta rotation (rad), delta time, position, velocity and attitude data at beginning of mechanization, and a MechanizationOptions instance.

explicit Inertial(not_null<std::shared_ptr<Mechanization>> mech_class, const not_null<std::shared_ptr<InertialPosVelAtt>> start_pva = std::make_shared<StandardPosVelAtt>(), const MechanizationOptions &mech_options = MechanizationOptions{})

Constructor.

Parameters
  • mech_class – Pointer to a Mechanization instance that will be used to perform the actual mechanization.

  • start_pva – Initial PVA of this inertial. Defaults to whatever the StandardPosVelAtt default constructor generates. If starting PVA is unknown at the time of creation, update it via one of the reset functions prior to mechanizing.

  • mech_options – Collection of options to pass into the mechanization function.

Inertial(const Inertial &ins)

Custom deep-copy constructor.

Parameters

ins – The Inertial to copy. Pointers held by ins are deep-copied.

Inertial &operator=(const Inertial &ins)

Copy assignment.

Parameters

ins – The Inertial to assign. Pointers held by ins are deep-copied when assigned.

Returns

*this populated with copies of ins members.

Inertial(Inertial&&) = default

Default move constructor.

Inertial &operator=(Inertial&&) = default

Default move assign.

Returns

*this.

~Inertial() noexcept = default
void reset(const not_null<std::shared_ptr<InertialPosVelAtt>> new_pva, const std::shared_ptr<InertialPosVelAtt> old_pva = nullptr)

Reset the inertial solution to a new value.

Parameters
  • new_pva – Position, velocity attitude and time data to set this inertial to.

  • old_pva – Solution one dt prior to new_pva. Needed for some higher-order acceleration integration strategies. If not provided defaults to the same as new_pva.

void reset(StandardPosVelAtt new_pva)

Reset the inertial solution to a new value.

Parameters

new_pva – Position, velocity attitude and time data to set this inertial to.

void reset(WanderPosVelAtt new_pva)

Reset the inertial solution to a new value.

Parameters

new_pva – Position, velocity attitude and time data to set this inertial to.

not_null<std::shared_ptr<InertialPosVelAtt>> get_solution() const

Obtains the current inertial solution, which is the result of the last mechanization (or the initial values if at the start).

Returns

Current solution.

Vector3 get_gyro_biases() const

Returns vector of current set of internally-stored gyro bias values, which are used to correct all incoming gyro measurements.

Returns

Vector3 of biases for each gyro ( \( \frac{rad}{s} \)), in the inertial sensor frame.

void set_gyro_biases(Vector3 gyro_biases)

Sets internally-stored gyro bias values, which are used to correct all incoming gyro measurements.

Parameters

gyro_biases – Vector3 of biases for each gyro axis \( (\frac{rad}{s}) \), in the inertial sensor frame such that \( gyro_{meas} = gyro_{true} + gyro_{bias} \) in the absence of other errors.

Vector3 get_gyro_scale_factors() const

Returns vector of current set of internally-stored gyro scale factor values, which are used to correct all incoming gyro measurements.

Returns

Vector3 of scale factors for each gyro axis (unitless), in the inertial sensor frame.

void set_gyro_scale_factors(Vector3 gyro_scale_factors)

Sets internally-stored gyro scale factor values, which are used to correct all incoming gyro measurements.

Parameters

gyro_scale_factors – Vector3 of scale factors for each gyro axis (unitless), in the inertial sensor frame such that \( gyro_{meas} = (1 + gyro_{scale})gyro_{true} \) in the absence of other errors.

Vector3 get_accel_biases() const

Returns vector of current set of internally-stored accel bias values, which are used to correct all incoming accel measurements.

Returns

Vector3 of biases for each accel axis (m/sec^2), in the inertial sensor frame.

void set_accel_biases(Vector3 accel_biases)

Sets internally-stored accel bias values, which are used to correct all incoming accel measurements.

Parameters

accel_biases – Vector3 of biases for each accel axis in the inertial sensor frame, (m/sec^2), such that \( accel_{meas} = accel_{true} + accel_{bias} \) in the absence of other errors..

Vector3 get_accel_scale_factors() const

Returns vector of current set of internally-stored accel scale factor values, which are used to correct all incoming accel measurements.

Returns

Vector3 of scale factors for each accel axis, in the inertial sensor frame (unitless).

void set_accel_scale_factors(Vector3 accel_scale_factors)

Sets internally-stored accel scale factor values, which are used to correct all incoming accel measurements.

Parameters

accel_scale_factors – Vector3 of scale factors for each accel axis in the inertial sensor frame (unitless), such that \( accel_{meas} = (1 + accel_{scale})accel_{true} \) in the absence of other errors.

void set_imu_errors(const ImuErrors &errors)

Supply all inertial sensor error corrections.

Parameters

errors – Biases, scale factors, etc.used to correct the raw inertial measurements.

void mechanize(const aspn_xtensor::TypeTimestamp &time, const Vector3 &accel_meas, const Vector3 &gyro_meas, AidingAltData *aiding_alt_data = nullptr)

Integrate inertial sensor measurements to obtain an updated PVA solution.

Parameters
  • time – Time to integrate to; i.e. the end time of the measurement integration period for accel_meas and gyro_meas.

  • accel_meas – Vector3 of accelerometer measurements in the inertial sensor frame.

  • gyro_meas – Vector3 of gyro measurements in the inertial sensor frame.

  • aiding_alt_dataAidingAltData container storing the aiding altitude measurement and required parameters for using altitude aiding during mechanization.

Public Members

double integrated_alt_error

The cumulative error resulting from aiding the mechanization with an altitude measurement.