Home › Forum › SOFA › Using SOFA › How to exert a torque on an ArticulatedSystemMapping?
- This topic has 3 replies, 2 voices, and was last updated 4 years ago by Hugo.
-
AuthorPosts
-
19 October 2020 at 09:10 #17414billBlocked
I am trying to create a robotic arm, where each join in the arm can be commanded a torque and it will turn. So far I have an Articulated system mapping set up where I can command the position of each joint, but I would like to command the torque. Any ideas?
30 October 2020 at 14:43 #17492HugoKeymasterHi @bill757
Thank you for your question and welcome on the forum!
Looking at the example scene examples/Components/mapping/ArticulatedSystemMapping.scn, you can for instance access the DOF of the Vec1d MechanicalObject in the node “restarticulation”. This MechanicalObject contains the rotation angle of this articulated chain.
I think this is what you are looking for.
Best wishes,Hugo
13 November 2020 at 22:44 #17660billBlockedThanks,
Yes I can control the position of the joint using this, but how can I control the torque? I can’t apply a TorsionForceField on this component because it is incompatible with Vec1d.
4 December 2020 at 22:44 #17936HugoKeymasterHi @bill757
I will base my example still on the scene examples/Components/mapping/ArticulatedSystemMapping.scn, here note the use of the TorsionForceField :
<Node> <EulerImplicitSolver name="cg odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver iterations="100" name="linear solver" threshold="1e-20" tolerance="1e-20" /> <Node name="restarticulation"> <MechanicalObject name="rest" template="Vec1d" position="0 0 0 0" /> <FixedConstraint indices="0 1 2 3" /> </Node> <Node name="articulation"> <MechanicalObject name="Articulations" template="Vec1d" position="0 0 0 0" /> <Node> <MechanicalObject template="Rigid3d" name="DOFs" position="0 0 0 0 0 0 1 1 0 0 0 0 0 1 3 0 0 0 0 0 1 5 0 0 0 0 0 1 7 0 0 0 0 0 1" /> <BeamFEMForceField name="FEM" radius="0.1" youngModulus="1e8" poissonRatio="0.45"/> <MeshTopology name="lines" lines="0 1 1 2 2 3 3 4 " /> <UniformMass template="Rigid3d" name="mass" vertexMass="0.1 0.1 [1 0 0,0 1 0,0 0 1]" /> <FixedConstraint template="Rigid3d" name="fixOrigin" indices="0" /> <TorsionForceField indices="2" torque="00" axis="0 0 1"/> <ArticulatedSystemMapping input1="@../Articulations" output="@DOFs" /> <Node name="Collision"> <MechanicalObject template="Vec3d" position="-1 -0.5 -0.5 -1 0.5 -0.5 -1 0.5 0.5 -1 -0.5 0.5 1 -0.5 -0.5 1 0.5 -0.5 1 0.5 0.5 1 -0.5 0.5 -1 -0.5 -0.5 -1 0.5 -0.5 -1 0.5 0.5 -1 -0.5 0.5 1 -0.5 -0.5 1 0.5 -0.5 1 0.5 0.5 1 -0.5 0.5 -1 -0.5 -0.5 -1 0.5 -0.5 -1 0.5 0.5 -1 -0.5 0.5 1 -0.5 -0.5 1 0.5 -0.5 1 0.5 0.5 1 -0.5 0.5 -1 -0.5 -0.5 -1 0.5 -0.5 -1 0.5 0.5 -1 -0.5 0.5 1 -0.5 -0.5 1 0.5 -0.5 1 0.5 0.5 1 -0.5 0.5" /> <MeshTopology lines="0 1 1 2 2 3 3 0 1 5 5 4 4 0 5 6 6 7 7 4 2 6 7 3 8 9 9 10 10 11 11 8 9 13 13 12 12 8 13 14 14 15 15 12 10 14 15 11 16 17 17 18 18 19 19 16 17 21 21 20 20 16 21 22 22 23 23 20 18 22 23 19 24 25 25 26 26 27 27 24 25 29 29 28 28 24 29 30 30 31 31 28 26 30 31 27" triangles="3 1 0 3 2 1 3 6 2 3 7 6 7 5 6 7 4 5 4 1 5 4 0 1 5 1 2 2 6 5 4 7 3 4 3 0 11 9 8 11 10 9 11 14 10 11 15 14 15 13 14 15 12 13 12 9 13 12 8 9 13 9 10 10 14 13 12 15 11 12 11 8 19 17 16 19 18 17 19 22 18 19 23 22 23 21 22 23 20 21 20 17 21 20 16 17 21 17 18 18 22 21 20 23 19 20 19 16 27 25 24 27 26 25 27 30 26 27 31 30 31 29 30 31 28 29 28 25 29 28 24 25 29 25 26 26 30 29 28 31 27 28 27 24" /> <TriangleCollisionModel /> <LineCollisionModel /> <RigidMapping rigidIndexPerPoint="0 8 8 8 8" /> </Node>
Is this what you need?
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.