Home › Forum › SOFA › Using SOFA › Proofs with LeapMotion
Tagged: 64_bits, SOFA_1608, Windows_10
- This topic has 3 replies, 3 voices, and was last updated 7 years, 4 months ago by Hugo.
-
AuthorPosts
-
15 June 2017 at 20:09 #9330Wendy María ArangoBlocked
Hi,
Right now I’m trying to use LeapMotion with SOFA.
My question is: how do I prove that’s working?
I mean, how do I prove a scene using Leap?
I’ll be waiting for an answer.
Thanks a lot.
Wendy.
19 June 2017 at 17:22 #9336GuillaumeKeymasterHi Wendy,
Do you mean formal verification? If yes, the SOFA code source (including LeapMotion plugin) has not been through such a process yet.
Please tell us if you are interested in doing this for LeapMotion plugin. I don’t think it would be very difficult for a non-beginner since it is just a driver (there is no simulation algorithm in this plugin).Cheers,
Guillaume.27 June 2017 at 20:10 #9369Wendy María ArangoBlockedHi Guillaume,
What I meant is: how do I create a scene?
I mean, while creating, for example, a liver, what do I have to add in the scene to use LeapMotion when I run the executable?
Thanks a lot.
10 July 2017 at 13:39 #9778HugoKeymasterHi wendyarch,
If you want to add a LeapMotion to your initial SOFA scene, here is what you need:
<RequiredPlugin name="LeapMotion Driver" pluginName="LeapMotion" />
to load the LeapMotion plugin (that needs to be compiled before obviously).
Then, you need :<LeapMotionDriver name="leapMotionDriver" displayHand="true"/>
which is the interface component providing all informations from the Leap.
Finally, you can use it in your scene as detailed in applications/plugins/LeapMotion/examples:<Node name="TrackedHand" activated="true" > <Gravity name="Gravity" gravity="0 0 0" /> <Node name="TrackedPalm" > <MechanicalObject name="movingDOFs" template="Rigid" position="@../../leapMotionDriver.handPalmCoordinate" showObject="false" showObjectScale="0.02" /> </Node> <Node name="TrackedFingers" > <MechanicalObject name="movingDOFs" template="Rigid" position="@../../leapMotionDriver.fingersCoordinates" showObject="false" showObjectScale="0.02" /> </Node> </Node> <Node name="SimulatedHand" activated="true" > <VisualStyle displayFlags="showVisualModels hideBehaviorModels hideCollisionModels hideMappings hideForceFields" /> <Node name="Palm"> <Gravity name="Gravity" gravity="0 0 0" /> <MechanicalObject name="palmState" template="Rigid" rest_position="@../../leapMotionDriver.handPalmCoordinate" showObject="false" showObjectScale="0.02" /> <RestShapeSpringsForceField name="RSFF" stiffness="1e6" angularStiffness="1e3" external_rest_shape="../../TrackedHand/TrackedPalm/movingDOFs" recompute_indices="false" /> <UniformMass name="uniformMass" template="Rigid" totalmass="0.1" /> <Node name="Collision_Model" > <MechanicalObject name="collisDOFs" template="Vec3d" position="@../../../leapMotionDriver.handPalmCoordinate" /> <Sphere name="colliSphere" contactStiffness="100" group="1" radius="0.07"/> <IdentityMapping/> </Node> </Node> <Node name="Fingers" > <Gravity name="Gravity" gravity="0 0 0" /> <MechanicalObject name="handDOFs" template="Rigid" rest_position="@../../leapMotionDriver.fingersCoordinates" showObject="false" showObjectScale="0.02" /> <RestShapeSpringsForceField name="RSFF" stiffness="1e3" angularStiffness="1e3" external_rest_shape="../../TrackedHand/TrackedFingers/movingDOFs" recompute_indices="false" /> <UniformMass name="uniformMass" template="Rigid" totalmass="0.5" /> <Node name="Collision_Model" > <MechanicalObject name="lineCollisDOFs" template="Vec3d" position="@../../../leapMotionDriver.fingersCoordinates" /> <EdgeSetTopologyContainer name="EdgeContainer" nbPoints="15" edges="0 2 2 1 3 5 5 4 6 8 8 7 9 11 11 10 12 14 14 13 " position="@../../../leapMotionDriver.fingersCoordinates" /> <Node name="Sphere_Collision_Model"> <PointSetTopologyContainer name="PointContainer" /> <Mesh2PointTopologicalMapping input="@../EdgeContainer" output="@PointContainer" pointBaryCoords="0 0 0" edgeBaryCoords="0.33 0.0 0.0 0.66 0.0 0.0 " /> <MechanicalObject name="sphereCollisDOFs"/> <Mesh2PointMechanicalMapping /> <Sphere name="colliSphere" group="1" contactStiffness="1e7" contactFriction="0.05" contactRestitution="0" radius="0.0175" /> </Node> </Node> </Node> </Node>
Hope this helps,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.