No version for distro humble. Known supported distros are highlighted in the buttons above.
No version for distro jazzy. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.

pcd_demo package from ros2-point-cloud-demo repo

pcd_demo

Package Summary

Tags No category tags.
Version 0.0.1
License MIT License
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description Demo package for ROS2 that publishes a point cloud and visualizes it using RViz2
Checkout URI https://github.com/sebastiangrans/ros2-point-cloud-demo.git
VCS Type git
VCS Version master
Last Updated 2025-04-19
Dev Status UNKNOWN
CI status No Continuous Integration
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Demo on how to utilize the sensor_msgs::msg::PointCloud2 message type in ROS2, RViz2 and numpy.

Additional Links

No additional links.

Maintainers

  • Sebastian Grans

Authors

No additional authors.

ROS2 Point Cloud

spinning pointcloud of Utah Teapot

This is an example ROS2 (python) package which demonstrates how to utilize the sensor_msg.msg.PointCloud2. The various scripts show how to publish a point cloud represented by a numpy array as a PointCloud2 message, and vice versa. I also demonstrate how to visualize a point cloud in RViz2.

2025-04-19: This is now updated to work on ROS2 Rolling

I install ROS2 rolling on Ubuntu 24.10 (oracular).

Installation

This assumes that you have ROS2 Rolling installed and have some basic knowledge of ROS2. Check out the ROS2 Rolling Documentation.

Move to your ROS workspace source folder:

cd ~/dev_ws

Clone this repo:

git clone https://github.com/SebastianGrans/ROS2-Point-Cloud-Demo.git

Set up a virtual environment:

# Do this in the root of your workspace
cd ~/dev_ws/
# Source the underlay
source /opt/ros/rolling/source.bash
# Create the virtual environment
python3 -m venv venv
# Add a `COLCON_IGNORE` file
touch venv/COLCON_IGNORE
# Activate the environment
source venv/bin/activate
# Install the python package
pip install ./ROS2-Point-Cloud-Demo

Add the environment to the $PYTHONPATH environment variable:

Note: Replace <your-username-here>

export PYTHONPATH="${PYTHONPATH}:/home/<your-username-here>/dev_ws/venv/lib/python3.12/site-packages)"

Compile with colcon:

colcon build --symlink-install --packages-select pcd_demo

Running

Source the installation:

cd ~/dev_ws/
source install/local_setup.bash

Publisher demo

Using a launch file (automatically starts RViz)

ros2 launch pcd_demo pcd_publisher_demo.launch.py

RViz should now show a spinning Utah teapot!

Manually

ros2 run pcd_demo pcd_publisher_node ~/dev_ws/src/ROS2-Point-Cloud-Demo/resource/teapot.ply

In a new terminal:

ros2 run rviz2 rviz2

Make sure the Displays panel is visible Panels > [✔] Displays. Then, in the lower corner, press Add and select PointCloud2. In the list, expand PointCloud2 and specify pcd as the topic.

RViz should now show a spinning Utah teapot!

Subscriber demo

This seems to be broken!

This demo is similar to the one above, but rather than relying on RViz, we instead use Open3D for visualization.

Note: This is not yet fully optimized. It needs to be threaded such that the Open3D interface is responsive.

Running from launch file

This seems to be broken!

ros2 launch pcd_demo pcd_pubsub_demo.launch.py

Manually

This seems to be broken!

In one terminal, run the publisher:

ros2 run pcd_demo pcd_publisher_node ~/dev_ws/src/pcd_publisher/resource/teapot.ply

and in another terminal, run the subscriber node:

ros2 run pcd_demo pcd_subscriber_node

CHANGELOG
No CHANGELOG found.

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged pcd_demo at Robotics Stack Exchange

No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro iron. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.