Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
tf::TimeCache Class Reference

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. More...

#include <time_cache.h>

Public Member Functions

void clearList ()
 
bool getData (ros::Time time, TransformStorage &data_out, std::string *error_str=0)
 
P_TimeAndFrameID getLatestTimeAndParent ()
 
ros::Time getLatestTimestamp ()
 
unsigned int getListLength ()
 Debugging information methods. More...
 
ros::Time getOldestTimestamp ()
 
CompactFrameID getParent (ros::Time time, std::string *error_str)
 
bool insertData (const TransformStorage &new_data)
 
 TimeCache (ros::Duration max_storage_time=ros::Duration().fromNSec(DEFAULT_MAX_STORAGE_TIME))
 

Static Public Attributes

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

Private Types

typedef std::set< TransformStorageL_TransformStorage
 

Private Member Functions

uint8_t findClosest (const TransformStorage *&one, const TransformStorage *&two, ros::Time target_time, std::string *error_str)
 A helper function for getData. More...
 
void interpolate (const TransformStorage &one, const TransformStorage &two, ros::Time time, TransformStorage &output)
 
void pruneList ()
 

Private Attributes

ros::Duration max_storage_time_
 
L_TransformStorage storage_
 

Detailed Description

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

Member Typedef Documentation

Definition at line 119 of file time_cache.h.

Constructor & Destructor Documentation

TimeCache::TimeCache ( ros::Duration  max_storage_time = ros::Duration().fromNSec(DEFAULT_MAX_STORAGE_TIME))

Definition at line 55 of file cache.cpp.

Member Function Documentation

void TimeCache::clearList ( )

Definition at line 264 of file cache.cpp.

uint8_t TimeCache::findClosest ( const TransformStorage *&  one,
const TransformStorage *&  two,
ros::Time  target_time,
std::string *  error_str 
)
inlineprivate

A helper function for getData.

Definition at line 98 of file cache.cpp.

bool TimeCache::getData ( ros::Time  time,
TransformStorage data_out,
std::string *  error_str = 0 
)

Definition at line 192 of file cache.cpp.

P_TimeAndFrameID TimeCache::getLatestTimeAndParent ( )

Definition at line 274 of file cache.cpp.

ros::Time TimeCache::getLatestTimestamp ( )

Definition at line 285 of file cache.cpp.

unsigned int TimeCache::getListLength ( )

Debugging information methods.

Definition at line 269 of file cache.cpp.

ros::Time TimeCache::getOldestTimestamp ( )

Definition at line 291 of file cache.cpp.

CompactFrameID TimeCache::getParent ( ros::Time  time,
std::string *  error_str 
)

Definition at line 225 of file cache.cpp.

bool TimeCache::insertData ( const TransformStorage new_data)

Definition at line 239 of file cache.cpp.

void TimeCache::interpolate ( const TransformStorage one,
const TransformStorage two,
ros::Time  time,
TransformStorage output 
)
inlineprivate

Definition at line 170 of file cache.cpp.

void TimeCache::pruneList ( )
private

Definition at line 297 of file cache.cpp.

Member Data Documentation

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

default value of 10 seconds storage

Definition at line 102 of file time_cache.h.

const unsigned int 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 101 of file time_cache.h.

ros::Duration tf::TimeCache::max_storage_time_
private

Definition at line 122 of file time_cache.h.

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

Number of nano-seconds to not interpolate below.

Definition at line 100 of file time_cache.h.

L_TransformStorage tf::TimeCache::storage_
private

Definition at line 120 of file time_cache.h.


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


tf
Author(s): Tully Foote, Eitan Marder-Eppstein, Wim Meeussen
autogenerated on Mon Jun 10 2019 12:25:26