yarp-devices
|
Implementation of a PVT buffer (cubic interpolation). More...
#include <InterpolatedPositionBuffer.hpp>
Public Member Functions | |
std::uint16_t | getBufferSize () const override |
Get PT/PVT buffer size. | |
std::int16_t | getSubMode () const override |
Generate interpolation submode register value (object 60C0h). | |
InterpolatedPositionBuffer (double samplingPeriod, double interpolationPeriod) | |
Constructor, sets internal invariable parameters. | |
Public Member Functions inherited from roboticslab::InterpolatedPositionBuffer | |
InterpolatedPositionBuffer (double samplingPeriod, double interpolationPeriod) | |
Constructor, sets internal invariable parameters. | |
virtual | ~InterpolatedPositionBuffer ()=default |
Virtual destructor. | |
void | setInitial (int initialTarget) |
Store initial position (internal units). | |
int | getPeriodMs () const |
Get PT/PVT period if fixed (synchronous), zero otherwise (asynchronous). | |
std::uint16_t | getBufferConfig () const |
Get buffer configuration (object 2074h). | |
void | addSetpoint (int target) |
Place a new setpoint (internal units) at the end of the queue. | |
std::vector< std::uint64_t > | popBatch (bool fullBuffer) |
Generate next batch of setpoints popped from the front of the queue. | |
int | getPrevTarget () const |
Retrieve last point loaded into the buffer (internal units). | |
bool | isQueueReady () const |
Report whether there are enough points in the queue to fill the buffer. | |
bool | isQueueEmpty () const |
Report whether there are no more points in the queue. | |
void | clearQueue () |
Clear internal queue. | |
Protected Member Functions | |
std::size_t | getOffset () const override |
Determine how many points should be left in the queue on each non-final batch update. | |
std::uint64_t | makeDataRecord (const ip_record &previous, const ip_record ¤t, const ip_record &next) override |
Generate interpolation data record given three contiguous position target (object 60C1h). | |
Protected Member Functions inherited from roboticslab::InterpolatedPositionBuffer | |
std::uint8_t | getIntegrityCounter () const |
Retrieve current integrity counter value. | |
std::uint16_t | getSampledTime (double currentTimestamp) |
Obtain time samples (internal units) for current segment, update internal counters. | |
double | getMeanVelocity (const ip_record &earliest, const ip_record &latest) const |
Compute mean velocity (internal units) between two setpoints. | |
Additional Inherited Members | |
Protected Types inherited from roboticslab::InterpolatedPositionBuffer | |
using | ip_record = std::pair< int, double > |
Protected Attributes inherited from roboticslab::InterpolatedPositionBuffer | |
const double | samplingPeriod |
By using the lasts two position targets, this class computes the mean velocity target required by the linear interpolator.