Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering ROS for Robotics Programming

You're reading from   Mastering ROS for Robotics Programming Design, build, and simulate complex robots using the Robot Operating System

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher Packt
ISBN-13 9781783551798
Length 480 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Lentin Joseph Lentin Joseph
Author Profile Icon Lentin Joseph
Lentin Joseph
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Introduction to ROS and Its Package Management FREE CHAPTER 2. Working with 3D Robot Modeling in ROS 3. Simulating Robots Using ROS and Gazebo 4. Using the ROS MoveIt! and Navigation Stack 5. Working with Pluginlib, Nodelets, and Gazebo Plugins 6. Writing ROS Controllers and Visualization Plugins 7. Interfacing I/O Boards, Sensors, and Actuators to ROS 8. Programming Vision Sensors using ROS, Open-CV, and PCL 9. Building and Interfacing Differential Drive Mobile Robot Hardware in ROS 10. Exploring the Advanced Capabilities of ROS-MoveIt! 11. ROS for Industrial Robots 12. Troubleshooting and Best Practices in ROS Index

Working with point cloud data


We can handle the point cloud data from Kinect or the other 3D sensors for performing wide variety of tasks such as 3D object detection and recognition, obstacle avoidance, 3D modeling, and so on. In this section, we will see some basic functionalities using the PCL library and its ROS interface. We will discuss the following examples:

  • How to publish a point cloud in ROS

  • How to subscribe and process point cloud

  • How to write point cloud data to a PCD file

  • How to read and publish point cloud from a PCD file

How to publish a point cloud

In this example, we will see how to publish a point cloud data using the sensor_msgs/PointCloud2 message. The code will use PCL APIs for handling and creating the point cloud, and converting the PCL cloud data to PointCloud2 message type. You will get the example code pcl_publisher.cpp from the chapter_8_codes/pcl_ros_tutorial/src folder.

#include <ros/ros.h>

// point cloud headers
#include <pcl/point_cloud.h>
//Header which...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image