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 () |
Clear the list of stored values. | |
bool | getData (ros::Time time, TransformStorage &data_out) |
ros::Time | getLatestTimestamp () |
Get the latest timestamp cached. | |
unsigned int | getListLength () |
Get the length of the stored list. | |
ros::Time | getOldestTimestamp () |
Get the oldest timestamp cached. | |
bool | insertData (const TransformStorage &new_data) |
void | interpolate (const TransformStorage &one, const TransformStorage &two, ros::Time time, TransformStorage &output) |
TimeCache (bool interpolating=true, ros::Duration max_storage_time=ros::Duration().fromNSec(DEFAULT_MAX_STORAGE_TIME), ros::Duration max_extrapolation_time=ros::Duration().fromNSec(DEFAULT_MAX_EXTRAPOLATION_TIME)) | |
Static Public Attributes | |
static const int64_t | DEFAULT_MAX_EXTRAPOLATION_TIME = 0LL |
default max extrapolation of 0 nanoseconds | |
static const int64_t | DEFAULT_MAX_STORAGE_TIME = 1ULL * 1000000000LL |
default value of 10 seconds storage | |
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. | |
static const int | MIN_INTERPOLATION_DISTANCE = 5 |
Number of nano-seconds to not interpolate below. | |
Private Member Functions | |
uint8_t | findClosest (TransformStorage &one, TransformStorage &two, ros::Time target_time, ExtrapolationMode &mode) |
!< The mutex to protect the linked list | |
void | pruneList () |
Private Attributes | |
bool | interpolating_ |
ros::Duration | max_extrapolation_time_ |
ros::Duration | max_storage_time_ |
std::list< TransformStorage > | storage_ |
boost::mutex | storage_lock_ |
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 64 of file time_cache.h.
tf::TimeCache::TimeCache | ( | bool | interpolating = true , |
|
ros::Duration | max_storage_time = ros::Duration().fromNSec(DEFAULT_MAX_STORAGE_TIME) , |
|||
ros::Duration | max_extrapolation_time = ros::Duration().fromNSec(DEFAULT_MAX_EXTRAPOLATION_TIME) | |||
) | [inline] |
Definition at line 73 of file time_cache.h.
void tf::TimeCache::clearList | ( | ) | [inline] |
Clear the list of stored values.
Definition at line 115 of file time_cache.h.
uint8_t TimeCache::findClosest | ( | TransformStorage & | one, | |
TransformStorage & | two, | |||
ros::Time | target_time, | |||
ExtrapolationMode & | mode | |||
) | [private] |
bool TimeCache::getData | ( | ros::Time | time, | |
TransformStorage & | data_out | |||
) |
ros::Time tf::TimeCache::getLatestTimestamp | ( | ) | [inline] |
Get the latest timestamp cached.
Definition at line 121 of file time_cache.h.
unsigned int tf::TimeCache::getListLength | ( | ) | [inline] |
Get the length of the stored list.
Definition at line 118 of file time_cache.h.
ros::Time tf::TimeCache::getOldestTimestamp | ( | ) | [inline] |
Get the oldest timestamp cached.
Definition at line 129 of file time_cache.h.
bool tf::TimeCache::insertData | ( | const TransformStorage & | new_data | ) | [inline] |
Definition at line 83 of file time_cache.h.
void TimeCache::interpolate | ( | const TransformStorage & | one, | |
const TransformStorage & | two, | |||
ros::Time | time, | |||
TransformStorage & | output | |||
) |
void tf::TimeCache::pruneList | ( | ) | [inline, private] |
Definition at line 150 of file time_cache.h.
const int64_t tf::TimeCache::DEFAULT_MAX_EXTRAPOLATION_TIME = 0LL [static] |
default max extrapolation of 0 nanoseconds
Definition at line 70 of file time_cache.h.
const int64_t tf::TimeCache::DEFAULT_MAX_STORAGE_TIME = 1ULL * 1000000000LL [static] |
default value of 10 seconds storage
Definition at line 69 of file time_cache.h.
bool tf::TimeCache::interpolating_ [private] |
Definition at line 138 of file time_cache.h.
ros::Duration tf::TimeCache::max_extrapolation_time_ [private] |
Definition at line 140 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 68 of file time_cache.h.
ros::Duration tf::TimeCache::max_storage_time_ [private] |
Definition at line 139 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 67 of file time_cache.h.
std::list<TransformStorage > tf::TimeCache::storage_ [private] |
Definition at line 134 of file time_cache.h.
boost::mutex tf::TimeCache::storage_lock_ [private] |
Definition at line 142 of file time_cache.h.