-
Notifications
You must be signed in to change notification settings - Fork 345
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
Skip grab saver for unjointed bodies #1484
Conversation
@snozawa Can you approve this? Thanks |
…ver-for-unjointed-bodies
…ver-for-unjointed-bodies
src/libopenrave/kinbodygrab.cpp
Outdated
_listNonCollidingIsValid = false; | ||
const bool bDisableRestoreOnDestructor = true; // This is very important! These saver are used only in ComputeListNonCollidingLinks and we don't want to restore on destructor. | ||
static const int saverOptions = KinBody::Save_LinkTransformation | KinBody::Save_LinkEnable | KinBody::Save_JointLimits | KinBody::Save_ConnectedBodies; |
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.
@rdiankov cc @rschlaikjer While checking this code, I noticed that KinBody::ComputeInverseDynamics
doesn't seem to care about grabbed. Is it intentional that ComputeInverseDynamics
doesn't consider grabbed?
_CreateSaverForGrabbedAndGrabber(_pGrabbedSaver, | ||
pGrabbedBody, | ||
KinBody::Save_LinkTransformation|KinBody::Save_LinkEnable|KinBody::Save_JointLimits, | ||
saverOptions, |
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.
If someone tries to set velocity of a currently grabbed kinbody, should we reject it because its velocity is determined by the grabbing link? If such guarantee exists that body's velocity doesn't get modified while being grabbed, it is fine to not save at the time of grabbing and restore at the time of releasing. @rdiankov @rschlaikjer
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.
Should be okay if velocity is not saved..
src/libopenrave/kinbodygrab.cpp
Outdated
_listNonCollidingIsValid = false; | ||
const bool bDisableRestoreOnDestructor = true; // This is very important! These saver are used only in ComputeListNonCollidingLinks and we don't want to restore on destructor. | ||
static const int saverOptions = KinBody::Save_LinkTransformation | KinBody::Save_LinkEnable | KinBody::Save_JointLimits | KinBody::Save_ConnectedBodies; |
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 @rschlaikjer !
Apart from Save_LinkVelocities
, why you added Save_ConnectedBodies
?
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.
Also, Save_LinkVelocities
are removed from constructor, but still in ComputeListNonCollidingLinks
.
Is this just in case?
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.
Hmm, not sure where that came from - might have been an intermediate change. Since it gets added in _CreateSaverForGrabbedAndGrabber
for robots shouldn't be needed as you say, removed.
For velocities, I think you're right - if we don't save/restore it using the grab saver, it should be fine to not save/restore it in ComputeListNonColliding.
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.
Internal tests re-run and pass using controllercommon MR 1185 pipeline 1072255
…ver-for-unjointed-bodies
…pute non colliding
…ver-for-unjointed-bodies
thanks~ |
ComputeListNonCollidingLinks
(all links are rigidly attached to the grabbing link)ComputeListNonCollidingLinks
savers (has no impact on collision?)ComputeInternalInformation