Example Code for ROS2-Point Cloud Publishing

Last revision 2026/01/29

This article guides you through the process of publishing point cloud data using ROS2, detailing hardware and software preparations, command execution, and visualization in RVIZ2.

Hardware Preparation

  • RGB-D Sensor Camera (SKU:SEN0583), Quantity: 1, Purchase Link: DFRobot

Software Preparation

Other Preparation Work

  1. Prepare a Linux environment for ROS2.
  2. Extract the sipeed_tofv075_ros2.zip package and navigate to its path.

command

  • Extract sipeed_tofv075-ros.zip,and open its path
    command1: source /opt/ros/*/setup.sh
    command: colcon build
    If it indicates missing colcon, use command sudo apt install python3-colcon-ros
    command: source install/setup.sh
    command: ros2 run sipeed_tof_cpp publishe

    Then the terminal continuously refreshes the command line and display [sipeed_tof]: Publishing,this means it works normally.

Result

  • The terminal will display [sipeed_tof]: Publishing indicating successful data publishing.
  • View frames in RQT by selecting Plugins->Topics->Topic Monitor.
  • Preview point cloud data in RVIZ2 by adding PointCloud2 or /depth topics and setting the Fixed Frame to "tof".

Additional Information

RQT
PointCloud2 Result
depth Result

Was this article helpful?

TOP