Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef SHAPE_RECONSTRUCTION_NODE_H_
00049 #define SHAPE_RECONSTRUCTION_NODE_H_
00050
00051 #include <ros/ros.h>
00052 #include <ros/callback_queue.h>
00053 #include <ros/subscriber.h>
00054 #include <image_transport/image_transport.h>
00055 #include <message_filters/subscriber.h>
00056 #include <message_filters/time_synchronizer.h>
00057 #include <message_filters/sync_policies/approximate_time.h>
00058 #include <sensor_msgs/PointCloud2.h>
00059 #include <sensor_msgs/Image.h>
00060 #include <std_msgs/Empty.h>
00061
00062 #include <rosbag/bag.h>
00063 #include <tf/tf.h>
00064
00065 #include "shape_reconstruction/SurfaceSmootherNode.h"
00066 #include "shape_reconstruction/ShapeReconstruction.h"
00067
00068 #include <boost/thread.hpp>
00069
00070 #include <omip_common/OMIPTypeDefs.h>
00071
00072
00073 #include <dynamic_reconfigure/server.h>
00074
00075 #include <shape_reconstruction/generate_meshes.h>
00076
00077 #include <pcl_conversions/pcl_conversions.h>
00078
00079 #include <omip_common/OMIPTypeDefs.h>
00080
00081
00082 #include <opencv2/core/core.hpp>
00083 #include <camera_info_manager/camera_info_manager.h>
00084
00085 #include <pcl/range_image/range_image_planar.h>
00086 #include <pcl/filters/extract_indices.h>
00087 #include <pcl/common/transforms.h>
00088 #include <pcl/search/search.h>
00089 #include <pcl/search/organized.h>
00090 #include <pcl/search/kdtree.h>
00091 #include <pcl/filters/extract_indices.h>
00092 #include <pcl/filters/voxel_grid.h>
00093 #include <pcl/kdtree/kdtree_flann.h>
00094
00095 #include <omip_common/OMIPUtils.h>
00096
00097 #include <pcl/filters/radius_outlier_removal.h>
00098
00099 #include <pcl/filters/approximate_voxel_grid.h>
00100
00101 #include <pcl/features/normal_3d_omp.h>
00102 #include <pcl/point_types.h>
00103 #include <pcl/io/pcd_io.h>
00104 #include <pcl/kdtree/kdtree_flann.h>
00105 #include <pcl/features/normal_3d.h>
00106 #include <pcl/surface/gp3.h>
00107 #include <pcl/io/vtk_lib_io.h>
00108
00109 #include <pcl/segmentation/supervoxel_clustering.h>
00110
00111 #include <boost/circular_buffer.hpp>
00112
00113 #include "shape_reconstruction/SRUtils.h"
00114
00115 #include <omip_msgs/ShapeModels.h>
00116
00117 namespace omip
00118 {
00119
00120 class SurfaceSmootherNode
00121 {
00122
00123 public:
00124
00128 SurfaceSmootherNode();
00129
00133 virtual ~SurfaceSmootherNode();
00134
00135 virtual void measurementCallback(const sensor_msgs::PointCloud2ConstPtr &pc_msg);
00136
00137 virtual void ReadRosBag();
00138
00139 virtual void generateMesh();
00140
00141 virtual void colorMesh(pcl::PolygonMesh &mesh);
00142
00143 virtual void orientNormalsInMesh(pcl::PolygonMesh& mesh);
00144
00145 protected:
00146
00147
00148 ros::NodeHandle _node_handle;
00149
00150 ros::Subscriber _pc_subscriber;
00151
00152 SRPointCloud::Ptr _current_pc;
00153 SRPointCloud::Ptr _current_pc_copy;
00154
00155 template<class T>
00156 bool getROSParameter(std::string param_name, T & param_container)
00157 {
00158 if (!(this->_node_handle.getParam(param_name, param_container)))
00159 {
00160 ROS_ERROR_NAMED("SurfaceSmootherNode.getROSParameter", "The parameter %s can not be found.", param_name.c_str());
00161 throw(std::string("[SurfaceSmootherNode.getROSParameter] The parameter can not be found. Parameter name: ") + param_name);
00162 return false;
00163 }
00164 else
00165 return true;
00166 }
00167 };
00168 }
00169
00170 #endif
00171