Home › Forum › Community Help › Using SOFA › Servo control of a deformable object
Tagged: 64_bits, control, deformable, Jacobian, Linux_other, servoing, SOFA_1706
This topic contains 9 replies, has 5 voices, and was last updated by Hugo 1 year, 7 months ago.

AuthorPosts

9 January 2018 at 17 h 37 min #10303
Hello,
I would like to apply a servo control law in Sofa on a deformable object.
I explain: I would like to control a deformable object such as it reaches a desired position. To do so, I compute the error between the current position and the desired position of some control points. Knowing this error, it is (theoretically) possible to control the object using the following control law: (cf http://www.irisa.fr/lagadic/publi/publi/Chaumette06aeng.html)
v = g*L*e, where g is a gain, L is the Jacobian of the object (the derivative of the position with regard to the input control) and e is the error.From this equation, I have two questions in Sofa:
– Is it possible to get the Jacobian of an object (i.e the derivative of the position of its nodes with regard to the input control) using a Sofa function ? For instance, in Liver.scn example, when I move a point of the object, its Jacobian should (may?) be updated: how would it be possible to check its value at a new time step ?
– Do you think a LinearVelocityConstraint would be a good idea for the application of the control law ? Ohterwise, how would you do it ?Thank you for your help,
Regards10 January 2018 at 10 h 37 min #10307Hello r0m1!
If I understand well your problem, you want to control some control points on the deformable object to reach a certain deformation, in 3D or 2D (in the image) if you think of a visual servoing control law as you suggest.
– Computing the jacobian for such a problem is possible but very challenging since you need some “inverse simulation” tools to compute a compliance matrix which is somehow the equivalent to your jacobian, but which however has to be projected to 2D in the case of an image based visual servoing, through the interaction matrix of a point.
Anyway you can refer to the works by the DEFROST team (https://team.inria.fr/defrost/) in Lille which focuses on these problems, and especially to this paper: https://hal.archivesouvertes.fr/hal01618330/document
The control inputs are here forces exerted by the some specified actuators.best regards,
Antoine
10 January 2018 at 14 h 08 min #10309Hello,
First thanks for your answer ! I am going to look through the DEFROST team work and the article you mentioned.
Meanwhile, could you tell me if there are any inverse tools in Sofa or should I made my own ?
Best regards,
Romain
10 January 2018 at 14 h 18 min #10310Hi @r0m1
Such a plugin does exist but it’s a private plugin being currently developed in the Defrost team. Not available under opensource license.
For sure a collaboration and sharing of plugin, can be envisaged.Best,
Hugo
10 January 2018 at 14 h 23 min #10311@hugo, @rOm1, AFAIK some part of this plugin is (or will be) release.
10 January 2018 at 14 h 27 min #10312Right Erwan, a part of it should be pass to an opensource license soon.
But not sure for now about the timing.10 January 2018 at 14 h 36 min #10313Ok it would be really nice to get in touch with the people developing this plugin to get some advises or to begin a collaboration !
For the moment I found these articles
https://hal.inria.fr/hal01500912/file/RAL2017.pdf [COEVOET, E. et al, 2017]
http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6631138 [DURIEZ, C. 2013]
which seem to be an interesting starting point for what I want to do.Regards,
Romain
10 January 2018 at 14 h 36 min #10314Hi all,
As Erwan said, the public part of SoftRobot plugin is now ready and it will be released this month. But inverse control of the robots will not be part of that public version. So if this is the part that interest you I would say that the best is to contact Christian Duriez (Defrost team leader).
Regards,
1 February 2018 at 9 h 17 min #10411Hello,
First, absolutely sorry for this late response, I had to take care of others programming stuffs these last few weeks.
I tried to implement a velocity controller on an actuator to shape control a deformable object. To do so, I use the Broyden algorithm to numerically estimate the inverse Jacobian of the deformation of the object with regards to the actuator displacements. You can find the scripts and meshes here: https://filesender.renater.fr/?s=download&token=cb2c0a3450f0ffb24cfbbf4a98133bf3
The control of the actuator is performed using the LinearVelocityConstraint (https://github.com/sofaframework/sofa/blob/0f41388d84b6990d0edf240000f8ffa69bf3d735/modules/SofaBoundaryCondition/LinearVelocityConstraint.h) and that is where it does not work. Indeed, the MechanicalObject on which the LinearVelocityConstraint should be applied does not move. Could you explain me the following things:
– What does the attribute “coordinates” means ? It is described as “the coordinates on which to applay velocities” but what is the difference with the attribute “indices” for instance ?
– I tried to use the LinearVelocityConstraint in the example examples/Components/constraint/LinearMovementConstraint.scn replacing the LinearMovementConstraint. In this case, the LinearVelocityConstraint took a 6D vector (3 translations, 3 rotations) while when I am trying to use it with a FastTetrahedronFEMForceField it just expects a 3Dvector (3 translations). What is the “normal” behavior ?
Regards,
Romain6 February 2018 at 8 h 51 min #10454Hi r0m1
A short advice with SOFA : when you have such a question about a Data of a component do not hesitate to have a quick look into the source code.
For instance, I did not know and do not use the LinearVelocityConstraint. However, if I look at line 206 (and following) in the projectVelocity() function, I noticed that :
 indices: is an integer, standing for the indices of the vertices on which the constraint is applied,
 coordinates: is an integer, corresponding to the coordinate(s) x, y or z, i.e. coordinates=”0 1″ the constraint is applied only along x and y. If no coordinate is defined, the constraint is applied on all directions x,y and z.
I hope this helps you!
Cheers,Hugo

AuthorPosts
You must be logged in to reply to this topic.