Home › Forum › SOFA › Using SOFA › FixedConstraint Not working with Model Order Reduction
- This topic has 2 replies, 3 voices, and was last updated 3 years, 9 months ago by olivier.
-
AuthorPosts
-
12 February 2021 at 00:15 #18626ArthurBlocked
Hello,
I am trying to use model order reduction to reduce a model that currently has a fixedConstraint. It didn’t work and I was able to replicate the error on one of the example MOR scenes (quadruped.py) so I have attached files related to that. https://uchicago.box.com/s/19rw3jpbiyt5phhli5mjeskiju8lbngy
While model order reduction successfully reduces the model when I go to load the reduced model (that I find in reduced_test.py) I find that the fixedConstraints no longer actually fix the model in place.
Is there a way to get around this? I think it has something to do with the reduced model replacing the previous one, but I’m not sure what I can do to address this.
To replicate my error, first do:
runSofa my_quadruped.py
– observe that one leg is fixed
Then reduce the model
python2 modelOrderReduction.py
cd mor_output
runSofa reduced_test.py
observe that the leg is no longer fixed and the model drops into space.When I run reduced_test.py I see the following warning:
[WARNING] [FixedConstraint(FixedConstraint)] Unused Attribute: “indicies” with value: “1 2 3” (/Reduced_test/model_MOR/model/FixedConstraint)In addition to using fixed constraint I also want to use AttachConstraint in the future and I was wondering (since these are both constraints) if the solution to this problem might be needed to get AttachConstraint to work.
About my build, I’m using Sofa ~20.06, with stlib, softrobots, and ModelOrderReduction, built using the following git commits (all from around october 2020, so its roughly Sofa 20.06.
#clone the master version of Sofa RUN cd /builds/src && \ git clone https://github.com/sofa-framework/sofa.git . && \ git checkout 36e1030cdbffb1db458344be095b5d80f463b5c5 # clone specific version of STLIB, SoftRobots, and ModelOrderReduction RUN cd /builds/plugins && \ git clone https://github.com/SofaDefrost/STLIB.git && \ cd STLIB && \ git checkout 6f329f61af7be3d2baab997e8318e95fde4fecca RUN cd /builds/plugins && \ git clone https://github.com/SofaDefrost/SoftRobots.git && \ cd SoftRobots && \ git checkout 93a7d0ed6658b0819cefbd4c91b90f5dae64be78 RUN cd /builds/plugins && \ git clone https://github.com/SofaDefrost/ModelOrderReduction.git && \ cd ModelOrderReduction && \ git checkout 83931e5697770e441e15dc3666c32f71fc038983
@olivier-goury and @felixvanneste, is there a good solution for this? (is it something on my end?)12 February 2021 at 10:30 #18661HugoKeymasterLet me notice @olivier-goury author of the code 😉
Hugo
15 February 2021 at 10:15 #18670olivierBlockedHello @amackeith !
There are several few things to look at:
– the warning you get
[WARNING] [FixedConstraint(FixedConstraint)] Unused Attribute: “indicies” with value: “1 2 3” (/Reduced_test/model_MOR/model/FixedConstraint)
is just a misspelling of “indices” in your file my_quadruped.py. Since the constraint can not understand the points you want to fix, it fixes only index 0 by default.– Secondly, and it is a bit more tricky and comes down to how SOFA works, the fixconstraint is not taken into account when it is in a sub-node of your higher node containing degrees of freedom, so it can not work in the reduced model anyway. For fixing degrees of freedom in a scene you want to reduce, I advise you to use a spring with high stiffness, i.e.
('RestShapeSpringsForceField' , points = [...], stiffness=1e8)
.– Thirdly, if you reduce a model that is fixed in some way, you should set the boolean
addRigidBodyModes = [0,0,0]
because you are not interested in having your model moving away in space. And actually, it should also allow not to have any constraint to fix your model in its reduced version (you may want to add one for ‘safety’), because the modes will all be fixed at this point anyway.I hope it is clear, and do not hesitate to contact me.
Good luck!
Olivier -
AuthorPosts
- You must be logged in to reply to this topic.