Class ManualAlignment
Defined in File ManualAlignment.hpp
Inheritance Relationships
Base Type
public navtk::inertial::AlignBase(Class AlignBase)
Class Documentation
Generates an alignment using some mix of upfront user-provided information and ‘live’ sensor data.
The solution is initialized with the user-provided PVA solution. If additional sensor data is supplied it will be used to update appropriate fields. Solution times are tagged with the latest IMU
time_validityif IMU data have been supplied, allowing for a seamless redirection of the IMU data stream from the alignment to the aligned inertial class. If only other data types are supplied for the alignment, the time from these measurements are used to tag the generated solution. This may cause an inaccurate mechanization period/dt when the first IMU measurement is supplied to the mechanizing class; to avoid errors the user should adjust the solution time to accurately reflect the IMU measurement period.No interpolation between or sorting of sensor measurements is performed.
Public Functions
Provide an initial alignment solution and choose AlignBase::AlignmentStatus::ALIGNED_GOOD trigger conditions.
If all of the above bool params are
false(the default), this class is immediately placed in an AlignBase::AlignmentStatus::ALIGNED_GOOD state withpvaas the available solution. Otherwise status remains AlignBase::AlignmentStatus::ALIGNING_COARSE until selected conditions are met.- Parameters
pva – Default PVA and covariance. Must be in ASPN_MEASUREMENT_POSITION_REFERENCE_FRAME_GEODETIC reference frame.
wait_for_time – When true, require that at least one IMU measurement be received (thus tagging the alignment solution with IMU time) before switching to AlignBase::AlignmentStatus::ALIGNED_GOOD.
wait_for_pos – When true, require that at least one position measurement be received (thus updating the position of
pva) before switching to AlignBase::AlignmentStatus::ALIGNED_GOOD.wait_for_vel – When true, require that at least one velocity measurement be received (thus updating the velocity of
pva) before switching to AlignBase::AlignmentStatus::ALIGNED_GOOD.wait_for_att – When true, require that at least one attitude measurement be received (thus updating the attitude of
pva) before switching to AlignBase::AlignmentStatus::ALIGNED_GOOD.model – Model for IMU measurements used in alignment, typically used in calculating covariance of alignment solution.
- Throws
std::runtime_error – If ErrorMode::DIE, an invalid
pvafield is supplied and the corresponding ‘wait_for’ flag is set to false.std::invalid_argument – If ErrorMode::DIE and covariance shape of
pvadoes not match the number of valid data elements in the message.std::invalid_argument – If the
pvareference frame is not ASPN_MEASUREMENT_POSITION_REFERENCE_FRAME_GEODETIC.
Update the alignment solution with various measurements by copying the relevant fields into the PVA solution.
Generally speaking, the following holds for all inputs:
Measurements are only considered valid if all values representing a 3 dimensional measurement are valid. For example, if a aspn_xtensor::MeasurementPosition returns NAN for get_p2(), the entire measurement is rejected.
It is acceptable for ‘grouped’ messages such as aspn_xtensor::MeasurementPositionVelocityAttitude to have ‘partial validity’, for example an invalid position but valid velocity and attitude. In such a case the velocity and attitude will be used for alignment and the position ignored.
Measurements are considered invalid if their covariance matrix cannot be interpreted to support the available data.
A valid position of any supported type must be provided before non-position ECEF-frame data can be interpreted for alignment. ECEF frame data delivered before a valid position has been provided is ignored.
For all messages, warnings are generated if an unsupported reference frame is supplied and the data is ignored.
- Parameters
message –
Data to align with. Supported data types and effects are:
aspn_xtensor::MeasurementImu : Update the solution time and stops any other sensor time from being used.
aspn_xtensor::MeasurementPosition : Update position and position covariance. Updates time only if no IMU data has been received. Only ASPN_MEASUREMENT_POSITION_REFERENCE_FRAME_GEODETIC reference frame supported.
aspn_xtensor::MeasurementVelocity : Update velocity and velocity covariance. Updates time only if no IMU data has been received. Only ASPN_MEASUREMENT_VELOCITY_REFERENCE_FRAME_NED and ASPN_MEASUREMENT_VELOCITY_REFERENCE_FRAME_ECEF frames are supported.
aspn_xtensor::MeasurementAttitude3D : Update attitude and attitude covariance. Updates time only if no IMU data has been received. Only ASPN_MEASUREMENT_ATTITUDE_3D_REFERENCE_FRAME_NED and ASPN_MEASUREMENT_ATTITUDE_3D_REFERENCE_FRAME_ECEF are supported.
aspn_xtensor::MeasurementPositionVelocityAttitude : Replaces the entire solution, including covariance, depending on what data elements are considered valid. Updates time only if no IMU data has been received. Only ASPN_MEASUREMENT_POSITION_VELOCITY_ATTITUDE_REFERENCE_FRAME_GEODETIC reference frame is supported.
- Returns
Current alignment status.
- Throws
std::runtime_error – If ErrorMode::DIE and message is an unsupported data type.
std::invalid_argument – If ErrorMode::DIE and covariance shape does not match the number of valid data elements in the message.
Covariance of solution.
Baseline is what the user provided at construction on the MeasurementPositionVelocityAttitude parameter; individual diagonal blocks (position, velocity, attitude) may be updated depending on the rest of the settings and what data has been received. See the constructor and process(std::shared_ptr<aspn_xtensor::AspnBase>) function documentation for details.
- Parameters
format – Format for the covariance block.
- Returns
A pair containing a bool describing the validity of the covariance, and the current covariance matrix.
- Returns
Indicates whether the alignment strategy requires stationary data, motion, or doesn’t care.