-
Notifications
You must be signed in to change notification settings - Fork 344
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
Grabbed, CheckSelfCollision, and unordered grabbed bodies issues. #1436
Comments
Reproduction for Issues
How to run Issue1 test
How to run Issue2 test
How to run Issue3 test
How to run Issue4 test
|
snozawa
pushed a commit
that referenced
this issue
Sep 25, 2024
- Issue - This commit tries to improve the reported issue1, issue2, and issue3 : #1436 - Previously, _listNonCollidingLinksWhenGrabbed is asymmetric : the results obtained from grabbedBody1 is not same as the results obtained from grabbedBody2. - However, many codes in CheckSelfCollision assumes it's symmetric. The assumption was broken. In addition, such breakage was amplified after #1421. - Resolution - Instead of store the target link like the previous _listNonCollidingLinksWhenGrabbed_, store the information about the link pairs. This is more accurate and the same methodologies as non-adjacent-links in self colision checking. - Separate grabbed-grabber link pair and inter-grabbed link pair. - grabbed-grabber link pair, e.g. object-robot link pair, still exists in the Grabbed class as before. - inter-grabbed link pair now exists in the KinBody class, since if it's held in Grabbed, it becomes inconsistent and asymmetric. - Following the same methodologies in #1421, inter-grabbed link pairs are stored as unordered_map, and its key is combined env body indices of two grabbed bodies.
snozawa
pushed a commit
that referenced
this issue
Oct 19, 2024
… it means pOtherGrabbed is grabbed later than 'this'. Thus, pOtherGrabbed did not exist when 'this' was grabbed. The results of lazy computation should be same as the result of non-lazy computation. Therefore, we should not compute the inter-grabbed collision checking with pOtherGrabbed. This resolves Issue4 in #1436.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Grabbed
andCheckSelfCollision
originally had a problem, but it's quite amplified when we introducedunordered_set
for grabbed bodies in Optimize IsGrabbing / ResetGrabbed #1421.Issue1
How to run Issue2 test
in Grabbed, CheckSelfCollision, and unordered grabbed bodies issues. #1436 (comment)grabbedBody1
andgrabbedBody2
. These are grabbed by different links, e.g. the robot needs to care about the self collision between these two.CheckSelfCollision
assumes that the collision checking is symmetric, e.g. order ofgrabbedBody1
andgrabbedBody2
does not matter. Also, the code is optimized by utilizing this assumption, for example:for
loop :openrave/src/libopenrave/kinbodycollision.cpp
Lines 151 to 152 in 8b196c7
_listNonCollidingLinksWhenGrabbed
:openrave/src/libopenrave/kinbodycollision.cpp
Line 174 in 8b196c7
openrave/src/libopenrave/kinbodycollision.cpp
Line 181 in 8b196c7
Grabbed
forgrabbedBody1
might containgrabbedBody2
in_listNonCollidingLinksWhenGrabbed
. But,Grabbed
forgrabbedBody2
mignt not containgrabbedBody1
. So, the internal data are asymmetric.nonCollidingLinks1
andnonCollidingLinks2
are symmetric. But, if it's not symmetric, likenonCollidingLinks1=[]
andnonCollidingLinks2=[grabbedBody1]
, the code does not entercontinue
, and thus, it check collision betweengrabbedBody1
andgrabbedBody2
. But in the next iteration here, it started checking aboutgrabbedBody2
, and since it containsgrabbedBody1
in the list, it checks the collision betweengrabbedBody1
andgrabbedBody2
again. I confirmed that same collision paris are checked twice from print message.in some case
andmight
, since the whole situation is governed by the ordering byunordered_set
. Thus, the overall behavior looks quite undeterministic, and checking result might be flaky according to the situation.unordered_set
for grabbed bodies as it is, and fix the problems in other part, like the followings:CheckSelfCollision
._listNonCollidingLinksWhenGrabbed
symmetric.CheckSelfCollision
, and it might increase the computation. Instead, I guess 2 might be reasonable and now I'm trying 2.Issue2
How to run Issue1 test
in Grabbed, CheckSelfCollision, and unordered grabbed bodies issues. #1436 (comment)A
andB
. Both of them are grabbed by differetn links, and both of them has two links (A1, A2
andB1, B2
). Also, initiallyA2
andB2
are colliding.A
'sComputeListNonCollidingLinks
is called first:A
's_listNonCollidingLinksWhenGrabbed
becomes[]
related to the asymmetricity inIssue1
.B
's_listNonCollidingLinksWhenGrabbed
contains[A1]
, sinceA1
is only collision free link.CheckSelfCollision
, inB
's iteration, it iterates withB1
andB2
. So, the considered pairs are(A1, B1)
and(A1, B2)
.A
's iteration does not check anything sice_listNonCollidingLinksWhenGrabbed
is empty.B
'sComputeListNonCollidingLinks
is called first:B
's_listNonCollidingLinksWhenGrabbed
becomes[]
related to the asymmetricity inIssue1
.A
's_listNonCollidingLinksWhenGrabbed
contains[B1]
, sinceB1
is only collision free link.CheckSelfCollision
, inA
's iteration, it iterates withA1
andA2
. So, the considered pairs are(A1, B1)
and(A2, B1)
.B
's iteration does not check anything sice_listNonCollidingLinksWhenGrabbed
is empty.CheckSelfCollision
.(A1, B2)
is skipped.Issue1
.unordered_set
._listNonCollidingLinksWhenGrabbed
, we computelink vs body
collision, instead oflink vs link
collision. Thus, the information about the pairs are not preserved. This also causes another kind of asymmetricity._listNonCollidingLinksWhenGrabbed
, it's reasonable.A
andB
have collision, these are not added to_listNonCollidingLinksWhenGrabbed
. Thus, bothA
's_listNonCollidingLinksWhenGrabbed
andB
's_listNonCollidingLinksWhenGrabbed
are empty. I think this case is consistent.A
andB
._listNonCollidingLinksWhenGrabbed
stores the pair ofLinkConstPtr
in some way. The result of the picture is,_listNonCollidingLinksWhenGrabbed=[(1, B1), (A1, B2), (A2, B1)]
and we can make it symmetric betweenA
andB
._listNonCollidingLinksWhenGrabbed
. Might take time to compute inComputeListNonCollidingLinks
.Policy 2
and make it symmetric somehow.Issue3
How to run Issue3 test
in Grabbed, CheckSelfCollision, and unordered grabbed bodies issues. #1436 (comment)CheckSelfCollision
call, the contents of_listNonCollidingLinksWhenGrabbed
might be different from the laterCheckSelfCollision
call.Grabbed::ComputeListNonColliding
will remove the otherGrabbed
's information inRelease
.Issue4
How to run Issue4 test
in Grabbed, CheckSelfCollision, and unordered grabbed bodies issues. #1436 (comment)_ListNonCollidingLinksWhenGrabbed
is introduced in Lazy Computation of List Non-Colliding Links #1038Grabbed
is constructed, list is computed. After that,Grabbed
constructor do nothing, and when we callCheckSelfCollision
at the first time, list is computed, byComputeListNonCollidingLinks
.ComputeListNOnCollidingLinks
. However, it's changing.grabbedBody1
, and thengrabbedBody2
,Grabbed
forgrabbedBody1
should not know about thegrabbedBody2
, since it was not there whengrabbedBody1
is grabbed. However, when we postpone the computation,grabbedBody1
might consider the collision checking withgrabbedBody2
.unordered_map
.cc @Puttichai @rschlaikjer @yoshikikanemoto @kanbouchou @rdiankov
The text was updated successfully, but these errors were encountered: