You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MotionPlanning RViz plugin have to be manually refreshed after clear_octomap #3045
After calling the /clear_octomap service, the MotionPlanning RViz plugin have to be reloaded (uncheck and re-check the plugin, or remove/add), for the octomap to disappear from the Planning Scene.
The same happens if an empty octomap is loaded from a file via /move_group/load_map (the old octomap is still shown until the plugin is reloaded). The empty map is generated via /move_group/save_map on a fresh scene.
The same behaviour is present when calling the /apply_planning_scene service with an empty octomap:
(untested code, it is a minimal version of the actual code I use)
I am not sure if any of these 3 methods of clearing the octomap are related, but I thought I'd just as well report all the similar issues I've run into.
Your environment
ROS Distro: Noetic
OS Version: Pop!OS
Built from source, branch master (moveit repo is on commit e7b388d)
The behaviour seems to be the same on moveit 1.1.7 from apt on Pop!OS 20.04
Steps to reproduce
Start RViz and moveit
Load/scan any octomap
Call service /clear_octomap
Expected behaviour
I would expect the octomap to disappear from the Planning Scene after the service is called.
Actual behaviour
The octomap is still shown until I reload the MotionPlanning plugin.
Reacted by juntuck, JK, atmagopal and Cedric Goubard
Quickly skimming the code clearing the octomap should trigger `UPDATE_GEOMETRY` which *should* trigger publishing a new ROS message with the cleared octomap. Can you see the message on the `move_group/monitored_planning_scene` topic when you clear the scene?
Either the trigger fails or the new message is interpreted wrongly in the RViz plugin.
EDIT: I think I understand what you meant now. An empty id field should indicate an empty octomap. So I just have to figure out where the octomap message is created when the Clear octomap button is pressed. I think I've narrowed it down to somewhere in PlanningSceneMonitor::scenePublishingThread.
I am not sure what you are suggesting. Should the id field always be filled? Or should the id field only be empty when the octomap is empty?
I'll have a look at the code and try to figure out where everything is being manipulated.
EDIT: I've now realized that removing that check will clear the octomap every time a diff message is sent, if the octomap field is not filled.
To me the check here seems superflous, since map.data.empty() and map.id != OcTree is checked here. If I remove the check the octomap disappears from RViz when I press "Clear octomap".
But perhaps I'm not understanding how everything fits together properly.
It seems the octomap message is created in PlanningScene::getOctomapMsg. The issue I'm having is that the id is set in fullMapToMsg, so this is not available if map does not exist (which I'm guessing it doesn't if the octomap has been cleared).
Seeing as "OcTree" is already hardcoded here I could just hardcode it myself, but it seems like a bit of a hack.
Activity
atmagopal commentedon Apr 29, 2022
I've been experiencing the same issue. Have you had any progress towards fixing this @FSund ?
v4hn commentedon May 4, 2022
FSund commentedon May 6, 2022
Yes, the following message appears on the
monitoried_planning_scenetopic when I press "Clear octomap" in RVizThe Octomap is still visible in RViz though.
v4hn commentedon May 6, 2022
FSund commentedon May 10, 2022
EDIT: I think I understand what you meant now. An empty
idfield should indicate an empty octomap. So I just have to figure out where the octomap message is created when the Clear octomap button is pressed. I think I've narrowed it down to somewhere in PlanningSceneMonitor::scenePublishingThread.I am not sure what you are suggesting. Should theidfield always be filled? Or should theidfield only be empty when the octomap is empty?I'll have a look at the code and try to figure out where everything is being manipulated.FSund commentedon May 10, 2022
EDIT: I've now realized that removing that check will clear the octomap every time a diff message is sent, if the octomap field is not filled.
To me the check here seems superflous, sincemap.data.empty()andmap.id != OcTreeis checked here. If I remove the check the octomap disappears from RViz when I press "Clear octomap".But perhaps I'm not understanding how everything fits together properly.FSund commentedon May 10, 2022
I have made a pull request with a preliminary test, to check how CI responds to my changes.
FSund commentedon May 11, 2022
It seems the octomap message is created in PlanningScene::getOctomapMsg. The issue I'm having is that the
idis set in fullMapToMsg, so this is not available ifmapdoes not exist (which I'm guessing it doesn't if the octomap has been cleared).Seeing as
"OcTree"is already hardcoded here I could just hardcode it myself, but it seems like a bit of a hack.