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

Time based transform cache. More...

#include <>>

Inheritance diagram for fawkes::tf::TimeCache:

Public Member Functions

 TimeCache (float max_storage_time=DEFAULT_MAX_STORAGE_TIME)
 Constructor. More...
 
virtual TimeCacheInterfacePtr clone (const fawkes::Time &look_back_until=fawkes::Time(0, 0)) const
 Create a copy of this time cache. More...
 
virtual bool get_data (fawkes::Time time, TransformStorage &data_out, std::string *error_str=0)
 Get data. More...
 
virtual bool insert_data (const TransformStorage &new_data)
 Insert data. More...
 
virtual void clear_list ()
 Clear storage. More...
 
virtual CompactFrameID get_parent (fawkes::Time time, std::string *error_str)
 Get parent frame number. More...
 
virtual P_TimeAndFrameID get_latest_time_and_parent ()
 Get latest time and parent frame number. More...
 
virtual const L_TransformStorageget_storage () const
 Get storage list. More...
 
virtual L_TransformStorage get_storage_copy () const
 Get copy of storage elements. More...
 
virtual unsigned int get_list_length () const
 Debugging information methods. More...
 
virtual fawkes::Time get_latest_timestamp () const
 Get latest timestamp from cache. More...
 
virtual fawkes::Time get_oldest_timestamp () const
 Get oldest timestamp from cache. More...
 

Static Public Attributes

static const int MIN_INTERPOLATION_DISTANCE = 5
 Number of nano-seconds to not interpolate below. More...
 
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. More...
 
static const int64_t DEFAULT_MAX_STORAGE_TIME = 1ULL * 1000000000LL
 default value of 10 seconds storage More...
 

Additional Inherited Members

- Public Types inherited from fawkes::tf::TimeCacheInterface
typedef std::list< TransformStorageL_TransformStorage
 List of stored transforms. More...
 

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.

Definition at line 98 of file time_cache.h.

Constructor & Destructor Documentation

◆ TimeCache()

Member Function Documentation

◆ clear_list()

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

Clear storage.

Implements fawkes::tf::TimeCacheInterface.

Definition at line 396 of file time_cache.cpp.

◆ clone()

TimeCacheInterfacePtr fawkes::tf::TimeCache::clone ( const fawkes::Time look_back_until = fawkes::Time(0,0)) const
virtual

Create a copy of this time cache.

Parameters
look_back_untilif non-zero time is passed only include transforms younger than the given time.
Returns
shared pointer to copy of this time cache

Implements fawkes::tf::TimeCacheInterface.

Definition at line 318 of file time_cache.cpp.

References fawkes::Time::is_zero(), and TimeCache().

◆ get_data()

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

Get data.

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

Implements fawkes::tf::TimeCacheInterface.

Definition at line 335 of file time_cache.cpp.

References fawkes::tf::TransformStorage::frame_id.

◆ get_latest_time_and_parent()

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

Get latest time and parent frame number.

Returns
latest time and parent frame number

Implements fawkes::tf::TimeCacheInterface.

Definition at line 421 of file time_cache.cpp.

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

◆ get_latest_timestamp()

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

Get latest timestamp from cache.

Returns
latest timestamp

Implements fawkes::tf::TimeCacheInterface.

Definition at line 432 of file time_cache.cpp.

◆ get_list_length()

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

Debugging information methods.

Get storage list length.

Returns
storage list length

Implements fawkes::tf::TimeCacheInterface.

Definition at line 402 of file time_cache.cpp.

◆ get_oldest_timestamp()

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

Get oldest timestamp from cache.

Returns
oldest time stamp.

Implements fawkes::tf::TimeCacheInterface.

Definition at line 439 of file time_cache.cpp.

◆ get_parent()

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

Get parent frame number.

Parameters
timepoint in time
error_strerror string
Returns
frame number

Implements fawkes::tf::TimeCacheInterface.

Definition at line 358 of file time_cache.cpp.

References fawkes::tf::TransformStorage::frame_id.

◆ get_storage()

const TimeCacheInterface::L_TransformStorage & fawkes::tf::TimeCache::get_storage ( ) const
virtual

Get storage list.

Returns
reference to list of storage elements

Implements fawkes::tf::TimeCacheInterface.

Definition at line 409 of file time_cache.cpp.

◆ get_storage_copy()

TimeCacheInterface::L_TransformStorage fawkes::tf::TimeCache::get_storage_copy ( ) const
virtual

Get copy of storage elements.

Returns
copied list of storage elements

Implements fawkes::tf::TimeCacheInterface.

Definition at line 415 of file time_cache.cpp.

◆ insert_data()

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

Insert data.

Parameters
new_datadata to insert
Returns
true on success, false otherwise

Implements fawkes::tf::TimeCacheInterface.

Definition at line 373 of file time_cache.cpp.

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

Member Data Documentation

◆ DEFAULT_MAX_STORAGE_TIME

const int64_t fawkes::tf::TimeCache::DEFAULT_MAX_STORAGE_TIME = 1ULL * 1000000000LL
static

default value of 10 seconds storage

default value of 10 seconds storage

Definition at line 107 of file time_cache.h.

◆ MAX_LENGTH_LINKED_LIST

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 105 of file time_cache.h.

◆ MIN_INTERPOLATION_DISTANCE

const int fawkes::tf::TimeCache::MIN_INTERPOLATION_DISTANCE = 5
static

Number of nano-seconds to not interpolate below.

Definition at line 103 of file time_cache.h.


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