Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subscription options to odometry subscriptions #4961

Open
wants to merge 4 commits into
base: jazzy
Choose a base branch
from

Conversation

pele1410
Copy link

@pele1410 pele1410 commented Mar 5, 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

We run a gazebo simulation of a surface vessel (similar to the WAM-V). Using the following configuration ros__parameters:

maneuver/controller_server:
    ros__parameters:
        ...
        qos_overrides:
            /localization/global/odometry:
                subscription:
                    reliability: best_effort
                    depth: 1

maneuver/task_manager:
    ros__parameters:
        ...
        qos_overrides:
            /localization/local/odometry:
                subscription:
                    reliability: best_effort
                    depth: 1

Prior to this change, I would see QoS mismatches between the nav2 susbcribers and my odom publishers:

[]$ ros2 topic info -v /localization/local/odometry
Type: nav_msgs/msg/Odometry

Publisher count: 1

Node name: ekf_odom
Node namespace: /localization/local
Topic type: nav_msgs/msg/Odometry
Topic type hash: RIHS01_3cc97dc7fb7502f8714462c526d369e35b603cfc34d946e3f2eda2766dfec6e0
Endpoint type: PUBLISHER
GID: 01.10.05.60.b9.86.71.a6.70.56.6a.1c.00.00.2d.03
QoS profile:
  Reliability: BEST_EFFORT
  History (Depth): KEEP_LAST (1)
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

Subscription count: 5
...
Node name: task_manager
Node namespace: /maneuver
Topic type: nav_msgs/msg/Odometry
Topic type hash: RIHS01_3cc97dc7fb7502f8714462c526d369e35b603cfc34d946e3f2eda2766dfec6e0
Endpoint type: SUBSCRIPTION
GID: 01.10.5d.47.e3.a9.04.4e.97.ff.1b.54.00.00.33.04
QoS profile:
  Reliability: RELIABLE
  History (Depth): KEEP_LAST (1)
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

and

[]$ ros2 topic info -v /localization/global/odometry
Type: nav_msgs/msg/Odometry

Publisher count: 1

Node name: ekf_map
Node namespace: /localization/global
Topic type: nav_msgs/msg/Odometry
Topic type hash: RIHS01_3cc97dc7fb7502f8714462c526d369e35b603cfc34d946e3f2eda2766dfec6e0
Endpoint type: PUBLISHER
GID: 01.10.a7.a9.a4.52.ec.04.d2.54.89.14.00.00.2d.03
QoS profile:
  Reliability: BEST_EFFORT
  History (Depth): KEEP_LAST (1)
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

Subscription count: 5
...
Node name: controller_server
Node namespace: /maneuver
Topic type: nav_msgs/msg/Odometry
Topic type hash: RIHS01_3cc97dc7fb7502f8714462c526d369e35b603cfc34d946e3f2eda2766dfec6e0
Endpoint type: SUBSCRIPTION
GID: 01.10.de.ff.08.3b.c1.67.5b.7a.2a.9e.00.01.36.04
QoS profile:
  Reliability: RELIABLE
  History (Depth): KEEP_LAST (1)
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

After this change, I verified there were no such mismatches.

[]$ ros2 topic info -v /localization/local/odometry
Type: nav_msgs/msg/Odometry

Publisher count: 1

Node name: ekf_odom
Node namespace: /localization/local
Topic type: nav_msgs/msg/Odometry
Topic type hash: RIHS01_3cc97dc7fb7502f8714462c526d369e35b603cfc34d946e3f2eda2766dfec6e0
Endpoint type: PUBLISHER
GID: 01.10.05.60.b9.86.71.a6.70.56.6a.1c.00.00.2d.03
QoS profile:
  Reliability: BEST_EFFORT
  History (Depth): KEEP_LAST (1)
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

