Skip to content
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

Added bugfix for cloning grabbed objects. #51

Merged
merged 1 commit into from
Feb 15, 2015
Merged

Conversation

psigen
Copy link
Member

@psigen psigen commented Feb 14, 2015

Due to a bug in OpenRAVE, cloned grabbed objects may have incorrect adjacency properties, causing them to not be evaluated correctly for self collisions (with the robot). This bugfix forces cloned environments to regrab all objects, which resets these incorrect links.

@mkoval
Copy link
Member

mkoval commented Feb 15, 2015

This is likely related to rdiankov/openrave#335. It's really unfortunate that we still have these mysterious cloning issues in OpenRAVE.

In any case, it's better to have the check than to silently fail. 👍

mkoval added a commit that referenced this pull request Feb 15, 2015
Added bugfix for cloning grabbed objects.
@mkoval mkoval merged commit 951c68a into master Feb 15, 2015
@mkoval mkoval deleted the bugfix/cloning_grabbed branch February 15, 2015 21:18
@sjavdani
Copy link
Contributor

Ok, so I'm running into similar problems now (and related to #51). Looks like the following:

If you call RegrabAll, as #51 changed the code to do, the list of links to ignore for a grasped object are reset. More specifically, if I call robot.GetGrabbedInfio()[idx]._setRobotLinksToIgnore, the list is different then cloned_robot.GetGrabbedInfio()[idx]._setRobotLinksToIgnore. But if you do not call RegrabAll(), then this doesn't happen.

So regrab isn't setting the correct collision list. I don't see any way to manually modify this list. I'm not sure what regrab was helping with actually, since it is causing an error now, so I can't remove it and test to see if it doesn't break anything for anyone.

@psigen
Copy link
Member Author

psigen commented Aug 19, 2016

This behavior is extremely case-specific. While calling RegrabAll() recreates the collision list in an undesirable way in your particular case, not calling RegrabAll() can arbitrarily cause the list to change to be just plain invalid: i.e. it can have links which are neither adjacent nor non-adjacent, or both. Why this happens is very mysterious. See #255.

In any case, the robot links are set from scratch based on OpenRAVE's heuristic, which disables links that are in contact when the clone happens, as well as links flagged as adjacent in the robot XML/SRDF. You can try moving the robot to a known-good pose where it will pick the collisions that you want, then clone, then move it back in the cloned environment.

This was the best thing we could figure out to do, since nothing else was consistent. At least with this hack, the links would have the same collision list every time, and it would be something valid.

You might want to create a new issue for this, #51 is really old and doesn't show up in the tracker, and I don't think this is the issue that you are facing (rather, you are facing a side-effect of the fix for #51). You can refer to #51 in your issue, which will open a link to here.

@sjavdani
Copy link
Contributor

I'm having trouble with a collision between the robot link and a grabbed
body, not two robot links. When the object was originally grabbed, I
specified a list of links that collision should be ignored with (all finger
links). This is the list that is not copied when RegrabAll() is called. In
this case, does your suggestion say I should make sure the fingers are
touching the object before RegrabAll() is called?

What I'm really confused about is why this isnt an issue more often,
since I'm guessing closing the hand and calling grab will often mean the
hand's collision mesh is colliding with the robots. I hadn't previously
needed to manually specify links to ignore before, so am I just doing
something else in a weird order that I don't usually do?

Also, I don't see an easy way to set this list of links to ignore through
openrave's python interface. Is there one? If so, seems like the best fix
is to manually make sure the cloned and original environments have these
same properties.

On Fri, Aug 19, 2016 at 7:09 PM Pras Velagapudi [email protected]
wrote:

This is extremely case-specific. While calling RegrabAll() recreates the
collision list in your particular case, not calling RegrabAll() can
arbitrarily cause the list to change to be just plain invalid: i.e. it can
have links which are neither adjacent nor non-adjacent, or both. Why
this happens is very mysterious. See #255
#255.

In any case, the robot links are set from scratch based on OpenRAVE's
heuristic, which disables links that are in contact when the clone happens,
as well as links flagged as adjacent in the robot XML/SRDF. You can try
moving the robot to a known-good pose where it will recompute the
collisions that you want, then clone, then move it back in the cloned
environment.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#51 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACoExD4iWmibbX68VNcpdgh_FZX24Xasks5qhje8gaJpZM4Dgk0e
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants