Fawkes API
Fawkes Development Version
|
Time based transform cache. More...
#include <>>
Public Member Functions | |
TimeCache (float max_storage_time=10.0) | |
Constructor. More... | |
bool | get_data (fawkes::Time time, TransformStorage &data_out, std::string *error_str=0) |
Get data. More... | |
bool | insert_data (const TransformStorage &new_data) |
Insert data. More... | |
void | clear_list () |
Clear storage. More... | |
CompactFrameID | get_parent (fawkes::Time time, std::string *error_str) |
Get parent frame number. More... | |
P_TimeAndFrameID | get_latest_time_and_parent () const |
Get latest time and parent frame number. More... | |
unsigned int | get_list_length () const |
Debugging information methods. More... | |
fawkes::Time | get_latest_timestamp () const |
Get latest timestamp from cache. More... | |
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... | |
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 104 of file time_cache.h.
fawkes::tf::TimeCache::TimeCache | ( | float | max_storage_time = 10.0 | ) |
Constructor.
max_storage_time | maximum time in seconds to cache, defaults to 10 seconds |
Definition at line 112 of file time_cache.cpp.
References fawkes::tf::TransformStorage::child_frame_id_, fawkes::tf::TransformStorage::frame_id_, fawkes::Time::get_nsec(), fawkes::Time::get_sec(), fawkes::Time::in_sec(), fawkes::Time::is_zero(), fawkes::tf::TransformStorage::rotation_, fawkes::tf::TransformStorage::stamp, fawkes::Time::stamp(), fawkes::Time::str(), and fawkes::tf::TransformStorage::translation_.
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.
time | time for which go get data |
data_out | upon return contains requested data |
error_str | error stirng |
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.
Definition at line 365 of file time_cache.cpp.
References fawkes::tf::TransformStorage::frame_id_, and fawkes::tf::TransformStorage::stamp.
fawkes::Time fawkes::tf::TimeCache::get_latest_timestamp | ( | ) | const |
Get latest timestamp from cache.
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.
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.
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.
time | point in time |
error_str | error string |
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.
new_data | data to insert |
Definition at line 323 of file time_cache.cpp.
References fawkes::tf::TransformStorage::stamp.
Referenced by fawkes::tf::Transformer::set_transform().
|
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.
|
static |
Number of nano-seconds to not interpolate below.
Definition at line 108 of file time_cache.h.