yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Realsense Depth Camera📖
1.Installation video
  • Installation video
2.Tutorials
  • 2.0 How to use camera
  • 2.1 Opencv application
  • 2.2 Color recognition-object tracking
  • 2.3 ARTag
  • 2.4 ROS+Opencv basic course
  • 2.5 ROS+OpenCV application
  • 2.6 Data conversion and point cloud
Download
  • Code
  • Datasheet
  • Software
  • VM file
Download ZIP

Welcome to Realsense Depth Camera repository

2.6 Data conversion and point cloud

6、Data conversion and point cloud

6、Data conversion and point cloud6.1、ROS and PCD6.2、PCL 3D point cloud6.2.1、start up6.2.2、Point cloud visualization

6.1、ROS and PCD

Start up interl camera

roslaunch realsense2_camera rs_camera.launch

Point cloud display: rviz (start the rviz command, select the corresponding topic, modify the parameters, and present different effects); pcl_visualization tool.

xxxxxxxxxx
roslaunch visual pointCloud_visualize.launch cloud_topic:=/camera/depth/color/points

(1)pointcloud_to_pcd

xxxxxxxxxx
rosrun pcl_ros pointcloud_to_pcd input:=/camera/depth/color/points 

Save the ROS point cloud message in the specified PCD file.

(2)convert_pcd_to_image

xxxxxxxxxx
rosrun pcl_ros convert_pcd_to_image <cloud.pcd>

Load a PCD file and publish it as a ROS image message five times per second.

(3)convert_pointcloud_to_image

xxxxxxxxxx
rosrun pcl_ros convert_pointcloud_to_image input:=/camera/depth/color/points  output:=/my_image
View image: rosrun image_view image_view image:=/my_image

Subscribe to a topic of ROS point cloud and publish it with image information. (4)pcd_to_pointcloud

xxxxxxxxxx
rosrun pcl_ros pcd_to_pointcloud <file.pcd> [ <interval> ]

Load a PCD file and publish one or more times as a ROS point cloud message.

  • file.pcd: The name of the (required) file to be read.
  • interval: (Optional) The number of seconds to sleep between messages. If the parameter [interval] is zero or not specified, the message will be published once.
xxxxxxxxxx
roslaunch visual pointCloud_visualize.launch cloud_topic:=/cloud_pcd

(5)bag_to_pcd

rosbag Record

Command: rosbag record topic1 [topic2 topic3 ...]

xxxxxxxxxx
rosbag record /camera/depth/color/points

bag_to_pcd

xxxxxxxxxx
rosrun pcl_ros bag_to_pcd <input_file.bag> <topic> <output_directory>
# E.g:
rosrun pcl_ros bag_to_pcd 2021-09-09-11-41-56.bag /camera/depth/color/points my_pcd

Read a package file and save the ROS point cloud message in the specified PCD file. This requires a bag file.

6.2、PCL 3D point cloud

6.2.1、start up

Release point cloud, the launch file contains the launch of rviz. So I can clearly see a cloud of dots flashing in the middle of rviz.

xxxxxxxxxx
roslaunch visual pointCloud_pub.launch

image-20210903152536091

Another way to start, this way you need to manually start [rviz], and add the component [PointCloud2] to select the topic [/color_cloud].

xxxxxxxxxx
roscore
rosrun visual pointCloud_pub
  • Code analysis

Path: visual/src/pub_pointCloud.cpp

6.2.2、Point cloud visualization

  • rviz
xxxxxxxxxx
rviz
  • pcl_visualization

Start up command

xxxxxxxxxx
roslaunch visual pointCloud_visualize.launch
rosrun visual pointCloud_visualize

image-20210903153621551

  • Shortcut key

【Ctrl】+【-】

【Shift】+【+】

【Alt】+【-】

【Alt】+【+】

The mouse wheel and left and right buttons can also be controlled.

  • Code analysis

Path: visual/src/pcl_visualize.cpp

 

ROS+OpenCV application

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文