raisimTech / raisimLib

Visit www.raisim.com
http://www.raisim.com
Other
343 stars 94 forks source link

Question about raisim's internal contact detection of articulated system #537

Closed sbs0323 closed 10 months ago

sbs0323 commented 10 months ago

To prof.Hwangbo I have a question about contact detection mechanism.

There are two contact spheres in (n)th body of articulated system and (n+1) th body has a contact box.

They are connected with prismatic and revolute joint like below figure. And I also gave the option (about internal collision with parent body).

raisim::ArticulatedSystemOption s1; s1.doNotCollideWithParent = false; world->addArticulatedSystem(resourceDir + urdf_filepath,"",{},raisim::CollisionGroup(1), raisim::CollisionGroup(-1), s1);

When two bodies come close to each other through a joint, there will be collision. If they are seperated articulated systems, there are two contact points. so there was no penetration. But there is only one collision always, in case of internal contact. Can i fix this situation?

image

jhwangbo commented 10 months ago

A child body can collide with any bodies of the same articulated system except its parent body. If it can collide with its parent, most of the URDF's on the web will be useless. All robots are designed in a way that the child body can collide with its parent body only at the joint limits. No other collisions should be possible.

sbs0323 commented 10 months ago

Actually, there is dummy link between revolute joint and prismatic joint. body1 - revolute joint - dummy - prismatic joint - body2 they were not directly parent and child. There was only one contact point, when joints was not limited.

To make two contact points, should i just seperate an articulated system into two systems ?

And, it seems that there is a special option in articulated system can make it possible. => raisim::ArticulatedSystemOption s1; s1.doNotCollideWithParent = false;

jhwangbo commented 10 months ago

Now I remember what I did. There is a limit in the number of internal collision between two bodies. I think that is set to 1. Unfortunately, you cannot tune this. I'll make it adjustable in the next push

sbs0323 commented 10 months ago

Thank you for update. I checked some recent pushes and updated. However, the problem is not solved yet... If there is something new, Could you explain how to handle the limit number of internal collision?

jhwangbo commented 10 months ago

Can you pull and test?

sbs0323 commented 10 months ago

It works with setAllowedNumberOfInternalContactsBetweenTwoBodies(). thank you.