Subscription count: 5
...
Node name: task_manager
Node namespace: /maneuver
Topic type: nav_msgs/msg/Odometry
Topic type hash: RIHS01_3cc97dc7fb7502f8714462c526d369e35b603cfc34d946e3f2eda2766dfec6e0
Endpoint type: SUBSCRIPTION
GID: 01.10.e7.0e.a9.87.2c.19.ae.f1.2e.bb.00.00.33.04
QoS profile:
  Reliability: BEST_EFFORT
  History (Depth): KEEP_LAST (1)
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

Node name: task_manager_bt_rclcpp_node
Node namespace: /maneuver
Topic type: nav_msgs/msg/Odometry
Topic type hash: RIHS01_3cc97dc7fb7502f8714462c526d369e35b603cfc34d946e3f2eda2766dfec6e0
Endpoint type: SUBSCRIPTION
GID: 01.10.e7.0e.a9.87.2c.19.ae.f1.2e.bb.00.00.47.04
QoS profile:
  Reliability: BEST_EFFORT
  History (Depth): KEEP_LAST (5)
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

and

[]$ ros2 topic info -v /localization/global/odometry
Type: nav_msgs/msg/Odometry

Publisher count: 1

Node name: ekf_map
Node namespace: /localization/global
Topic type: nav_msgs/msg/Odometry
Topic type hash: RIHS01_3cc97dc7fb7502f8714462c526d369e35b603cfc34d946e3f2eda2766dfec6e0
Endpoint type: PUBLISHER
GID: 01.10.a7.a9.a4.52.ec.04.d2.54.89.14.00.00.2d.03
QoS profile:
  Reliability: BEST_EFFORT
  History (Depth): KEEP_LAST (1)
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

Subscription count: 5
...
Node name: controller_server
Node namespace: /maneuver
Topic type: nav_msgs/msg/Odometry
Topic type hash: RIHS01_3cc97dc7fb7502f8714462c526d369e35b603cfc34d946e3f2eda2766dfec6e0
Endpoint type: SUBSCRIPTION
GID: 01.10.9e.8f.e6.2f.00.f4.2d.9a.e5.3f.00.01.36.04
QoS profile:
  Reliability: BEST_EFFORT
  History (Depth): KEEP_LAST (1)
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

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

Copy link
Contributor

mergify bot commented Mar 5, 2025

@pele1410, all pull requests must be targeted towards the main development branch.
Once merged into main, it is possible to backport to @jazzy, but it must be in main
to have these changes reflected into new distributions.

@pele1410
Copy link
Author

pele1410 commented Mar 5, 2025

@pele1410, all pull requests must be targeted towards the main development branch. Once merged into main, it is possible to backport to @jazzy, but it must be in main to have these changes reflected into new distributions.

I don't have a mechanism to test this using anything but Jazzy as that is what our system runs with. What options do I have?

@SteveMacenski
Copy link
Member

SteveMacenski commented Mar 6, 2025

@pele1410 this PR is simple enough and I understand it well, its OK to cherry pick this to main and as long as CI passes, I'm OK with it.

If you submit the main PR, I can just merge the pair together. I would though like you to write up a migration guide entry for this change to let people know they can remap the QoS on the odometry smoother, that's useful information.

@pele1410
Copy link
Author

pele1410 commented Mar 6, 2025

@pele1410 this PR is simple enough and I understand it well, its OK to cherry pick this to main and as long as CI passes, I'm OK with it.

If you submit the main PR, I can just merge the pair together. I would though like you to write up a migration guide entry for this change to let people know they can remap the QoS on the odometry smoother, that's useful information.

#4968

I believe this is what you were asking for. I'm not super familiar with the Github flow.

Christopher Thompson added 4 commits March 6, 2025 19:26
Signed-off-by: Christopher Thompson <[email protected]>
Signed-off-by: Christopher Thompson <[email protected]>
Signed-off-by: Christopher Thompson <[email protected]>
@pele1410 pele1410 force-pushed the odometry-qos-overrides branch from a12e333 to f1b373d Compare March 6, 2025 19:27
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.

2 participants