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

Planning Scene Monitor should use relaible QoS with >1 history #3257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ANogin
Copy link
Contributor

@ANogin ANogin commented Jan 21, 2025

Description

As discussed in #3174 (comment), updated the PlanningSceneMonitor::startSceneMonitor to use reliable QoS with history depth=10. This is necessary e.g. when used in Rviz plugin and updating the state of attached objects - those kinds of messages are only sent once and missing it results in things being badly out of sync. After implementing it , it looks like another issue I was having where /apply_planning_scene requests were not always reliably taking effect might have been also fixed by this.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • [N/A] Extend the tutorials / documentation reference
  • [N/A] Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • [N/A] Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@sea-bass sea-bass requested review from MarqRazz and sjahr January 22, 2025 01:13
@sea-bass sea-bass added backport-humble Mergify label that triggers a PR backport to Humble backport-jazzy Mergify label that triggers a PR backport to Jazzy labels Jan 22, 2025
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 45.64%. Comparing base (e7872eb) to head (ce604c4).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
...nning_scene_monitor/src/planning_scene_monitor.cpp 0.00% 3 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3257      +/-   ##
==========================================
- Coverage   46.00%   45.64%   -0.36%     
==========================================
  Files         483      714     +231     
  Lines       40632    62300   +21668     
  Branches        0     7530    +7530     
==========================================
+ Hits        18689    28430    +9741     
- Misses      21943    33703   +11760     
- Partials        0      167     +167     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rr-mark
Copy link

rr-mark commented Jan 22, 2025

This might explain (and fix) a number of problems we've been seeing on our ros2 build. I'll test this later.

planning_scene_subscriber_ = pnode_->create_subscription<moveit_msgs::msg::PlanningScene>(
scene_topic, rclcpp::SystemDefaultsQoS(), [this](const moveit_msgs::msg::PlanningScene::ConstSharedPtr& scene) {
scene_topic, qos, [this](const moveit_msgs::msg::PlanningScene::ConstSharedPtr& scene) {
Copy link
Contributor

@rhaschke rhaschke Jan 22, 2025

Choose a reason for hiding this comment

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

According to the docs, the default profile for publishers/subscribers already matches the desired settings.
Hence, it should be sufficient to use that profile instead of rclcpp::SystemDefaultsQoS():

- scene_topic, rclcpp::SystemDefaultsQoS(), [this](const moveit_msgs::msg::PlanningScene::ConstSharedPtr& scene) {
+ scene_topic, rmw_qos_profile_default, [this](const moveit_msgs::msg::PlanningScene::ConstSharedPtr& scene) {

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, rclcpp::SystemDefaultsQoS() should not be used anywhere in the code. Instead, the profiles predefined for specific use cases should be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No clue how things are supposed to work, but what I saw reported by ros2 topic info was that the subscription was "Reliability: BEST_EFFORT" with queue size of 1. That said, I am a novice in ROS2, so if there is an easier way to specify the desired QoS, I do not know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble Mergify label that triggers a PR backport to Humble backport-jazzy Mergify label that triggers a PR backport to Jazzy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants