Class BufferedPva
Defined in File BufferedPva.hpp
Inheritance Relationships
Derived Types
public navtk::inertial::BufferedImu(Class BufferedImu)public navtk::inertial::BufferedIns(Class BufferedIns)
Class Documentation
Class that maintains a time history of and provides access to calculated PVAs.
It is not meant to be used directly but provides functionality for child classes to build off of.
Subclassed by navtk::inertial::BufferedImu, navtk::inertial::BufferedIns
Public Functions
Copy constructor.
Defaulted.
Copy assignment.
Defaulted.
- Returns
*this
Move constructor.
Defaulted.
Move assignment.
Defaulted.
- Returns
*this
Child classes will need to have an implementation-specific data class added periodically in order to increase the time span that this buffer covers.
This method provides a common interface to add data to child classes.
- Parameters
data – The data to add.
Get solution at time.
- Parameters
time – Requested solution time.
- Returns
Solution at time, or
nullptrif Time is not within the available history of solutions.
Get most recent solution.
- Throws
std::runtime_error – If this instance has been ‘moved’ from.
- Returns
Most recent solution stored.
Get available time range of solutions.
- Returns
Pair of times (
firstbeing the earlier time andsecondbeing the later` time) indicating the range of time over which PVA is available. If there is no history of solutions available, returned times will both equal std::numeric_limits<double>::lowest(). If only one PVA resides in the buffer, then both times returned will be the time of that PVA.
Get available time range of solutions in a 64-bit represented integer, nanoseconds.
- Returns
Pair of times (
firstbeing the earlier time andsecondbeing the later` time) indicating the range of time over which PVA is available. If there is no history of solutions available, returned times will both equal std::numeric_limits<double>::lowest(). If only one PVA resides in the buffer, then both times returned will be the time of that PVA.
Determines if a time is within the available history of solutions, which is a prerequisite for most operations.
- Parameters
t – Time to check.
- Returns
True if
tlies within the stored history of solutions. This return is invalidated by a call to mechanize().
Get the average specific force and inertial sensor frame rotation rate between two solutions close to the requested time.
- Parameters
time – Requested time of force and rate.
- Returns
If time is within the available history of solutions, the specific force in the NED frame, in m/s^2, and inertial sensor frame rotation rate in inertial sensor frame in rad/s. Otherwise, a
nullptr. This force and rate will be returned as anaspn_xtensor::MeasurementImuwith the imu type set to ASPN_MEASUREMENT_IMU_IMU_TYPE_SAMPLED. Iftimeis in between two solutions, then the force and rate will be calculated from the two bordering solutions. Otherwise, iftimematches a solution’s time, it uses the two neighboring PVAs to calculate the force and rate. If only one neighboring PVA exists, then the other one is interpolated from the matched PVA and the existing neighbor. If neither neighboring PVA exists, then a nullptr is returned.
Get average specific force and rotation rate between the solutions at two times.
- Parameters
time1 – Start time of range, inclusive.
time2 – Stop time of range, inclusive.
- Returns
Average specific force in the NED frame in m/s^2, and average inertial sensor frame rotation rate, in the inertial sensor frame in rad/s over the requested time range. This force and rate will be returned as an
aspn_xtensor::MeasurementImuwith the imu type set to ASPN_MEASUREMENT_IMU_IMU_TYPE_SAMPLED. The frames are approximations of the frames midway between time1 and time2. If either time1 or time2 are not within the available history of solutions, returns anullptr.
Protected Functions
Constructor.
- Parameters
pva – Time-tagged initial position, velocity and attitude
nullptrif unknown.expected_dt – The typical delta time between PVAs, in seconds.
buffer_length – Amount of data, in seconds, this class should keep in history. Max number of accessible buffer elements is
buffer_length/expected_dt + 2.
Constructor.
- Parameters
pva – Time-tagged initial position, velocity and attitude.
expected_dt – The typical delta time between PVAs, in seconds.
buffer_length – Amount of data, in seconds, this class should keep in history. Max number of accessible buffer elements is
buffer_length/expected_dt + 2.
Allows calc_pva access to the ‘extra’ value on the PVA buffer by not checking if in_range(), which normally excludes this value when the buffer is full.
This is useful for implementations which wrap an inertial since it enables proper repropagation from the first ‘time_span’ time in the case the underlying Inertial is using high-order mechanization methods that require a ‘prior’ PVA when resetting, such as Simpsons.
- Parameters
time – Requested solution time.
- Returns
Solution at time, or
nullptrif Time is not within the available history of solutions.
Protected Attributes
Buffers solution history, with resets.
In other words, this is a sorted container where the earlier times are in the front and the later times are in the back.