perception_pcl
perception_pcl copied to clipboard
Add CombinedPointCloudToPCD Node for Accumulating Multiple Point Clouds into a Single PCD
Summary
This PR introduces a new node called CombinedPointCloudToPCD which subscribes to a point cloud topic, accumulates multiple incoming point cloud messages, and saves them into a single PCD file. It also supports optional transforms to a fixed frame, as well as parameters for binary/compressed PCD output and whether to save on node shutdown or via a timer.
Why It’s Useful
- Developers often want to capture a continuous stream of point clouds and merge them for offline processing or archival. Instead of saving each message into its own file, this node lets you combine them into one comprehensive dataset for analysis, training machine learning models, or visual inspection.
Key Features
- Accumulation of Multiple Clouds: Stores incoming point clouds in memory until a save event (node shutdown or timed trigger).
-
Optional TF Transform: If a
fixed_frame
parameter is set, each incoming cloud is transformed before being appended. - Configurable Output: Supports ASCII, binary, or compressed PCD formats.
- Parameter-driven: Exposes parameters for prefix naming, save-on-shutdown, and more.
How to Test
-
Launch the Node:
ros2 run pcl_ros combined_pointcloud_to_pcd --ros-args \ -p prefix:=combined_ \ -p fixed_frame:=base_link \ -p binary:=false \ -p compressed:=false \ -p save_on_shutdown:=true \ -p save_timer_sec:=0.0
-
Publish Point Clouds: Use another node or bag file to publish
/input
(sensor_msgs/PointCloud2) data. -
Check Output: After the node shuts down (or the timer triggers saving), verify that one
.pcd
file is generated with the combined data.- The file name will look like:
combined_<timestamp>.pcd
.
- The file name will look like: