Fawkes API  Fawkes Development Version
fawkes::tf::TimeCache Class Reference

Time based transform cache. More...

#include <>>

List of all members.

Public Member Functions

 TimeCache (float max_storage_time=10.0)
 Constructor.
bool get_data (fawkes::Time time, TransformStorage &data_out, std::string *error_str=0)
 Get data.
bool insert_data (const TransformStorage &new_data)
 Insert data.
void clear_list ()
 Clear storage.
CompactFrameID get_parent (fawkes::Time time, std::string *error_str)
 Get parent frame number.
P_TimeAndFrameID get_latest_time_and_parent () const
 Get latest time and parent frame number.
unsigned int get_list_length () const
 Debugging information methods.
fawkes::Time get_latest_timestamp () const
 Get latest timestamp from cache.
fawkes::Time get_oldest_timestamp () const
 Get oldest timestamp from cache.

Static Public Attributes

static const int MIN_INTERPOLATION_DISTANCE = 5
 Number of nano-seconds to not interpolate below.
static const unsigned int MAX_LENGTH_LINKED_LIST = 1000000
 Maximum length of linked list, to make sure not to be able to use unlimited memory.

Detailed Description

Time based transform cache.

A class to keep a sorted linked list in time. This builds and maintains a list of timestamped data. And provides lookup functions to get data out as a function of time.


Constructor & Destructor Documentation

fawkes::tf::TimeCache::TimeCache ( float  max_storage_time = 10.0)

Constructor.

Parameters:
max_storage_timemaximum time in seconds to cache, defaults to 10 seconds

Definition at line 112 of file time_cache.cpp.


Member Function Documentation

void fawkes::tf::TimeCache::clear_list ( )

Clear storage.

Definition at line 347 of file time_cache.cpp.

bool fawkes::tf::TimeCache::get_data ( fawkes::Time  time,
TransformStorage data_out,
std::string error_str = 0 
)

Get data.

Parameters:
timetime for which go get data
data_outupon return contains requested data
error_strerror stirng
Returns:
false if data not available

Definition at line 276 of file time_cache.cpp.

References fawkes::tf::TransformStorage::frame_id_.

Referenced by fawkes::tf::TransformAccum::gather().

P_TimeAndFrameID fawkes::tf::TimeCache::get_latest_time_and_parent ( ) const

Get latest time and parent frame number.

Returns:
latest time and parent frame number

Definition at line 365 of file time_cache.cpp.

References fawkes::tf::TransformStorage::stamp, and fawkes::tf::TransformStorage::frame_id_.

fawkes::Time fawkes::tf::TimeCache::get_latest_timestamp ( ) const

Get latest timestamp from cache.

Returns:
latest timestamp

Definition at line 379 of file time_cache.cpp.

unsigned int fawkes::tf::TimeCache::get_list_length ( ) const

Debugging information methods.

Get storage list length.

Returns:
storage list length

Definition at line 356 of file time_cache.cpp.

Referenced by TfExampleThread::loop().

fawkes::Time fawkes::tf::TimeCache::get_oldest_timestamp ( ) const

Get oldest timestamp from cache.

Returns:
oldest time stamp.

Definition at line 389 of file time_cache.cpp.

CompactFrameID fawkes::tf::TimeCache::get_parent ( fawkes::Time  time,
std::string error_str 
)

Get parent frame number.

Parameters:
timepoint in time
error_strerror string
Returns:
frame number

Definition at line 304 of file time_cache.cpp.

References fawkes::tf::TransformStorage::frame_id_.

Referenced by fawkes::tf::CanTransformAccum::gather().

bool fawkes::tf::TimeCache::insert_data ( const TransformStorage new_data)

Insert data.

Parameters:
new_datadata to insert
Returns:
true on success, false otherwise

Definition at line 323 of file time_cache.cpp.

References fawkes::tf::TransformStorage::stamp.

Referenced by fawkes::tf::Transformer::set_transform().


Member Data Documentation

const unsigned int fawkes::tf::TimeCache::MAX_LENGTH_LINKED_LIST = 1000000 [static]

Maximum length of linked list, to make sure not to be able to use unlimited memory.

Definition at line 110 of file time_cache.h.

Number of nano-seconds to not interpolate below.

Definition at line 108 of file time_cache.h.


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