Fawkes API
Fawkes Development Version
|
Time based transform cache. More...
#include <>>
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_TransformStorage & | get_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 | |
![]() | |
typedef std::list< TransformStorage > | L_TransformStorage |
List of stored transforms. 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 98 of file time_cache.h.
fawkes::tf::TimeCache::TimeCache | ( | float | max_storage_time = DEFAULT_MAX_STORAGE_TIME | ) |
Constructor.
max_storage_time | maximum time in seconds to cache, defaults to 10 seconds |
Definition at line 158 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::get_usec(), fawkes::Time::in_sec(), fawkes::Time::is_zero(), fawkes::tf::TransformStorage::rotation, fawkes::tf::TransformStorage::stamp, fawkes::Time::stamp(), and fawkes::tf::TransformStorage::translation.
Referenced by clone().
|
virtual |
Clear storage.
Implements fawkes::tf::TimeCacheInterface.
Definition at line 396 of file time_cache.cpp.
|
virtual |
Create a copy of this time cache.
look_back_until | if non-zero time is passed only include transforms younger than the given time. |
Implements fawkes::tf::TimeCacheInterface.
Definition at line 318 of file time_cache.cpp.
References fawkes::Time::is_zero(), and TimeCache().
|
virtual |
Get data.
time | time for which go get data |
data_out | upon return contains requested data |
error_str | error stirng |
Implements fawkes::tf::TimeCacheInterface.
Definition at line 335 of file time_cache.cpp.
References fawkes::tf::TransformStorage::frame_id.
|
virtual |
Get 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.
|
virtual |
Get latest timestamp from cache.
Implements fawkes::tf::TimeCacheInterface.
Definition at line 432 of file time_cache.cpp.
|
virtual |
Debugging information methods.
Get storage list length.
Implements fawkes::tf::TimeCacheInterface.
Definition at line 402 of file time_cache.cpp.
|
virtual |
Get oldest timestamp from cache.
Implements fawkes::tf::TimeCacheInterface.
Definition at line 439 of file time_cache.cpp.
|
virtual |
Get parent frame number.
time | point in time |
error_str | error string |
Implements fawkes::tf::TimeCacheInterface.
Definition at line 358 of file time_cache.cpp.
References fawkes::tf::TransformStorage::frame_id.
|
virtual |
Get storage list.
Implements fawkes::tf::TimeCacheInterface.
Definition at line 409 of file time_cache.cpp.
|
virtual |
Get copy of storage elements.
Implements fawkes::tf::TimeCacheInterface.
Definition at line 415 of file time_cache.cpp.
|
virtual |
Insert data.
new_data | data to insert |
Implements fawkes::tf::TimeCacheInterface.
Definition at line 373 of file time_cache.cpp.
References fawkes::tf::TransformStorage::stamp.
|
static |
default value of 10 seconds storage
default value of 10 seconds storage
Definition at line 107 of file time_cache.h.
|
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.
|
static |
Number of nano-seconds to not interpolate below.
Definition at line 103 of file time_cache.h.