General description
One can simulate an actuator that applies forces to solve a position effector constraint. The “PositionEffector” component is used to constrain one or several points of a model to reach desired positions, by acting on chosen actuator(s).
Methods description
Requirement: Real time inverse simulation method
Method
Here, J will contain the identity on the effector positions index.
How to use the component
To learn how to create a SOFA scene, please refer to the tutorial provided by the SOFA Modeler or this documentation.
This component works as follow:
effector.createObject('MechanicalObject', name='effectorPoint', position="-4.72055 1.13543 3.10608') effector.createObject('PositionEffector', indices='0', effectorGoal='-4 1 0')
Effectors are given by setting the variable “indices” to the corresponding indices in the “MechanicalObject” (green point in the following illustrated example). You also need to give an effector goal (yellow point).
For an interactive control of the effector, you can link the effector goal to another “MechanicalObject”:
effector.createObject('PositionEffector', indices='0', effectorGoal='@../../goal/goalMO.position')
To solve the inverse problem set by this component coupled with actuator component(s), you have to use an inverse problem solver component (for exemple QPInverseProblemSolver) and put it in the top of the scene graph.
An example is provided in the “examples” directory of the plugin.
Special issues
This component exists in two versions, with and without the suffix “GS”.Using the “PositionEffectorGS” means that you will use the Gauss Seidel resolution. Thus, the inverse problem solver of your scene must be the “GenericConstraintSolver”. Make sure that the actuator used also has the suffix “GS”. In this particular case, the effector component must be set before the actuator in the scene.
Data field
Here are described the data fields corresponding to this particular component.
Input data
indices : Effector indices in the context mechanical state. If not set, default value 0 will be taken.
effectorGoal : Desired positions for each effectors. If not the same size as indices, the size of the smallest one will be taken.
axis : Directions in which you want to solve the effector. Default value is true for all three directions i.e (1, 1, 1).
Output data
no output data