Go to the documentation of this file. 1 #ifndef RGBD_IMAGE_BUFFER_IMAGE_BUFFER_H_
2 #define RGBD_IMAGE_BUFFER_IMAGE_BUFFER_H_
4 #include <ros/callback_queue.h>
10 #include <tf2_ros/buffer.h>
19 class TransformListener;
119 #endif // RGBD_IMAGE_BUFFER_IMAGE_BUFFER_H_
std::forward_list< rgbd::ImageConstPtr > image_buffer_
Newer images should be pushed on the front. This will result in the front being the most recent and t...
std::mutex recent_image_mutex_
For protecting ImageBuffer::recent_image_.
ros::CallbackQueue cb_queue_
std::pair< rgbd::ImageConstPtr, geo::Pose3D > recent_image_
tf2_ros::Buffer tf_buffer_
The ImageBuffer class provides a buffer to synchronise rgbd images with sensor positions....
bool getMostRecentImageTF()
Iterates over the buffer and tries to get TF for the most recent image. Deletes image and all older i...
std::unique_ptr< tf2_ros::TransformListener > tf_listener_
void workerThreadFunc(const float frequency=20)
Calls ImageBuffer::getMostRecentImageTF on the specified frequency.
std::unique_ptr< rgbd::Client > rgbd_client_
bool nextImage(rgbd::ImageConstPtr &image, geo::Pose3D &sensor_pose)
Returns the most recent combination of image and transform, provided it is different from the previou...
bool waitForRecentImage(rgbd::ImageConstPtr &image, geo::Pose3D &sensor_pose, double timeout_sec, double check_rate)
Blocks until a new image with transform is found. Returns false if no image or TF could be found with...
void initialize(const std::string &topic, const std::string &root_frame="map", const float worker_thread_frequency=20)
Configure the buffer.
std::unique_ptr< std::thread > worker_thread_ptr_