#include <camerainfolist.h>
Public Member Functions | |
sensor_msgs::CameraInfoPtr | add (const sensor_msgs::CameraInfoPtr &info) |
Adds the given camera info to the internal list. More... | |
CameraInfoList () | |
Create a camera info list. More... | |
sensor_msgs::CameraInfoPtr | find (const ros::Time ×tamp) const |
Returns the oldest camera info that has a timestamp within the tolerance of the given timestamp. More... | |
int | removeOld (const ros::Time ×tamp) |
Remove all camera infos that have a timestamp that is older or equal than the given timestamp. More... | |
void | setSize (size_t maxsize) |
Set maximum size of the list. More... | |
void | setTolerance (uint64_t tolerance) |
Set tolerance for finding corresponding timestamps. More... | |
Private Attributes | |
std::vector< sensor_msgs::CameraInfoPtr > | list_ |
size_t | maxsize_ |
uint64_t | tolerance_ |
Definition at line 44 of file camerainfolist.h.
rcgccam::CameraInfoList::CameraInfoList | ( | ) |
Create a camera info list.
Definition at line 42 of file camerainfolist.cc.
sensor_msgs::CameraInfoPtr rcgccam::CameraInfoList::add | ( | const sensor_msgs::CameraInfoPtr & | info | ) |
Adds the given camera info to the internal list.
If the maximum number of elements is exceeded, then the oldest camera info will be dropped.
info | Camera info message to be added. |
Definition at line 57 of file camerainfolist.cc.
sensor_msgs::CameraInfoPtr rcgccam::CameraInfoList::find | ( | const ros::Time & | timestamp | ) | const |
Returns the oldest camera info that has a timestamp within the tolerance of the given timestamp.
If the camera info cannot be found, then a nullptr is returned.
timestamp | Timestamp. |
tolerance | Maximum tolarance added or subtracted to the timestamp. |
Definition at line 93 of file camerainfolist.cc.
int rcgccam::CameraInfoList::removeOld | ( | const ros::Time & | timestamp | ) |
Remove all camera infos that have a timestamp that is older or equal than the given timestamp.
timestamp | Timestamp. |
Definition at line 72 of file camerainfolist.cc.
void rcgccam::CameraInfoList::setSize | ( | size_t | maxsize | ) |
Set maximum size of the list.
maxsize | Maximum number of elements that the list can hold. The default is 25. |
Definition at line 47 of file camerainfolist.cc.
void rcgccam::CameraInfoList::setTolerance | ( | uint64_t | tolerance | ) |
Set tolerance for finding corresponding timestamps.
tolerance | Tolerance in nano seconds. Default is 0. |
Definition at line 52 of file camerainfolist.cc.
|
private |
Definition at line 100 of file camerainfolist.h.
|
private |
Definition at line 98 of file camerainfolist.h.
|
private |
Definition at line 99 of file camerainfolist.h.