9 January 2018 at 17 h 37 min #10303
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/Chaumette06a-eng.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 #10307TonioParticipant
- PRISMA Lab
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.archives-ouvertes.fr/hal-01618330/document
The control inputs are here forces exerted by the some specified actuators.
Antoine10 January 2018 at 14 h 08 min #10309
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 ?
Romain10 January 2018 at 14 h 18 min #10310
Such a plugin does exist but it’s a private plugin being currently developed in the Defrost team. Not available under open-source license.
For sure a collaboration and sharing of plugin, can be envisaged.
Hugo10 January 2018 at 14 h 23 min #10311ErwanDouailleParticipant
- Inria - Defrost
@Hugo, @rOm1, AFAIK some part of this plugin is (or will be) release.10 January 2018 at 14 h 27 min #10312
Right Erwan, a part of it should be pass to an open-source license soon.
But not sure for now about the timing.10 January 2018 at 14 h 36 min #10313
Ok 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/hal-01500912/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.
Romain10 January 2018 at 14 h 36 min #10314Damien MarchalParticipant
- CNRS/Defrost Team
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 #10411
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=cb2c0a34-50f0-ffb2-4cfb-bf4a98133bf3
The control of the actuator is performed using the LinearVelocityConstraint (https://github.com/sofa-framework/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 3D-vector (3 translations). What is the “normal” behavior ?
Romain6 February 2018 at 8 h 51 min #10454
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!
- You must be logged in to reply to this topic.