-
Notifications
You must be signed in to change notification settings - Fork 960
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
"object" collides with "object": unconditionally allocate unpadded collision environments #1899
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1899 +/- ##
==========================================
+ Coverage 50.24% 50.24% +<.01%
==========================================
Files 313 313
Lines 24663 24662 -1
==========================================
+ Hits 12391 12392 +1
+ Misses 12272 12270 -2
Continue to review full report at Codecov.
|
@v4hn, I don't see how your explanation and your fix fits my observation of a race condition: When adding a small sleep after a PlanningScene update in MTC's execution capability, the issue is gone. |
I think the right fix would be to find the place where this copy-on-write is broken (ie making a copy is not triggered) instead of removing it? I would expect your changes to have some impact in cases like multi-threaded planners etc.? |
I agree but did not have the time to do so, especially as this whole part was rearranged lately...
Did you try the patch? I am not sure anymore whether an additional sleep fixed my problems, I tried to find the actual problem.
You are welcome to setup a benchmark to show that. As I said, a-priori I'm not convinced the whole structural overhead there is justified. |
That is also my understanding of the current status-quo. Maybe this discussion helps?
When working on this part of MoveIt, I also had the impression that the efficiency gains are not worth the complexity added (anymore?). The code is very difficult to understand. |
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, I'm not convinced that we should merge this workaround.
Somebody should take the time to really understand the race condition.
I'm undecided whether I want to see this merged (temporarily?) and mainly wanted to share the insights. Incidentally, an alternative workaround for the issue is to remove |
As a side note: could someone explain to me how this patch manages to reduce coverage in the checker? |
It might be deleting LOC that were covered by tests, so the percentage of uncovered code grows? |
Yes, this change seems to be less source-intrusive. I would like to avoid workarounds that strongly change the collision code without fully understanding the underlying problem. However, I don't have the resources right now to further investigate. For MTC, introducing a 0.1s sleep "solved" the issue. As there are no other reported failures due to this bug, I prefer this as the least-intrusive workaround. Nevertheless, your analysis will be very helpful. |
To add a quick note here: This does not seem to be a solution as |
a46e702
to
7ceae98
Compare
b9c53ed
to
1afb965
Compare
If a scene contains an object, either itself or its parent, collision checking should respect the object. Incidentally, failing to do so can yield "object" collides with "object" errors in diffs with attach instructions.
1afb965
to
7d047dc
Compare
I spent a few hours on this the other night and it turns out the whole logic of unpadded collision checking on Note that this bug affects the standard use of the Whereas a source comment mentions copy-on-write, this is actually not implemented. To make the scene structure consistent again - objects in the scene must be respected for all types of collision checking - I propose to merge the original patch from this pull-request. I consider the alternative solution, to implement a lazy allocation when unpadded checking is requested, inferior as it would introduce more fragile logic in an overcomplicated datastructure. |
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.
Thanks for deeply analyzing this issue.
Great work, thanks. Does this also fix #1835? |
Fixed via moveit/moveit#1899. Please use *latest* master (if you do not use melodic builds). This reverts commit c44d0ca.
Sorry Simon, but this was never backported to kinetic/melodic. The exact patch requires the new `CollisionEnv` structure.
It should be straight-forward to get the same functionality for melodic though and, as always, a patch is welcome. :)
Sorry about the interruption from your vacation.
|
Ok, I thought so as well. Unfortunately there are no copies of |
Sounds like you need to figure out why your robot has an attached object then, when the object is still part of the world as well. That's the second kind of problem where I've seen this error before.
Happy debugging.
|
* Fix timeout in waitForCurrentState * Remove rclcpp dependency
I just read through #1835 and moveit/moveit_task_constructor#122 which describe a problem with collision checking of attached objects ending up in self-collision.
I am sorry. I debugged this problem in a hurry already back in October for a demo,☹️
but did not get around to investigate further or create a thread for it.
This patch resolved the problem for me, although it is likely not the best solution.
Without digging deeper into this again, here's what I recall:
CollisionRobot
andCollisionWorld
intoCollisionEnv
seems to have exposed the issue to trigger with MTC's execution capability, although I'm not convinced the logic was perfectly sane beforeThe patch addresses this logic bug simply by always allocating the unpadded collision environment.
I am not convinced it is worth the effort to try to fix the lazy allocation scheme here, but I did not benchmark anything and this only becomes relevant when the benchmarks include attach/detach operations...
On top of that, I am not convinced this double-accounting for padded and unpadded checking makes sense anymore(?), but I did not look into the underlying structures deep enough to understand this.