Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CombinedPointCloudToPCD Node for Accumulating Multiple Point Clouds into a Single PCD #479

Open
wants to merge 5 commits into
base: ros2
Choose a base branch
from

Conversation

JVALPASS
Copy link

@JVALPASS JVALPASS commented Jan 29, 2025

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

  1. Accumulation of Multiple Clouds: Stores incoming point clouds in memory until a save event (node shutdown or timed trigger).
  2. Optional TF Transform: If a fixed_frame parameter is set, each incoming cloud is transformed before being appended.
  3. Configurable Output: Supports ASCII, binary, or compressed PCD formats.
  4. Parameter-driven: Exposes parameters for prefix naming, save-on-shutdown, and more.

How to Test

  1. 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
  2. Publish Point Clouds: Use another node or bag file to publish /input (sensor_msgs/PointCloud2) data.
  3. 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.

…to a single PCD

- Introduces CombinedPointCloudToPCD, a ROS 2 component node that:
  - Subscribes to sensor_msgs/PointCloud2 and accumulates multiple clouds.
  - Optionally transforms each cloud to a fixed frame.
  - Allows saving a combined PCD file in either binary, compressed, or ASCII format.
  - Permits saving on node shutdown or at a configurable timer interval.
- Preserves the BSD License from Willow Garage and references original authors.
- Useful for aggregating data from multiple scans into one dataset.
…d installation

- Adds combined_pointcloud_to_pcd_lib as a new shared library.
- Registers CombinedPointCloudToPCD as a component via rclcpp_components_register.
- Links necessary dependencies (PCL, rclcpp, etc.).
@JVALPASS JVALPASS changed the title [feat] Add CombinedPointCloudToPCD Node for Accumulating Multiple Point Clouds into a Single PCD Add CombinedPointCloudToPCD Node for Accumulating Multiple Point Clouds into a Single PCD Jan 29, 2025
@JVALPASS
Copy link
Author

Hello maintainers,

I’ve noticed that the CI tests are failing on this PR and suspect it’s due to older configurations or an outdated pipeline. The failure logs can be found here:
(https://build.ros2.org/job/Hpr__perception_pcl__ubuntu_jammy_amd64/105/console)

I believe updating the tests might resolve the issue. Let me know if you have any additional input or if there’s anything else I can adjust in this PR.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant