Class DynData
Defined in File DynData.hpp
Class Documentation
A container that calculates a number of derived values (velocities, forces) covering a short time history of position and IMU data.
Public Types
DynData contains the three most recently received positions.
This enum allows selection of these positions.
Values:
The position corresponding to the current position in time.
The position one time step in the past.
The position two time steps in the past.
Public Functions
Constructor.
- Parameters
origin – Position of the origin of the NED frame in which all local-level values will be referenced.
Indicates if the user has provided enough data that forces can theoretically be calculated.
- Returns
trueif update() has been called at least twice;falseotherwise.
Update the time history of measurements and derived values.
- Parameters
new_pos – The latest position measurement. Assumed to have occurred after the position provided to the last call of this function (or class instantiation).
align_buffer – A time sorted collection of all IMU measurements that occurred between the last call to this function and the time of validity of
new_pos. If a significant number of IMU measurements are missing (a more than 5% deviation between the average delta time between measurements and the expected dt based on the number of measurements received) or the number of IMU measurements is less than 2, then this measurement period will be considered invalid. It is assumed that all imu measurements inalign_bufferare of type ASPN_MEASUREMENT_IMU_IMU_TYPE_INTEGRATED.
Get the estimated average specific force from IMU data.
- Returns
A pair where
.firstis the validity of the force, and.secondis the 3-D force, valid at the ‘mid time’; that is the same time of validity returned by get_vel_mid(). Validity will be false if not enough_data().
Get the estimated average specific force from position data.
- Returns
The 3-D force, valid at the ‘mid time’; that is the same time of validity returned by get_vel_mid().
Get the estimated velocity at the ‘midpoint’ position time.
- Returns
A pair containing the time of validity and the NED velocity in m/s. The velocity is calculated from double differencing of the positions returned by get_positions(), and corresponds to the middle element of that vector. Will not be valid if enough_data() returns false.
Get the last 3 positions received.
- Returns
A 3-length vector that contains the last 3 positions received, oldest first. This vector is initially filled with copies of the origin (as returned by get_origin()); each call to update() will ‘push down’ the stack, removing the previous oldest element.
Get one of the most recent positions.
- Parameters
recency – RecentPositionsEnum.
- Returns
The chosen position.
The origin of the local frame (as passed to the constructor).
- Returns
The position of the frame origin.
Get the radians to meters conversion factors for the local frame defined by the position returned by get_origin().
- Returns
A pair containing a) the multiplier that converts a delta latitude (in radians) to meters in local north, and b) the multiplier that converts a delta longitude (in radians) to meters in local east.