-
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
collision_detection_fcl: Report link_names in correct order #2682
Conversation
Thanks for helping in improving MoveIt and open source robotics! |
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.
Thank you for the contribution and greetings to Bonn!
It's unexpected to see that FCL can change the order here and I wonder whether they introduced this issue in some later release.
I'm happy to consider the case in MoveIt, but I would also expect a bug report at the FCL repository. Did you create one there as well?
It would be great if you could improve the test case according to my comment below. Thank you lots for creating a test case to begin with. 👍
...it_core/collision_detection/include/moveit/collision_detection/test_collision_common_panda.h
Outdated
Show resolved
Hide resolved
@v4hn thanks for the quick feedback and greetings back to Hamburg ;) I'll improve the test case tomorrow or Monday and will look at the CI failure as well. I just wanted to write down what I found out about FCL itself: Here is the code that applies the distance algorithm "in reverse" depending on the object type: and here is the same piece of code 9 years ago (it got moved around a bit, but is still very much the same): So I think it's safe to say that this has been the case for quite some time and is, I guess, intentionally designed that way. I'll open an issue with FCL about documenting this more explicitly. Changing the behavior on FCL's side is probably not a good idea. |
...it_core/collision_detection/include/moveit/collision_detection/test_collision_common_panda.h
Outdated
Show resolved
Hide resolved
I'll give this a test today. Seems like a good idea, overall. |
ce4b5f6
to
813f29b
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.
Looks good to me now (unless CI objects).
Thank you for taking the time to clean up the test!
@AndyZe Please merge if your test succeeds.
CI is failing since FCL < 0.6 (melodic uses 0.5.0) reports the nearest_points sometimes in the wrong frame (body coordinates): flexible-collision-library/fcl#171, flexible-collision-library/fcl#288 In that case, the |
ca5da93
to
c7c77ad
Compare
FCL does not guarantee that fcl::distance(o1, o2) returns data in the order o1,o2. So use the result to figure out link names and body types. Furthermore, we do not compute normals in the signed distance case anymore, unless enable_nearest_points is set. This mirrors the behavior in the unsigned distance case.
c7c77ad
to
d62c771
Compare
I went ahead and did that, so CI should pass now. |
Thanks for implementing it. I would propose to go one step further though! |
Codecov Report
@@ Coverage Diff @@
## master #2682 +/- ##
==========================================
+ Coverage 60.53% 60.55% +0.02%
==========================================
Files 402 402
Lines 29618 29595 -23
==========================================
- Hits 17926 17917 -9
+ Misses 11692 11678 -14
Continue to review full report at Codecov.
|
Good idea! I implemented it as a throttled |
47ea0df
to
0331e06
Compare
Congrats on getting your first MoveIt pull request merged and improving open source robotics! |
Thanks @xqms . Please send more patches if you encounter other issues 🥇 |
Also thanks to you both @v4hn and @AndyZe for the fast review & feedback! @v4hn Just wanted to point out that we did change the behavior for To follow up on the performance discussion: I couldn't measure a difference between master (before the merge) and this PR. Here's the benchmark I used: https://gist.github.com/xqms/0500ed88ac9836f6bbe0022298635c8e |
Description
For distance queries, FCL may report results in different order than what was requested (e.g.
fcl::distance(o1, o2, ...)
might give anfcl::DistanceResult
witho2, o1
. The MoveIt wrapper does not check if this is the case, and thus may report nearest_points in ordero2,o1
withlink_name
in ordero1,o2
.This PR fixes this issue by explicitly using the collision objects referenced in the
fcl::DistanceResult
object. It also adds a unit test which demonstrates the issue.Checklist
I feel this is not applicable, since this is a pure bugfix.
I think the risk that somebody depends on the current broken behavior is quite low.