Home › Forum › SOFA › Programming with SOFA › [SOLVED] Rigid objects passing through deformable
Tagged: 64_bits, Forcefields, Linux_ubuntu, Plugin_other, SOFA_1906, springs
- This topic has 20 replies, 4 voices, and was last updated 2 years, 11 months ago by Hugo.
-
AuthorPosts
-
19 July 2019 at 22:17 #13971JieYingBlocked
Hi,
I’m trying to set up a flat platform, supported by 4 springs. The platform is modelled as a rigid objects and it should reach an equilibrium where it is suspended by the spring. However, it keeps falling through the spring. Any suggestions for how to fix that or what it’s caused by? My code is at https://github.com/JieYingWu/sofa_dvrk/blob/master/spring_table.py. I also noticed it in the example ‘examples/Components/forcefield/TetrahedronFEMForceField.scn’.
Thanks,
Jie Ying22 July 2019 at 17:58 #13978HugoKeymasterHi @jieying
I am sorry but the link to your scene is actually broken. Could you share it again please?
Hugo
22 July 2019 at 18:47 #13980JieYingBlockedHi Hugo,
Hmm that’s weird. It works for me, even in Private Browsing mode. Could you try https://github.com/JieYingWu/sofa_dvrk/ please and go to spring_table.py?
Jie Ying
25 July 2019 at 17:55 #13991HugoKeymasterHi @jieying
A first important issue that I detect is that you meshes (used for collision) CAN NOT intersect before the simulation starts. If contacts are already present at the first step, it is a ill-posed problem.
Could you re-design a new scenario respecting this constraint?
Hugo
5 August 2019 at 21:59 #14065JieYingBlockedHi @Hugo,
Sorry I lost track of this thread somehow. Thanks for your suggestion. I think I solved the problem by a) addressing the issue you mentioned of intersecting before it started and b) changing the contact response to frictioncontact. I’m not sure why default or frictionless didn’t work for me.
Jie Ying
6 August 2019 at 22:25 #14067EugeneBlockedHi Jie Ying,
I’m running into the same problem as you. Where were you able to change the contact response? I’m a bit new at this, so any guidance would be much appreciated.
Eugene
6 August 2019 at 22:39 #14068JieYingBlockedHi Eugene,
I changed this line
rootNode.createObject('DefaultContactManager', name='Response', response='FrictionContact')
so that the response is FrictionContact.Hope that helps!
Jie Ying
7 August 2019 at 14:24 #14070EugeneBlockedThanks Jie Ying. That didn’t quite fix my problem, but I’ll try some of the other fixes too
Eugene
13 August 2019 at 18:08 #14100HugoKeymasterHi @eugenekli
Any update? Did you solve your issue?
If not, you can detail your problem and share your scene.Best
Hugo
13 August 2019 at 18:21 #14105EugeneBlockedHi Hugo,
Unfortunately, I have not been able to solve the issue. The scene is built using prefabricated items from the STLIB. I have a floor with a cube and a soft actuator. When the scene starts the cube and the actuator fall towards the floor. Unfortunately, the soft actuator passes through the floor and the cube.
SOFA Code23 August 2019 at 11:43 #14146HugoKeymasterHi @eugenekli
It seems meshes (stl/vtk) are missing, I got path issues and so on.
Could you please make a simple example based on SOFA classes that exposes your problem? or sharing your meshes would be required.Hugo
23 August 2019 at 14:57 #14148EugeneBlockedHi Hugo,
Thanks for checking that. Apologies for not uploading the meshes first, I didn’t want to overwhelm, but it looks like I was just not helpful.
Here’s a Github repository for the files
SOFA Bellow Arm GitHub23 August 2019 at 15:44 #14149HugoKeymasterI am getting the following error by trying your scene:
[ERROR] [PythonScript] TypeError: 'staticmethod' object is not callable File "BellowArm.pyscn", line 94, in createScene bellow1 = Bellow(rootNode,[35,0,20]) File "BellowArm.pyscn", line 42, in Bellow collisionMesh =stlPath) File "/data/Softwares/sofa/src/plugins/STLIB/python/splib/objectmodel/__init__.py", line 47, in __call__ o = self.cls(*args, **kwargs) File "/data/Softwares/sofa/src/plugins/STLIB/python/stlib/physics/deformable/elasticmaterialobject.py", line 30, in __init__ collisionMesh, withConstrain, surfaceColor, poissonRatio, youngModulus, totalMass, solver)
Does this remind you an error you faced?
Hugo
23 August 2019 at 17:14 #14150EugeneBlockedHello Hugo,
Unfortunately, that is not the error I’m getting. I’m not getting any error messages when it runs for me, the objects just pass through each other.
Eugene
2 September 2019 at 18:05 #14178HugoKeymasterHi @eugenekli
Is this how your scene looks like?
I got some issue with STLIB and with your filenames (sensitivity to lower/uppercase).
Next time do not hesitate to share an XML exported version when you are using some many libs and files.Is the result of your simulation a crash directly when you run the simulation?
########## SIG 11 - SIGSEGV: segfault ########## -> /data/Softwares/sofa/build/build-release-master/lib/libSofaHelper.so.19.06.99(sofa::helper::BackTrace::dump()+0x20) [0x7f91010d3b10] -> /data/Softwares/sofa/build/build-release-master/lib/libSofaHelper.so.19.06.99(sofa::helper::BackTrace::sig(int)+0x358) [0x7f91010d40a8] -> /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f90fc165f20] -> /data/Softwares/sofa/src/plugins/SofaPardisoSolver/libPardiso/libpardiso600-GNU720-X86-64.so(METIS_NodeND_ord+0x2d) [0x7f90e00a0f6d] -> /data/Softwares/sofa/src/plugins/SofaPardisoSolver/libPardiso/libpardiso600-GNU720-X86-64.so(METIS_NodeND+0x1c) [0x7f90e00a155c] -> /data/Softwares/sofa/build/build-release-master/lib/libSofaSparseSolver.so(sofa::component::linearsolver::SparseLDLSolverImpl<sofa::component::linearsolver::CompressedRowSparseMatrix<double, sofa::helper::vector<double, sofa::helper::CPUMemoryManager<double> >, sofa::helper::vector<int, sofa::helper::CPUMemoryManager<int> > >, sofa::component::linearsolver::FullVector<double>, sofa::component::linearsolver::NoThreadManager>::LDL_ordering(int, int*, int*, int*, int*)+0x3c2) [0x7f90c5216b12] -> /data/Softwares/sofa/build/build-release-master/lib/libSofaSparseSolver.so(void sofa::component::linearsolver::SparseLDLSolverImpl<sofa::component::linearsolver::CompressedRowSparseMatrix<double, sofa::helper::vector<double, sofa::helper::CPUMemoryManager<double> >, sofa::helper::vector<int, sofa::helper::CPUMemoryManager<int> > >, sofa::component::linearsolver::FullVector<double>, sofa::component::linearsolver::NoThreadManager>::factorize<sofa::helper::vector<int, sofa::helper::CPUMemoryManager<int> >, sofa::helper::vector<double, sofa::helper::CPUMemoryManager<double> > >(int, int*, int*, double*, sofa::component::linearsolver::SparseLDLImplInvertData<sofa::helper::vector<int, ....
Best
Hugo
2 September 2019 at 18:32 #14179EugeneBlockedHi Hugo,
Thank you for all your effort on this. Yes that is the scene and the error I am getting.
I did not know that sharing an exported XML version is more convenient, thanks for the tip.
Eugene
3 September 2019 at 14:13 #14185HugoKeymasterWhen just opening the scene I get this:
[ERROR] [DAGNode(root)] Node.getChild("finger1") not found. [ERROR] [DAGNode(root)] Node.getChild("finger2") not found. [ERROR] [DAGNode(root)] Node.getChild("finger3") not found. [ERROR] [PythonScript] AttributeError: 'NoneType' object has no attribute 'getChild' File "/data/Softwares/sofa/src/plugins/SoftRobots/docs/tutorials/PneunetGripper/details/pythonControllers/wholeGripperController.py", line 37, in initGraph self.pressureConstraint1Node = self.finger1Node.getChild('cavity') [ERROR] [TetrahedronSetTopologyContainer(container)] Cannot find edge 0 [0, 502] in triangle 0 [ERROR] [TetrahedronSetTopologyContainer(container)] Cannot find edge 0 [0, 502] in triangle 0 [WARNING] [TetrahedronSetTopologyContainer(container)] TrianglesAroundEdge buffer can't be created as EdgesInTriangle buffer creation failed. [ERROR] [TetrahedronSetTopologyContainer(container)] Cannot find triangle 1 [89, 393, 635] in tetrahedron 0 [ERROR] [TetrahedronSetTopologyContainer(container)] Cannot find triangle 1 [89, 393, 635] in tetrahedron 0 [WARNING] [TetrahedronSetTopologyContainer(container)] TetrahedraAroundTriangle buffer can't be created as trianglesInTetrahedron buffer creation failed. [ERROR] [TetrahedronSetTopologyContainer(container)] Cannot find edge 0 [0, 502] in triangle 0 [ERROR] [TetrahedronSetTopologyContainer(container)] Cannot find edge 0 [0, 502] in triangle 0 [WARNING] [TetrahedronSetTopologyContainer(container)] TrianglesAroundEdge buffer can't be created as EdgesInTriangle buffer creation failed. [ERROR] [TetrahedronSetTopologyContainer(container)] Cannot find triangle 1 [89, 393, 635] in tetrahedron 0 [ERROR] [TetrahedronSetTopologyContainer(container)] Cannot find triangle 1 [89, 393, 635] in tetrahedron 0 [WARNING] [TetrahedronSetTopologyContainer(container)] TetrahedraAroundTriangle buffer can't be created as trianglesInTetrahedron buffer creation failed.
Where are defined these “finger” nodes??
Morevoer, your meshes seem to have issues regarding the error on topology.
I will get back to more basic question.
What do you want to model exactly? how many bodies are involved? what should be their properties?Hugo
3 September 2019 at 14:24 #14186EugeneBlockedHi Hugo,
That’s strange that those are showing up. The fingers were from a tutorial I was following along with, but I did not implement them. I may have inadvertently copied over some code that was not necessary.
In essence, what I’m trying to do in the simulation is have a simulation with three bodies. A rigid cube is dropping onto a rigid floor, and then a soft deformable bellow is falling onto the cube and should fall to the side and hit the floor.
Eugene
13 September 2019 at 20:02 #14237HugoKeymasterHi @eugenekli
Have you tried to get inspired from SOFA examples (like examples/Components/collision/TriangleModel.scn) ?
Here is an example:
<?xml version="1.0"?> <Node name="root" dt="0.02"> <RequiredPlugin name="SofaOpenglVisual"/> <VisualStyle displayFlags="showBehaviorModels showForceFields" /> <DefaultPipeline verbose="0" draw="0" /> <BruteForceDetection name="N2" /> <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" /> <DefaultContactManager name="Response" response="default" /> <Node name="cubeFEM"> <EulerImplicitSolver name="cg_odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver iterations="25" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" /> <MechanicalObject /> <UniformMass vertexMass="0.25" /> <RegularGridTopology nx="5" ny="5" nz="5" xmin="-3.5" xmax="3.5" ymin="7.5" ymax="14.5" zmin="-3.5" zmax="3.5"/> <TetrahedronFEMForceField name="FEM" youngModulus="25" poissonRatio="0.3" computeGlobalMatrix="false" updateStiffnessMatrix="false" method="large" /> <Node name="Visu"> <MeshObjLoader name="meshLoader_0" filename="mesh/smCube125.obj" handleSeams="1" translation="0 11 0"/> <OglModel name="Visual" src="@meshLoader_0" color="red" /> <SubsetMapping input="@.." output="@Visual" /> </Node> <Node name="Surf"> <MeshObjLoader name="loader" filename="mesh/smCube125.obj" translation="0 11 0"/> <MeshTopology src="@loader" /> <MechanicalObject src="@loader" /> <TriangleCollisionModel /> <LineCollisionModel /> <PointCollisionModel /> <SubsetMapping /> </Node> </Node> <Node name="cubeRigid"> <EulerImplicitSolver name="cg_odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver iterations="25" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" /> <MechanicalObject template="Rigid3d" translation="0 0 0"/> <UniformMass vertexMass="0.25" /> <Node name="Visu"> <MeshObjLoader name="meshLoader_0" filename="mesh/smCube125.obj" handleSeams="1" /> <OglModel name="Visual" src="@meshLoader_0" color="grey" /> <RigidMapping input="@.." output="@Visual" /> </Node> <Node name="Surf"> <MeshObjLoader name="loader" filename="mesh/smCube125.obj" /> <MeshTopology src="@loader" /> <MechanicalObject src="@loader" /> <TriangleCollisionModel /> <LineCollisionModel /> <PointCollisionModel /> <RigidMapping /> </Node> </Node> <Node name="Floor"> <MeshObjLoader name="loader" filename="mesh/floor3.obj" /> <MeshTopology src="@loader" /> <MechanicalObject src="@loader" dy="-10" scale="1.75" /> <TriangleCollisionModel name="FloorTriangle" simulated="0" moving="0" /> <LineCollisionModel name="FloorLine" simulated="0" moving="0" /> <PointCollisionModel name="FloorLine" simulated="0" moving="0" /> <MeshObjLoader name="meshLoader_1" filename="mesh/floor3.obj" scale="1.75" handleSeams="1" /> <OglModel name="FloorV" src="@meshLoader_1" texturename="textures/brushed_metal.bmp" dy="-10" /> </Node> </Node>
Hugo
25 January 2022 at 15:33 #21435TimesBlockedIf anyone encounters the same problem and is using the “FreeMotionAnimationLoop”, you may also check if you have included a ConstraintCorrection in your scene as well, for example, “PrecomputedConstraintCorrection”. I had the same problem, and it was because I had somehow removed the class computing the constraint correction
26 January 2022 at 11:50 #21436HugoKeymasterThanks @akthetimes for taking time to support others.
As you know we now moved to GitHub Discussions, we would be glad to have your input there 😉Best wishes,
Hugo
—
NOTE: we are now moving the forum to GitHub Discussions. Do not hesitate to start using it already!
More information on the migration process can be found online. -
AuthorPosts
- You must be logged in to reply to this topic.