1 August 2019 at 18 h 52 min #14055
There is another problem I came across, if you can please help. The values of an object’s massDensity change only after I press the “Update” button from the GUI. I am updating the values like
I can see a change when I print the value but it does not change in the simulation until I press the update button on the GUI.
Rishabh8 August 2019 at 11 h 52 min #14072
Hello, on further investigation I found out that using ‘UniformMass’ instead of ‘DiagonalMass’ lets me update the mass of the object when resetting. But there are many other parameters of the cloth simulation, such as TriangularFEMForceField.youngModulus and TriangularBendingSprings.stiffness that I want to update but it is not happening in the simulation.
One interesting thing is that I am able to update the ‘rayleighstiffness’ but not the ‘stiffness’ of the springs. Any insights would be appreciated
Rishabh13 August 2019 at 18 h 17 min #14102
You are touching a hot topic!
We are currently discussing and changing the API of SOFA to make sure that updates can be made and are properly and consistently taken into account on the fly during the simulation.
Can you specify what you intend to do exactly? Why and which values you need to update? (just for my understanding)
Hugo14 August 2019 at 17 h 24 min #14119
I have a simulation of a cloth, and I want to change it’s physical parameters such as mass, damping and stiffness from BendingSprings force field, and YoungModulus and PoissonRatio from TriangularFEMForceField.
In Robotics we have a technique called Domain Randomization where we can directly transfer control policies from Simulation to a real robot by randomizing certain parameters in the simulation itself and learning a robust policy. I am intending to do the same for cloth simulation,
Currently I can change the UniformMass of the cloth, but I can not change any dynamical properties of the cloth (mentioned above) after reset except the Rayleigh stiffness (which is kinda odd).
But also I am on sofa v17.06, do you think you have anything better than this on the newer versions so that I can try? I would only move forward and invest time in the newer versions if you suggest
Thanks a lot, hope you are enjoying summers in France, it’s quite pleasant here in Barcelona too !
Rishabh23 August 2019 at 17 h 26 min #14151
For sure you can update to 19.06, you should have better experience with other masses than UniformMass. I worked few months ago in making the Diagonal and MeshMatrixMass able to be updated.
However, you will still face the issue with the ForceFields. It would require a bit of work to make them updatable. Maybe start with the update and we can work together on the update of the other components. How does it sound for you?
Hugo26 August 2019 at 12 h 21 min #14160
Okay, alright, I see where the problem lies. I am working towards a paper deadline next month, so it won’t be possible to delve into this before that as you said it would require a bit of work.
But if the rayleigh stiffness is being able to update, would it be different to update other similar parameters as stiffness and damping?
Also, I have never looked into the source code, if it’s not too much work, could you point me towards which files to check
Rishabh2 September 2019 at 16 h 44 min #14174
Yes, as you can see from the EulerImplicit code (if it is the OdeSolver, i.e. integration scheme, you are using), the rayleigh stiffness Data is directly used in the code. If you update it, it will be taken into account.
It is really code dependent for the physical parameters (stiffness, i.e. Young modulus).
Which code and which parameters are necessary to update for you?
Hugo5 September 2019 at 13 h 48 min #142115 September 2019 at 14 h 46 min #14212
Hi @hugo, that’s good news !
Here’s a list of data fields that I think would be very useful for the robotics learning community in SOFA:
1. FEM Force fields – Young’s modulus, Poisson ratio
2. Spring Force fields – Stiffness, damping
3. Simulation timestep ‘dt’
4. If possible, being able to update the mesh structure of a object would be nice. For example changing from mesh/square2.msh to mesh/square2.msh.
Currently I am using Euler Implicit solver and CGLinearSolver
Rishabh10 September 2019 at 10 h 37 min #14223
1. I will work on it as soon as I can
2. this is ready in PR #1093
3. dt can already be changed, but you must be very careful with this. Some parameters or numerical settings (ODE solvers, constraints) may depend on the time step and can not be updated. I would therefore advise to change it very carefully.
4. Topology change (update in the mesh) is a work in progress thanks to the amazing work of InfinyTech3D (consulting company around SOFA)
Hugo26 September 2019 at 16 h 45 min #14298
Thank you very much, I have started to work on this again, I moved to the master branch now and have been checking it out,
PR #1093 is about Stiff Springs, so does that mean the same change would not work for Bending Springs?
Rishabh26 September 2019 at 20 h 36 min #1429927 September 2019 at 11 h 20 min #14301
If it’s only about replicating the same changes I can give it a shot, but I see this PR is still not merged, are the changes safe?
Rishabh5 December 2019 at 11 h 26 min #14681
Hi @hugo, how are you?
I see that all the above mentioned PRs have been merged, thanks a lot for that!
I’m on the master branch now, and can’t update TriangularFEMForceField and TriangularBendingSprings. The values only take effect after I press the update button.
So, I was thinking about implementing this by replicating the changes similar to the above PRs.
Can you please tell me about the recent updates on this? Which PRs do I have to replicate
Rishabh5 December 2019 at 12 h 23 min #14682
Sorry for not getting back to you earlier. But the SOFA Week kept us busy (with many scientific presentations and technical discussions) and I am current out from the office.
There have been discussions on update. A summary will be made available on the “RoadMap” page on sofa-framework.org. Shortly, a new working project is starting on this to unify and improve the data dependency and update. But it will take a bit of time.
Going for the implementation based on what was done in the PR will be useful for the future as well, your contribution is therefore most welcome. Let us know if you face issues or need guidance. But don’t hesitate to PR and we would guide you afterwards if needed.
- You must be logged in to reply to this topic.