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

Improve handling of empty octomap messages and "clear octomap" actions #3134

Merged
merged 6 commits into from Mar 24, 2023

Conversation

FSund
Copy link
Contributor

@FSund FSund commented May 10, 2022

Description

Currently, if a PlanningScene message is published on the monitoried_planning_scene topic with an empty msg.world.octomap.octomap.data field, the octomap is skipped altogether in if it is a msg.is_diff is True (source). I think perhaps an empty data field is interpreted as the octomap field not being filled. But this makes it impossible to clear the octomap by sending an empty octomap message (for example via the "Clear octomap" button in the MotionPlanning panel in RViz).

This PR sets octomap.id to "empty" if the octomap is empty (this string can be anything except an empty string), and checks octomap.id.empty() instead of octomap.data.empty() to see if the octomap should be processed.

Fixes #3045.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • 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

@welcome
Copy link

welcome bot commented May 10, 2022

Thanks for helping in improving MoveIt and open source robotics!

@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.12 🎉

Comparison is base (0f66b99) 61.60% compared to head (40bf88b) 61.72%.

❗ Current head 40bf88b differs from pull request most recent head 7ad5f24. Consider uploading reports for the commit 7ad5f24 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3134      +/-   ##
==========================================
+ Coverage   61.60%   61.72%   +0.12%     
==========================================
  Files         376      376              
  Lines       33309    33318       +9     
==========================================
+ Hits        20518    20562      +44     
+ Misses      12791    12756      -35     
Impacted Files Coverage Δ
moveit_core/planning_scene/src/planning_scene.cpp 65.98% <100.00%> (+1.86%) ⬆️

... and 6 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@FSund FSund changed the title Remove superflous check of octomap contents [WIP] Remove superflous check of octomap contents May 11, 2022
@FSund FSund changed the title [WIP] Remove superflous check of octomap contents [WIP] Improve handling of empty octomap messages and "clear octomap" actions May 11, 2022
@FSund FSund changed the title [WIP] Improve handling of empty octomap messages and "clear octomap" actions Improve handling of empty octomap messages and "clear octomap" actions May 11, 2022
Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this fix and sorry that your PR was ignored for so long.
In prinicple I approve, but I suggest to set a non-empty id only if the octomap was actually cleared. Otherwise, a corresponding update will be always triggered.

@rhaschke
Copy link
Contributor

Fixes #3380, #3342, #3045, #439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants