Running PCL in Hydro
Hi,
It took me a while to run the sample code for down-sampling a point cloud using voxel grid, as given in tutorial page at : http://wiki.ros.org/pcl/Tutorials?action=AttachFile&do=view&target=example_voxelgrid.cpp, tutorial link : http://wiki.ros.org/pcl/Tutorials
I am using ROS Hydro on Ubuntu12.04, and catkin build. I am thinking of updating these links and add code for Hydro. Kindly let me know if some changes I made are redundent etc. Specifically I made the following changes:-
- Code :
- Deleted : #include <pcl/ros/conversions.h>
Added: #include <pcl_conversions/pcl_conversions.h>
#include <sensor_msgs/PointCloud2.h> - Modified the callback function to use pcl::PCLPointCloud2 instead of sensor_msgs::PointCloud2 as:-
(It's given at hydro migration : http://wiki.ros.org/hydro/Migration)void cloud_cb (const pcl::PCLPointCloud2ConstPtr& input) { pcl::PCLPointCloud2 cloud_filtered; pcl::VoxelGrid<pcl::PCLPointCloud2> sor; sor.setInputCloud (input); sor.setLeafSize (0.01, 0.01, 0.01); sor.filter (cloud_filtered); // Publish the dataSize pub.publish (cloud_filtered); }
- Deleted : #include <pcl/ros/conversions.h>
- IN package.xml (from http://wiki.ros.org/hydro/Migration
(....pcl is no longer packaged by the ROS community as a catkin package, so any packages which directly depend on pcl should instead use the new rosdep rules libpcl-all and libpcl-all-dev...... )
and understood it (I think) by seeing the post at http://www.pcl-users.org/How-do-I-use-PCL-from-ROS-Hydro-td4029613.html (3rd comment : given by, Matteo Munaro Sep 12, 2013; 3:46pm), and also https://github.com/ros-perception/pcl_conversions/commit/a868e1a16e442c135f66a9738619d290bc4ee896)
Removed: build_depend>pcl</build_depend>
<run_depend>pcl</run_depend>
Added: <build_depend>libpcl-all-dev</build_depend>
<run_depend>libpcl-all</run_depend>
I am wondering if the addition of libpcl-all-dev and libpcl-all, could automatically be done while creting the package. - In CMakeList.txt
Removed: pcl dependency Added: pcl_conversions dependency
Again seeing the above mentioned link. Note: This could also be achieved by changing the package creation line to : catkin_create_pkg my_pcl_tutorial pcl_conversions pcl_ros roscpp sensor_msgs
I am quite sure that these changes must be done by many ppl who have run this tutorial and quite sad that they were not updated. Changes are a bit trivial once you understand, but still tutoral should run without giving any error, so that ppl like me could understand things easily :-).
Also is there a way to get libpcl-all-dev and libpcl-all directly in package.xml while creating the package.