Aria  2.7.5.2
ArInterpolation Class Reference

#include <ArInterpolation.h>

Public Member Functions

bool addReading (ArTime timeOfReading, ArPose position)
 Adds a new reading.
 
 ArInterpolation (size_t numberOfReadings=100)
 Constructor.
 
size_t getNumberOfReadings (void) const
 Gets the number of readings this instance holds back in time.
 
int getPose (ArTime timeStamp, ArPose *position)
 Finds a position. More...
 
void reset (void)
 Empties the interpolated positions.
 
void setNumberOfReadings (size_t numberOfReadings)
 Sets the number of readings this instance holds back in time.
 
virtual ~ArInterpolation ()
 Destructor.
 

Protected Attributes

ArMutex myDataMutex
 
std::list< ArPosemyPoses
 
size_t mySize
 
std::list< ArTimemyTimes
 

Detailed Description

This class takes care of storing in readings of position vs time, and then interpolating between them to find where the robot was at a particular point in time. It has two lists, one containing the times, and one containing the positions at those same times (per position), they must be walked through jointly to maintain cohesion. The new entries are at the front of the list, while the old ones are at the back. numberOfReadings and the setNumberOfReadings control the number of entries in the list. If a size is set that is smaller than the current size, then the old ones are chopped off.

Member Function Documentation

int ArInterpolation::getPose ( ArTime  timeStamp,
ArPose position 
)

Finds a position.

Parameters
timeStampthe time we are interested in
positionthe pose to set to the given position
Returns
1 its good interpolation, 0 its predicting, -1 its too far to predict, -2 its too old, -3 there's not enough data to predict

The documentation for this class was generated from the following files: