
Effective Robotics Programming with ROS
By :

In this section, you will learn how to integrate PCL and ROS. Knowledge and understanding of how ROS packages are laid out and how to compile are required although the steps will be repeated for simplicity. The example used in this first PCL program has no use whatsoever other than serving as a valid ROS node, which will successfully compile.
The first step is to create the ROS package for this entire chapter in your workspace. This package will depend on the pcl_conversions
, pcl_ros
, pcl_msgs
, and sensor_msgs
packages:
$ catkin_create_pkg chapter10_tutorials pcl_conversions pcl_ros pcl_msgs sensor_msgs
The following step is to create the source directory in the package using the following commands:
$ rospack profile $ roscd chapter10_tutorials $ mkdir src
In this new source directory, you should create a file named pcl_sample.cpp
with the following code, which creates a ROS node and publishes a point cloud with 100 elements. Again, what the code does should not really...