Step 5: setting actuator limits

You can download the file associated with this step at:
http://sofamacbuilder.lille.inria.fr/defrost/scenes/Tutorial/step5-ActuatorLimits/Finger.py

In the previous steps, we showed how to control the deformation of the soft robot by actuator control (direct simulation) or effector control (inverse simulation). We can additionnally put some limits on the actuators: maximum force, maximum displacement... For a cable, we assume that the force can not be negative: it pulls but can not push.

finger_6.png

To implement this behavior you need to replace the lines that create the  CableActuor object with this one setting the maxPositiveDisp parameter to the maximum allowed value for the actuator:

cable.createObject('CableActuator', name="aCable", 
                        indices='0 1 2 3 4 5 6 7 8 9 10 11 12 13', 
                        pullPoint="0.0 12.5 12.5",
                        maxPositiveDisp="40")


How to use the demo ?

After clicking on "Animate", you can select the orange sphere (SHIFT + click left) and move it around.

If you try to impose a displacement on the effector that exceeds the maximum displacement allowed on the cable, the optimization finds the minimal reachable distance to the goal. You can edit this maximum allowed displacement from the SOFA GUI. First click on the scene graph (left side of the GUI) in the component "CableActuator"; see Property 2/2 and edit the field maxPositiveDisp (for instance put 20 instead of 40: it means that the maximum displacement in the pulling direction is now 20mm). Then click on Update and retry. You should obtain this:

finger_7.png