Skip to content

Add support for point clouds in beluga_amcl#491

Merged
hidmic merged 26 commits intomainfrom
LaBruma/support_for_point_clouds
Sep 11, 2025
Merged

Add support for point clouds in beluga_amcl#491
hidmic merged 26 commits intomainfrom
LaBruma/support_for_point_clouds

Conversation

@LaBruma
Copy link
Collaborator

@LaBruma LaBruma commented Aug 1, 2025

Proposed changes

  • Add support to handle for point clouds in beluga_amcl (callback, subscriptions, parameters, etc.)
  • Provide testing for the added code

Type of change

  • 🐛 Bugfix (change which fixes an issue)
  • 🚀 Feature (change which adds functionality)
  • 📚 Documentation (change which fixes or extends documentation)

Checklist

Put an x in the boxes that apply. This is simply a reminder of what we will require before merging your code.

  • Lint and unit tests (if any) pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All commits have been signed for DCO

Additional comments

@LaBruma LaBruma requested a review from hidmic August 1, 2025 19:34
@LaBruma LaBruma force-pushed the LaBruma/support_for_point_clouds branch from 479536b to d4d772e Compare August 5, 2025 13:44
@LaBruma LaBruma changed the title Added support for point clouds in beluga_amcl Add support for point clouds in beluga_amcl Aug 8, 2025
Copy link
Collaborator

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

First pass! Nevermind the comments, this is solid C++ code @LaBruma 👏

@hidmic hidmic marked this pull request as ready for review August 26, 2025 21:41
LaBruma and others added 15 commits August 26, 2025 18:42
…iled, not tested)

Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
- Added subscription logic for scan_topic and point_cloud_topic

Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
…ser_callback, point_cloud_callback, etc.)

Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
- Default for laser_scan subscription changed from "scan" to ""
- Minor fix on ndt_amcl_node to subscribe to scan if parameter scan_topic is empty

Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
- Added tests for point cloud handling (sensor_callback on amcl_node.cpp and update on amcl.cpp)

Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
…oints)

Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
- Topic subscription logic
- Restrict types on beluga_amcl sensor_callback
- SparsePointCloud3 type change, double -> float
- Added size() method for LaserScan
- Naming: wrapper -> measurement
- Fixed bug on TrowsIfBothSensorTopicsAreSet (test_amcl_node)
- Tidy up on documentation (amcl.hpp)

Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
…e cast implemented at points() method level.

- Deduplicated lines in AmclNode::do_cleanup
- Ran pre-commit

Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
…ode.cpp)

Signed-off-by: Bruma <andres.brumovsky@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic force-pushed the LaBruma/support_for_point_clouds branch from ec9f047 to bbb6cfe Compare August 26, 2025 21:43
@hidmic hidmic requested review from glpuga and xaru8145 August 26, 2025 21:44
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Collaborator

hidmic commented Aug 26, 2025

This is ready to go. Let's see what CI says.

hidmic added 4 commits August 26, 2025 20:31
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@xaru8145
Copy link
Collaborator

I tried to use scan_topic parameter for the pointcloud and of course, it failed as there is now have a dedicated parameter point_cloud_topic. The way of failing was a bit misleading though (I am using autostart=true) as after some time the lifecycle bond fails and there is no pose and tf output:

[amcl_node-2] [ERROR] [1756390281.419729963] [beluga_amcl]: The bond connection to the lifecycle manager has been broken

Not sure if there is a way to check or assert a LaserScan message when using scan_topic and a PointCloud2 message when using point_cloud_topic so that the user identifies the issue quicker.

@hidmic
Copy link
Collaborator

hidmic commented Aug 28, 2025

The way of failing was a bit misleading though (I am using autostart=true) as after some time the lifecycle bond fails and there is no pose and tf output

Not sure if there is a way to check or assert a LaserScan message when using scan_topic and a PointCloud2 message when using point_cloud_topic so that the user identifies the issue quicker.

Hmm, this one's tricky. Topic types are not guaranteed to be unique in ROS 2 (for reasons) and rclcpp can't fail fast on a missing topic name and type tuple because it may be there, just not yet discovered. This is not an issue in Beluga per se but a quirk of ROS 2 that can happen with any node. It would've failed the same if you had used a gps topic for a scan.

Maybe we can send throttled logs if after a while we are still not seeing any messages, but I'd do that in a follow-up.

Copy link
Collaborator

@glpuga glpuga left a comment

Choose a reason for hiding this comment

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

Nice. The projection thing is worrisome, though.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic requested a review from glpuga September 3, 2025 12:14
Copy link
Collaborator

@glpuga glpuga left a comment

Choose a reason for hiding this comment

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

Mostly minor comments, but I still think we should remove the PointCloud3 struct if we don't use it.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic requested a review from glpuga September 11, 2025 17:48
Copy link
Collaborator

@glpuga glpuga left a comment

Choose a reason for hiding this comment

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

I still think we should not include beluga_ros/include/beluga_ros/point_cloud.hpp since we are not using it, but I won't hold this PR because of that.

@hidmic
Copy link
Collaborator

hidmic commented Sep 11, 2025

I still think we should not include beluga_ros/include/beluga_ros/point_cloud.hpp since we are not using it, but I won't hold this PR for that.

I know. We have benchmarks. I'll double check what would we be leaving on the table if we dropped it and if it's not significant I'll yank it.

Copy link
Collaborator

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

Self-approving because I'm not the author.

@hidmic hidmic merged commit 7bd5344 into main Sep 11, 2025
10 checks passed
@hidmic hidmic deleted the LaBruma/support_for_point_clouds branch September 11, 2025 20:15
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.

4 participants