Working with point cloud data
We can handle the point cloud data from Kinect or other 3D sensors to perform a wide variety of tasks, such as 3D object detection and recognition, obstacle avoidance, 3D modeling, and so on. In this section, we will look at some basic functionalities; that is, using the PCL library and its ROS interface. We will discuss the following topics:
- How to publish a point cloud in ROS
- How to subscribe and process a point cloud
- How to write point cloud data to a PCD file
- How to read and publish a point cloud from a PCD file
Let's learn how to publish point cloud data as a ROS topic using a C++ example.
How to publish a point cloud
In this example, we will learn how to publish point cloud data using the sensor_msgs/PointCloud2
message. The code will use PCL APIs to handle and create the point cloud, as well as to convert the PCL cloud data into the PointCloud2
message type.
You can find the pcl_publisher.cpp
example code...