Skip to content

feat: ROS2 point reordering - #13

Merged
contagon merged 7 commits into
mainfrom
feat/ros-point-reordering
Mar 24, 2026
Merged

feat: ROS2 point reordering#13
contagon merged 7 commits into
mainfrom
feat/ros-point-reordering

Conversation

@contagon

Copy link
Copy Markdown
Contributor

Handle reordering PointCloud2 types a lot more robustly.

Previously, if the point cloud was column major but not ring sequential, FORM would likely crash. Now FORM handles this by either

  1. Adding missing points to the end of the scanline
  2. Using a predefined lidar model formats to properly handle the nonsequential points.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves robustness of ROS 2 PointCloud2 ingestion for FORM by introducing a two-step pipeline (parse → infer format → reorder) and supporting predefined LiDAR model formats to handle non-sequential column-major ring ordering without crashing.

Changes:

  • Added RawPoint parsing (load_pc2) and new inference/reordering utilities (infer_lidar_size, infer_lidar_order, reorder) for more resilient organized-scan construction.
  • Introduced LidarFormat + a small registry of predefined models (LIDAR_FORMATS) and a new lidar_model ROS parameter.
  • Updated launch config, docs, and dev task to use lidar_model and allow “infer/auto” defaults for geometry/range parameters.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
ros/src/ros_pc2.h Adds RawPoint parsing + inference + reordering logic for robust PointCloud2 handling
ros/src/node.hpp Stores optional inferred/user LiDAR format on the node
ros/src/node.cpp Adds lidar_model parameter and runtime inference of LiDAR sizing/ordering before registering scans
ros/src/format.hpp Adds LidarFormat, helper mapping utilities, and predefined model registry
ros/launch/odometry.launch.py Adds lidar_model and switches geometry/range defaults to auto/infer sentinels
ros/pixi.toml Updates example task to use lidar_model
ros/README.md Updates usage/docs around inference and model-based configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ros/src/format.hpp
Comment thread ros/README.md Outdated
Comment thread ros/README.md Outdated
Comment thread ros/src/ros_pc2.h
Comment thread ros/README.md Outdated
Comment thread ros/src/ros_pc2.h
Comment thread ros/src/ros_pc2.h
Comment thread ros/src/ros_pc2.h
Comment thread ros/src/ros_pc2.h
Comment thread ros/src/node.cpp
contagon and others added 2 commits March 24, 2026 15:05
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@contagon
contagon merged commit 37cb01f into main Mar 24, 2026
5 checks passed
@contagon
contagon deleted the feat/ros-point-reordering branch March 26, 2026 16:00
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