SkimImage.cpp
Go to the documentation of this file.
00001 #include <ros/ros.h>
00002 #include <iostream>
00003 #include <pcl_ros/point_cloud.h>
00004 #include <pcl/point_types.h>
00005 #include "pcl/io/pcd_io.h"
00006 
00007 #include "ClearpathPointCloudTools.h"
00008 
00009 typedef pcl::PointXYZRGB PointType;
00010 typedef pcl::PointCloud<PointType> PointCloud;
00011 
00012 ros::Publisher pub;
00013 
00014 int skim_factor = 1;
00015 
00016 void callback(const PointCloud::ConstPtr& cloud)
00017 {
00018     PointCloud result;
00019     ClearpathPointCloudTools::SkimPointCloudImage((PointCloud*)&(*cloud), &result, (unsigned int)skim_factor);
00020     pub.publish (result);
00021 }
00022 
00023 int main(int argc, char** argv)
00024 {
00025     ros::init (argc, argv, "skim_default");
00026     
00027     ros::NodeHandle nh = ros::NodeHandle(ros::this_node::getName());
00028     std::string in, out;
00029     nh.param<std::string>("in", in, "skim_in");
00030     nh.param<std::string>("out", out, "skim_out");
00031     nh.param<int>("skim_factor", skim_factor, 1);
00032 
00033     ros::NodeHandle nx;
00034     ros::Subscriber sub = nx.subscribe<PointCloud>(in, 1, callback);
00035     pub = nx.advertise<PointCloud> (out, 1);
00036 
00037     ros::spin();
00038 
00039     return (0);
00040 }
00041 
00042 
00043 


clearpath_tools
Author(s): Sean Anderson
autogenerated on Thu Jan 2 2014 11:06:21