-
Notifications
You must be signed in to change notification settings - Fork 938
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
Fix bug in applying planning scene diffs that have attached collision objects #3124
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3124 +/- ##
==========================================
+ Coverage 61.55% 61.60% +0.05%
==========================================
Files 376 376
Lines 33308 33314 +6
==========================================
+ Hits 20501 20521 +20
+ Misses 12807 12793 -14
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this now with the Panda tutorial and clearing collision scene objects. It seems to work great! But, I still think you need to check if parent_
is a nullptr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there. Wanted to give a little review, which is just a nit 🙂
…ld cause them to override the aco
Co-authored-by: AndyZe <andyz@utexas.edu>
Co-authored-by: AndyZe <andyz@utexas.edu>
Co-authored-by: AndyZe <andyz@utexas.edu>
042d61e
to
fed689b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late on this PR. I have some more suggestions and comments. Please see #3142.
} | ||
scene_msg.robot_state.is_diff = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, this is correct. However, @v4hn explicitly had a different opinion, when he introduced this code line: #939 (comment)
@@ -345,6 +345,129 @@ TEST_P(CollisionDetectorTests, ClearDiff) | |||
parent.reset(); | |||
} | |||
|
|||
// Returns a planning scene diff message | |||
moveit_msgs::PlanningScene create_planning_scene_diff(planning_scene::PlanningScene& ps, const std::string& object_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here PlanningScene
should be a const reference, shouldn't it?
@@ -711,6 +711,18 @@ void PlanningScene::getPlanningSceneDiffMsg(moveit_msgs::PlanningScene& scene_ms | |||
if (do_omap) | |||
getOctomapMsg(scene_msg.world.octomap); | |||
} | |||
|
|||
// Ensure any detached collision objects get detached from the parent planning scene, too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is misleading: The parent planning scene is not (and should not get) modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I had a to-do to update the comment, but it got resolved somehow
…nts to the original PR (#3142)
… objects (moveit#3124) (moveit#1251) * Add test that trigger the bug in applying scene that have robot state diffs * Fix a bug in planning scene diffs where having applying two diffs would cause them to override the aco * Fix a bug where removing an attached collision object would keep it in the scene * Update moveit_core/planning_scene/test/test_planning_scene.cpp Co-authored-by: AndyZe <andyz@utexas.edu> * Update moveit_core/planning_scene/test/test_planning_scene.cpp Co-authored-by: AndyZe <andyz@utexas.edu> * Update moveit_core/planning_scene/src/planning_scene.cpp Co-authored-by: AndyZe <andyz@utexas.edu> * Check parent pointer Co-authored-by: AndyZe <andyz@utexas.edu> Co-authored-by: AndyZe <andyz@utexas.edu>
Description
This fixes a bug we had while executing an MTC task where having two different planning scenes diffs that add a collision object to the scene, the first commit is just a test that trigger the bug, the second commit sets
robot_state.is_diff
to true when callinggetPlanningSceneDiffMsg
which prevent conversions.cpp#L369-L372 from deleting the aco from the robot state when applying the diffs, but now when calling PlanningScene::setCurrentState while detaching an object that object is staying in the scene so the last commit fixes it by explicitly removing the aco in the case of scene diffThis work is sponsored by RE2 Robotics