feat: ROS2 point reordering - #13
Merged
Merged
Conversation
Closed
Contributor
There was a problem hiding this comment.
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
RawPointparsing (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 newlidar_modelROS parameter. - Updated launch config, docs, and dev task to use
lidar_modeland 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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