Skip to content

Add subscription options to odometry subscriptions (main)#4968

Closed
pele1410 wants to merge 3 commits intoros-navigation:mainfrom
Metal-Shark-Sharktech:main
Closed

Add subscription options to odometry subscriptions (main)#4968
pele1410 wants to merge 3 commits intoros-navigation:mainfrom
Metal-Shark-Sharktech:main

Conversation

@pele1410
Copy link
Contributor

@pele1410 pele1410 commented Mar 6, 2025

Basic Info

Info Please fill out this column
Ticket(s) this addresses N/A
Primary OS tested on Ubuntu 22.04 docker container)
Robotic platform tested on Gazebo simulation
Does this PR contain AI generated software? No

Description of contribution in a few bullet points

Added rclcpp::SubscriptionOptions to the odometry topic subscribers to allow qos overrides in the configuration. We run our odometry topics with Unreliable QoS to prevent network issues that are common with high-rate, reliable DDS transmissions. This change allows us to override the Reliable QoS of the odom subscriptions to allow matching.

Description of documentation updates required from your changes

I would expect that this should be documented as a new configuration option, but I'm not entirely sure where that would happen.

Description of how this change was tested

Testing was done against the Jazzy branch with #4961


Future work that may be required in bullet points

N/A

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists

@SteveMacenski
Copy link
Member

CI failed unusually. I retriggered it to see if that resolves the issue.

In the meantime, please sign off your commits with DCO -- check out the failed DCO job for instructions how

Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com>
@SteveMacenski
Copy link
Member

SteveMacenski commented Mar 7, 2025

@pele1410 the same test is failing repeatedly, I think there's a problem here. I just checked our nightly jobs and PRs I merged today and those builds have all passed, so I'm fairly confident this is introducing a subtle bug.

unknown file
C++ exception with description "cannot set or declare a parameter, or change the callback from within set callback" thrown in the test body.

I'm seeing a ticket with this mentioned ros2/rclcpp#2741. It looks like this touches upon a recently reported issue with rclcpp - which you would probably hit eventually with Jazzy as well (good thing we ran this across Nav2's extensive CI 😉 )

@pele1410
Copy link
Contributor Author

pele1410 commented Mar 7, 2025

Well that's unfortunate. I can see an easy way around re-creating the OdomSmoother when the odom_duration changes (add a setter). But the odom_topic change is trickier. I could see capturing the QoS Override properties on construction and storing them, then using them to recreate the subscriber in a new method when the odom_topic changes. But that seems bad in that it could mislead users since the qos_overrides wouldn't actually be allowed to be changed.

Or we wait for that issue/PR to be resolved, which I assume is the path forward here.

@SteveMacenski
Copy link
Member

I think so, there is a PR open, so hopefully it shouldn’t be too long! I commented in the ticket that we ran into it as well in Nav2, maybe that’ll help push it forward a bit 🙂

@pele1410
Copy link
Contributor Author

I see ros2/rclcpp#2741 has been completed and landed on Rolling. Any chance we get an updated test here?

@SteveMacenski
Copy link
Member

Has that been released into the binaries? I just retriggered CI, but its not been pushed into rolling binaries yet, then this won't work until it is released and available.

@SteveMacenski
Copy link
Member

@pele1410 can you pull in main's updates? I think there's a caching related issue preventing the builds to all succeed since this is out of date

@SteveMacenski
Copy link
Member

This throws an exception still:

C++ exception with description "cannot set or declare a parameter, or change the callback from within set callback" thrown in the test body.

Is this not out into binaries yet?

@pele1410
Copy link
Contributor Author

Is this not out into binaries yet?

I'll be honest, I'm not entirely sure how to tell.

@pele1410
Copy link
Contributor Author

pele1410 commented Apr 19, 2025

It looks like it's in 29.5.0 based on this commit which was made 14 hours ago
ros2/rclcpp@11afffa

This might have been just after we re-ran the tests

@SteveMacenski
Copy link
Member

The last rolling release was April 16th https://discourse.ros.org/t/new-packages-for-ros-2-rolling-ridley-2025-04-16/43256 which released 29.4.0 which was cut 3 weeks ago. Your PR was merged in 2 weeks ago, so its not available in binaries yet, but should be the next sync in approximately 2-3 weeks

@codecov
Copy link

codecov bot commented Jun 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
..._2d_utils/include/nav_2d_utils/odom_subscriber.hpp 100.00% <100.00%> (ø)
nav2_util/src/odometry_utils.cpp 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SteveMacenski
Copy link
Member

SteveMacenski commented Jun 23, 2025

@pele1410 funny enough this is covered under my recent PR #5288 that'll be merged later today. It exposes all subscribers / publishers QoS profiles using the parameter allow_parameter_qos_overrides. Set this to true in your yaml for a particular server and you're good to go. Note that the Planner Server when using Smac Planner can deadlock due to another version of the issue we filed that wasn't fixed for publishers. Otherwise for any other server or even the planner server if not using Hybrid-A* or 2D-A*, you're good to go.

Thus, I'm going to close this since it is a specialization for a single topic for what the other PR is a general complete solution for. Let me know if you have any questions 😄 Sorry about the closure - I appreciate your efforts here greatly, it just happens to overlap of a larger refactoring I've been up to for some weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants