Skip to content

fix(pcl_ros): preserve all fields in combined_pointcloud_to_pcd#528

Open
kubojion wants to merge 1 commit into
ros-perception:ros2from
kubojion:ros2
Open

fix(pcl_ros): preserve all fields in combined_pointcloud_to_pcd#528
kubojion wants to merge 1 commit into
ros-perception:ros2from
kubojion:ros2

Conversation

@kubojion

Copy link
Copy Markdown

combined_pointcloud_to_pcd was accumulating clouds into typed
pcl::PointCloud<pcl::PointXYZ> / pcl::PointCloud<pcl::PointXYZRGB>
containers, silently dropping all extra fields (intensity, ring,
timestamps, custom fields, etc.) on every incoming message.

This applies the same approach used in pointcloud_to_pcd since #491:
replace the typed accumulators with a single pcl::PCLPointCloud2 so
all fields are preserved as-is.

The TF transform path also needed to change: typed
clouds allowed manual Eigen loops over .points, which is not possible
with PCLPointCloud2. The fix uses pcl_ros::transformPointCloud (same
as pointcloud_to_pcd). With per-cloud TF, failing silently and falling
back to the original frame would mix coordinate frames in the output, so
the node now skips the cloud and logs a warning instead.

Other changes:

  • pcl::PCLPointCloud2::concatenate replaces manual buffer append,
    adding schema validation (skips cloudds with mismatched fields or endianness)
  • rgb parameter is kept but marked deprecated
  • is_dense propagated as logical AND across accumulated clouds
  • pcl_ros_tf added to link dependencies; tf2_eigen and direct
    tf2_ros removed (transitively provided by pcl_ros_tf)
  • Fixed filename bug: prefix "combined_" was producing
    combined_combined_*.pcd
  • rclcpp::shutdown() no longer called from destructor (passed via
    do_shutdown flag to avoid UB)

Replace pcl::PointCloud<pcl::PointXYZ>/pcl::PointXYZRGB accumulators with
pcl::PCLPointCloud2 so all fields (intensity, ring, timestamps, etc.) are
preserved, consistent with the approach in pointcloud_to_pcd (ros-perception#491).

- Use pcl::PCLPointCloud2::concatenate for safe accumulation with schema
  validation; skip clouds with mismatched fields/endianness
- Skip clouds when fixed_frame TF fails to avoid silently mixing frames
- Mark rgb parameter as deprecated no-op (all fields preserved automatically)
- Propagate is_dense as logical AND across accumulated clouds
- Add pcl_ros_tf linkage; use pcl_ros::transformPointCloud, removing
  the inline typed transform helpers
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