-
Notifications
You must be signed in to change notification settings - Fork 559
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
Do not switch object and shape poses of attached objects with subframes #3145
base: main
Are you sure you want to change the base?
Do not switch object and shape poses of attached objects with subframes #3145
Conversation
I agree that swapping poses of the collision object and its single shape should not be done silently. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3145 +/- ##
==========================================
- Coverage 46.00% 45.62% -0.38%
==========================================
Files 483 482 -1
Lines 40632 40432 -200
==========================================
- Hits 18689 18442 -247
- Misses 21943 21990 +47 ☔ View full report in Codecov by Sentry. |
👍
As mentioned somewhere in the threads on the migration to
That is not the definition of "empty" used in moveit. It is a bug in moveit2 that was introduced because quaternions in ROS2 default to identity instead of being zero-initialized. |
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
@rhaschke per earlier discussion it seems that the right thing to do is to land this on moveit2, and leave it alone in moveit1 - is that correct? If so, will you be able to please review and merge? Thanks. |
Description
moveit/moveit#2816 (comment) said
Namely, if an attached object has exactly one shape (primitive or mesh) and the pose of the attached object is "empty" (that is, the origin of the attached object coincides with the origin of the link it is attached to), then the code would "swap" the poses, moving the origin of the attached object to the origin of the shape/mesh.
Unfortunately this change had some IMHO very unfortunate side-effects. In my use case, the pose is not "empty", it is correctly set to identity, as the URDF was intentionally structured to have the origin of the robot link and attached object coincide, to make the whole thing simpler to set up. Whereas in my case the mesh origin is a completely "random" location (the URDF is created by exporting from Fusion using https://github.com/jaredgonzales/fusion360descriptor/ and Fusion has all meshes originate at global origin of the design, regardless of the local origin of the specific bodies). The issue is than two-fold:
This means that using the attached object or its subframe as a frame id or tip name in IK/motion planning results in things failing in completely unpredictable and seemingly incomprehensible ways (I just happened to have the scene returned by move_group's get_planning_scene logged and happened to see that the mesh origin was 0, which clued me to where to look in source code, otherwise I would have likely spent hours trying to understand why things work correctly for some attached objects, and completely bogus for others).
I see the following options:
IMHO option 3 is the right way, but I do not have bandwidth or understanding to implement it, and I do not know how much may be relying on the current behavior by now. This PR implements option 2 - it is the simplest fix for my use case and although I would expect to leave plenty of opportunities to trip people, it would hopefully avoid the worst side-effects.
Checklist