Home › Forum › SOFA › Using SOFA › [SOLVED] How to not-check some collisions?
Tagged: 32_bits, Articulation, autocollision, collision, Linux_ubuntu, SOFA_1503
- This topic has 5 replies, 2 voices, and was last updated 8 years, 1 month ago by jnbrunet.
-
AuthorPosts
-
24 November 2016 at 11:10 #7970luibass92Blocked
Hi everyone,
I’ve created a robotic hand in SOFA composed by 5 articulated chains (one for each finger) with relative meshes for each part of each finger. So it is a quite crowded scene.
My problem is that the collision checking algorithm tries to check collisions between each part of each finger and other parts of the hand, so it becomes computationally really heavy and the simulation runs slow.
Fortunately I don’t need to check collisions between the parts of the hand but just with other objects that I can add in the scene, so I would like to disable the collision-checking algorithm between parts of the hand, but take it enabled between the parts of the hand and other objects in the scene.
Can someone help me with this issue?
Cheers,
Luigi
24 November 2016 at 11:31 #7971jnbrunetModeratorHi Luigi,
Try setting a same group number for each of your collision models (ex: triangle, line ,point, etc).
<CollisionPipeline /> <BruteForceDetection /> <DefaultContactManager /> <MinProximityIntersection alarmDistance="1" contactDistance="0.5"/> <Node name="Hand" /> <Node name="Thumb" /> <Triangle group="1" /> <Line group="1" /> <Point group="1" /> ... </Node> <Node name="Index" /> <Triangle group="1" /> <Line group="1" /> <Point group="1" /> ... </Node> ... </Node> <Node name="Everything Else" /> <Node name="Something" /> <Triangle group="2" /> <Line group="2" /> <Point group="2" /> ... </Node> </Node>
Let me know if that works.
24 November 2016 at 11:42 #7973luibass92BlockedHi jnbrunet,
in my code I used this collision methods:
<Node name="Index"> <Node name="Collision" activated="1"> <MeshObjLoader name="MeshLoader" filename="mesh/index1.obj" scale="100" translation="0 -3 0" rotation="0 0 0"/> <Mesh src="@MeshLoader" /> <MechanicalObject template="Vec3d" src="@MeshLoader" /> <TriangleModel /> <LineModel /> <RigidMapping input="@.." index="0" /> </Node> <Node name="Collision" activated="1"> <MeshObjLoader name="MeshLoader" filename="mesh/index2.obj" scale="100" translation="0 -3 0" rotation="0 0 0"/> <Mesh src="@MeshLoader" /> <MechanicalObject template="Vec3d" src="@MeshLoader" /> <TriangleModel /> <LineModel /> <RigidMapping input="@.." index="1" /> </Node> . . All the other parts of the index finger... . </Node> <Node name="Thumb"> <Node name="Collision" activated="1"> <MeshObjLoader name="MeshLoader" filename="mesh/thumb1.obj" scale="100" translation="0 -3 0" rotation="0 0 0"/> <Mesh src="@MeshLoader" /> <MechanicalObject template="Vec3d" src="@MeshLoader" /> <TriangleModel /> <LineModel /> <RigidMapping input="@.." index="0" /> </Node> <Node name="Collision" activated="1"> <MeshObjLoader name="MeshLoader" filename="mesh/thumb2.obj" scale="100" translation="0 -3 0" rotation="0 0 0"/> <Mesh src="@MeshLoader" /> <MechanicalObject template="Vec3d" src="@MeshLoader" /> <TriangleModel /> <LineModel /> <RigidMapping input="@.." index="1" /> </Node> . . All the other parts of the thumb finger... . </Node> And so on for each finger.....
In this case how can I choose a group?
Thanks for your interest, Luigi
24 November 2016 at 11:48 #7974jnbrunetModeratorHey Luigi,
<Triangle /> <Line />
Are simply aliases to
<TriangleModel /> <LineModel />
So, in your case, you would to that
<Node name="Index"> <Node name="Collision" activated="1"> <MeshObjLoader name="MeshLoader" filename="mesh/index1.obj" scale="100" translation="0 -3 0" rotation="0 0 0"/> <Mesh src="@MeshLoader" /> <MechanicalObject template="Vec3d" src="@MeshLoader" /> <TriangleModel group="1" /> <LineModel group="1" /> <RigidMapping input="@.." index="0" /> </Node> <Node name="Collision" activated="1"> <MeshObjLoader name="MeshLoader" filename="mesh/index2.obj" scale="100" translation="0 -3 0" rotation="0 0 0"/> <Mesh src="@MeshLoader" /> <MechanicalObject template="Vec3d" src="@MeshLoader" /> <TriangleModel group="1" /> <LineModel group="1" /> <RigidMapping input="@.." index="1" /> </Node> . . All the other parts of the index finger... . </Node> <Node name="Thumb"> <Node name="Collision" activated="1"> <MeshObjLoader name="MeshLoader" filename="mesh/thumb1.obj" scale="100" translation="0 -3 0" rotation="0 0 0"/> <Mesh src="@MeshLoader" /> <MechanicalObject template="Vec3d" src="@MeshLoader" /> <TriangleModel group="1" /> <LineModel group="1" /> <RigidMapping input="@.." index="0" /> </Node> <Node name="Collision" activated="1"> <MeshObjLoader name="MeshLoader" filename="mesh/thumb2.obj" scale="100" translation="0 -3 0" rotation="0 0 0"/> <Mesh src="@MeshLoader" /> <MechanicalObject template="Vec3d" src="@MeshLoader" /> <TriangleModel group="1" /> <LineModel group="1" /> <RigidMapping input="@.." index="1" /> </Node> . . All the other parts of the thumb finger... . </Node>
And than choose another group number for every other collision models of the objects of your scene that are not a hand’s components.
Jean-Nico
24 November 2016 at 11:49 #7975luibass92BlockedOK, I tried adding to each
<TriangleModel/>
and<LineModel/>
the same “group” and the simulation goes way faster than before!Thanks a lot for your help!
Cheers,
Luigi24 November 2016 at 11:52 #7976jnbrunetModeratorVery well!
I will mark this topic as resolved. Please do not hesitate if you have any further questions.
Jean-Nico
-
AuthorPosts
- You must be logged in to reply to this topic.