pcl_to_image.h
Go to the documentation of this file.
00001 #ifndef _PCL2IMAGE_H_
00002 #define _PCL2IMAGE_H_
00003 
00004 // [Eigen]
00005 #include "Eigen/Core"
00006 
00007 // [ROS]
00008 #include "ros/ros.h"
00009 #include "ros/callback_queue.h"
00010 #include "image_transport/image_transport.h" 
00011 
00012 // [PCL_ROS]
00013 #include <pcl/ros/conversions.h>
00014 #include <pcl/point_cloud.h>
00015 #include <pcl/point_types.h>
00016 
00017 #include <pcl/sample_consensus/model_types.h>
00018 #include <pcl/sample_consensus/method_types.h>
00019 #include <pcl/segmentation/sac_segmentation.h>
00020 #include <pcl/ros/register_point_struct.h>
00021 #include <pcl/filters/voxel_grid.h>
00022 #include <pcl/filters/extract_indices.h>
00023 
00024 //pcl::toROSMsg
00025 #include <pcl/io/pcd_io.h>
00026 
00027 //iriutils
00028 #include "mutex.h"
00029 
00030 // [OpenCV]
00031  #include <cv_bridge/cv_bridge.h>
00032  #include <opencv2/imgproc/imgproc.hpp>
00033  #include <opencv2/highgui/highgui.hpp>
00034 
00035 // [publisher subscriber headers]
00036 #include "sensor_msgs/Image.h"
00037 #include "sensor_msgs/PointCloud2.h"
00038 
00039 
00040 typedef union {
00041     struct /*anonymous*/
00042     {
00043       unsigned char Blue;
00044       unsigned char Green;
00045       unsigned char Red;
00046       unsigned char Alpha;
00047     };
00048     float float_value;
00049     long long_value;
00050 } RGBValue;
00051 
00052 class PCLtoImage {
00053     public:
00054       PCLtoImage();
00055      
00056     private:
00057 
00058       double distance_threshold_;
00059       double cloud_remaining_proportion_threshold_;
00060 
00061       CMutex mutex;
00062 
00063       cv_bridge::CvImage cv_image;
00064 
00065       sensor_msgs::Image image_msg_;
00066       
00067       ros::NodeHandle nh_;
00068 
00069       pcl::PointCloud<pcl::PointXYZRGB> pcl_xyzrgb_;
00070       pcl::PointCloud<pcl::PointXYZ> pcl_xyzrgb2_;
00071 
00075       void image_from_sparse_pcl2(pcl::PointCloud<pcl::PointXYZRGB> cloud, cv::Mat& rgb_image);
00076 
00077       // [Subscribers]
00078       ros::Subscriber pcl2_sub_;
00079 
00080       // [Publishers]
00081       image_transport::ImageTransport it_;
00082       image_transport::Publisher image_pub_;
00083 
00084       void pcl2_sub_callback(const sensor_msgs::PointCloud2::ConstPtr& msg);
00085 };
00086 #endif


iri_pcl_filters
Author(s): Sergi Foix
autogenerated on Fri Dec 6 2013 20:44:42