Skip to content

Added pointcloud_to_pcd and combined_pointcloud_to_pcd#527

Open
kubojion wants to merge 1 commit intoros-perception:humblefrom
kubojion:humble
Open

Added pointcloud_to_pcd and combined_pointcloud_to_pcd#527
kubojion wants to merge 1 commit intoros-perception:humblefrom
kubojion:humble

Conversation

@kubojion
Copy link
Copy Markdown

pointcloud_to_pcd was broken on the humble branch as the source file was still ROS 1 code and the CMakeLists.txt entry was commented out. combined_pointcloud_to_pcd (available in the ros2 branch) was also missing from humble.

CHANGES

pointcloud_to_pcd.cpp - ported from ROS 1 to ROS 2:
combined_pointcloud_to_pcd.cpp - backported from ros2 branch with two adaptations for Humble:
CMakeLists.txt - adds both tools as shared libs using rclcpp_components_register_node
package.xml - adds tf2_eigen dependency

@kubojion
Copy link
Copy Markdown
Author

The remaining cpplint failures are pre-existing in the humble branch (visible in builds prior to #127). This PR introduces 0 new violations. They are being addressed in #507

@kubojion
Copy link
Copy Markdown
Author

@mvieth Could you have a chance to review this? I fixes the broken pointcloud_to_pcd on the humble branch (source file was still ros1 code and CMakeLists entry was commented out) and backports combined_pointcloud_to_pcd from the ros2 branch. Build #129 shows 0 new violations introduced by this PR.

@Rayman
Copy link
Copy Markdown
Contributor

Rayman commented Mar 23, 2026

The port of pointcloud_to_pcd was already done in #486 which was merged in jazzy. So please update to jazzy if you need this feature.

If you want to backport this issue, please rebase the existing commit, but I tried locally and there are a lot of merge conflicts.

…ntcloud_to_pcd from ros2 branch

- pointcloud_to_pcd was never ported from ROS 1; its CMakeLists entry
  was also commented out. Port replaces ros/ros.h, ros::NodeHandle,
  boost::shared_ptr with rclcpp equivalents, uses pcl/common/io.h for
  PCL >= 1.12 compatibility, and registers as an rclcpp component.

- combined_pointcloud_to_pcd backported from ros2 branch with two
  Humble-compatible adaptations: pcl_ros::transformPointCloud replaces
  the unavailable pcl::transformPointCloud(PCLPointCloud2) overload;
  direct buffer append replaces the conflicting pcl::concatenatePointCloud
  overload. Accumulates as pcl::PCLPointCloud2 to preserve all fields.

- CMakeLists.txt: add both tools as shared libs via rclcpp_components.
- package.xml: add tf2_eigen dependency.
@kubojion
Copy link
Copy Markdown
Author

@Rayman Thanks for the review.

I'm on Ubuntu 22 which is tied to Humble, so upgrading to Jazzy isn't an option.

For pointcloud_to_pcd.cpp I replaced with the ros2 branch HEAD verbatim, including QoS overrides, pcl::PCLPointCloud2, timestamp formatting, and .hpp tf2 headers. Compiles cleanly on Humble.

For combined_pointcloud_to_pcd, I kept the pcl::PCLPointCloud2 accumulator rather than the pcl::PointCloudpcl::PointXYZ / pcl::PointCloudpcl::PointXYZRGB approach in the ros2 branch, since the typed approach silently drops all fields except X/Y/Z (or RGB) - intensity, ring, timestamp, etc. are lost.

Happy to do a proper git cherry pick of the original commits if you'd prefer the history to reflect that.

@Rayman
Copy link
Copy Markdown
Contributor

Rayman commented Mar 24, 2026

I'd prefer cherry picking of the original commits. Then I know patches can be packported easily.

Btw, you mentioned combined_pointcloud_to_pcd is missing some fields. Is that something you would like to propose to add to the ros2 branch? (and then backport)

@kubojion
Copy link
Copy Markdown
Author

@Rayman I've opened a PR against the ros2 branch with the PCLPointCloud2 fix for combined_pointcloud_to_pcd: #528

Once that is reviewed I'll redo this PR as a proper cherry pick chain from ros2 and back port to humble.

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.

2 participants