Home › Forum › SOFA › Using SOFA › VectorSpringForceField not working with ArticulatedSystemMapping
Tagged: ArticulatedSystemMapping, Linux_ubuntu, SOFA_2012
- This topic has 1 reply, 2 voices, and was last updated 3 years, 1 month ago by Hugo.
-
AuthorPosts
-
9 July 2021 at 21:08 #20000BrunoB81HKBlocked
Hi!
I’m currently trying to use the
ArticulatedSystemMapping
to implement a grabbing system in a scene. It seems to work as expected.My next step would be to link the articulated system to a reference model with a
VectorSpringForceField
like in the Geomagic plugin examples. When trying to do this, I can’t seems to make it move.As a sanity check, I tried to use
input2
with the reference model directly and it moved with the reference. The thing is, I need aVectorSpringForceField
for contact stability reasons.My scene can be illustrated as this image :
where :
(1) is 3Rigid3d
mechanical objects (Shaft, LeftJaw and RightJaw). (@Instrument/Trex/DOFs in scene)
(2) is aVec3d
mechanical object (Shaft). (@Instrument/Trex/Ref/RefModel in scene)
(3) is 3Vec3d
mechanical objects (a -> Shaft, b -> LeftJaw and c -> RightJaw). (@Instrument/Jaw/Models/*Col/*ColModel in scene)
(4) is 3Rigid3d
mechanical object using theArticulatedSystemMapping
. (@Instrument/Jaw/Models/DOFs in scene)The significant part of the scene is as follow :
<Node name="Instrument"> <Node name="Trex"> <MechanicalObject name="DOFs" template="Rigid3d" size="3" position="@TrexDriver.positionsGrab"/> <Node name="Ref"> <MeshObjLoader name="loader" filename="../../mesh/Instrument/ShaftCol.obj"/> <MeshTopology src="@loader"/> <MechanicalObject name="RefModel" src="@loader"/> <RigidMapping input="@../DOFs" output="@RefModel" index="0"/> </Node> <Node name="ShaftVis" activated="true" > <MeshObjLoader name="loader" filename="../../mesh/Instrument/Shaft.obj"/> <OglModel name="TrexVisModel" src="@loader" color="0.17 1.00 1.00 1.00"/> <RigidMapping input="@../DOFs" output="@TrexVisModel" index="0"/> </Node> <Node name="LeftJawVis" activated="true" > <MeshObjLoader name="loader" filename="../../mesh/Instrument/PokeL.obj"/> <OglModel name="TrexVisModel" src="@loader" color="0.17 1.00 1.00 1.00"/> <RigidMapping input="@../DOFs" output="@TrexVisModel" index="1"/> </Node> <Node name="RightJawVis" activated="true" > <MeshObjLoader name="loader" filename="../../mesh/Instrument/PokeR.obj"/> <OglModel name="TrexVisModel" src="@loader" color="0.17 1.00 1.00 1.00"/> <RigidMapping input="@../DOFs" output="@TrexVisModel" index="2"/> </Node> <Node name="Base"> <MechanicalObject name="DOFs" template="Rigid3d" position="@TrexDriver.positionPoke"/> </Node> </Node> <Node name="Jaws"> <MechanicalObject name="Joints" template="Vec1d" size="2" position="@TrexDriver.pliersAngles"/> <Node name="Models"> <MechanicalObject name="DOFs" template="Rigid3d" size="3"/> <!-- Shaft --> <Node name="ShaftVis"> <MeshObjLoader name="loader" filename="../../mesh/Instrument/Shaft.obj"/> <OglModel name="ShaftVisualModel" src="@loader"/> <RigidMapping input="@../DOFs" output="@ShaftVisualModel" index="0"/> </Node> <Node name="ShaftCol"> <MeshObjLoader name="loader" filename="../../mesh/Instrument/ShaftCol.obj"/> <MeshTopology src="@loader"/> <MechanicalObject name="InstrumentColModel" src="@loader"/> <PointCollisionModel contactStiffness="10"/> <RigidMapping input="@../DOFs" output="@InstrumentColModel" index="0"/> </Node> <!-- Left jaw --> <Node name="JawLeftVis"> <MeshObjLoader name="loader" filename="../../mesh/Instrument/PokeL.obj"/> <OglModel name="JawLeftVisualModel" src="@loader"/> <RigidMapping input="@../DOFs" output="@JawLeftVisualModel" index="1"/> </Node> <Node name="JawLeftCol"> <MeshObjLoader name="loader" filename="../../mesh/Instrument/JawCol.obj"/> <MeshTopology src="@loader"/> <MechanicalObject name="JawLeftColModel" src="@loader"/> <PointCollisionModel contactStiffness="10"/> <RigidMapping input="@../DOFs" output="@JawLeftColModel" index="1"/> </Node> <!-- Right jaw --> <Node name="JawRightVis"> <MeshObjLoader name="loader" filename="../../mesh/Instrument/PokeR.obj"/> <OglModel name="JawRightVisualModel" src="@loader"/> <RigidMapping input="@../DOFs" output="@JawRightVisualModel" index="2"/> </Node> <Node name="JawRightCol"> <MeshObjLoader name="loader" filename="../../mesh/Instrument/JawCol.obj"/> <MeshTopology src="@loader"/> <MechanicalObject name="JawRightColModel" src="@loader"/> <PointCollisionModel contactStiffness="10"/> <RigidMapping input="@../DOFs" output="@JawRightColModel" index="2"/> </Node> <ArticulatedSystemMapping input1="@../Joints" input2="@../../Trex/Base/DOFs" output="@DOFs"/> </Node> <ArticulatedHierarchyContainer/> <Node name="ArticulationDef"> <Node name="Left"> <ArticulationCenter parentIndex="0" childIndex="1" posOnParent="0 0 0" posOnChild="0 0 0"/> <Node name="Articulation"> <Articulation translation="0" rotation="1" rotationAxis="0 0 1" articulationIndex="0"/> </Node> </Node> <Node name="Right"> <ArticulationCenter parentIndex="0" childIndex="2" posOnParent="0 0 0" posOnChild="0 0 0"/> <Node name="Articulation"> <Articulation translation="0" rotation="1" rotationAxis="0 0 1" articulationIndex="1"/> </Node> </Node> </Node> </Node> <VectorSpringForceField template="Vec3d" object1="@Trex/Ref/RefModel" object2="@Jaws/Models/ShaftCol/InstrumentColModel" stiffness="1000" viscosity="0" printLog="1"/> </Node>
I’m not quite sure where to go from here and I would like some help!
Thanks a lot and have a nice day.
Bruno
27 September 2021 at 22:56 #20431HugoKeymasterHey @brunob81hk
Sorry for replying so late but I was hoping someone else (better than me on the topic) would have answered.
I never built a simulation with a jaw model for grasping. I guess you got inspired from both the Xitact and Geomagic examples.
Without the meshes I cannot run the scene, let me know if you are willing to share them.
Could you try using :
input2="@DOFs"
?
You would have the articulated system independent from the Trex position but managing the opening/closing of the jaw. The “Trex” node in charge of following the Trex device and the VectorSpringFF connecting the two for stability.Let me know if it helps.
@epernod if you recall how to build a jaw model it is also welcome 😉Sorry for being approximated Bruno,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.