Topic utils

TopicLatch

Topic lath is an extension of the Subscriber, that can be used to get a single message without writing callback. It is also possible to drop several message before returning, that is useful for topic where the first couple of messages is not valid i.e. Xtions.

#include <clopema_libs/topic_utils.h>
using namespace clopema::topic_utils;
...
TopicLatch<sensor_msgs::Image> tl(n, "/xtion2/rgb/image_raw");
sensor_msgs::Image image_msg = tl.getNext(5);