00001 00033 #ifndef __VISUALIZATION_MANAGER__ 00034 #define __VISUALIZATION_MANAGER__ 00035 00036 #include "ros/ros.h" 00037 #include "image_transport/image_transport.h" 00038 #include "cv_bridge/CvBridge.h" 00039 #include <opencv/cv.h> 00040 #include "DUtils.h" 00041 00042 class VisualizationManager 00043 { 00044 public: 00050 VisualizationManager(ros::Publisher &pub); 00051 00052 ~VisualizationManager(); 00053 00059 void show(const cv::Mat &image, const std::string &text = "", 00060 bool hold = false); 00061 00062 protected: 00068 void putText(cv::Mat &image, const std::string &text, 00069 const cv::Scalar &color) const; 00070 00071 protected: 00072 ros::Publisher m_publisher; 00073 sensor_msgs::CvBridge m_bridge; 00074 00075 bool m_holding; // true if current image is frozen 00076 DUtils::Timestamp m_unfreeze_time; // time until current image is frozen 00077 }; 00078 00079 #endif