Home › Forum › SOFA › Using SOFA › Segmentation fault (core dumped) when opening simulation.
Tagged: Linux_other, segmentation fault, SOFA_other, SofaPython3
- This topic has 2 replies, 2 voices, and was last updated 3 years, 1 month ago by Hugo.
-
AuthorPosts
-
4 October 2021 at 08:23 #20353daserkBlocked
I am trying to code a small scene with a flexible cylinder that I will later make into an actuator.
However, I get some really weird errors that I don’t understand, mainly a segmentation fault.
I assume the problem lies in either my code (how I am putting the topology container and force field). Or maybe it is because I am using a BETA version of SOFA, v21.22.99. Or maybe it is a problem in the meshes I am using, although I doubt it since using meshes that have worked for me in other simulations doesn’t work either.
Please help, I spent too much time trying to debug this XD
I have Python 3.9.5 running on Linux (PopOS 21.04).
I include my code, log, and files.
FILES
https://drive.google.com/drive/folders/1GJK2yW2Wj2Q1FmCLIbdwkSoLb8ltPKN0?usp=sharing
CODE
# Required import for python import Sofa import SofaRuntime #from softrobots.actuators import PullingCable # Function used only if this script is called from a python environment if __name__ == '__main__': main() def main(): # Make sure to load all SOFA libraries SofaRuntime.importPlugin("SofaBaseMechanics") # Call the above function to create the scene graph root = Sofa.Core.Node("root") createScene(root) # Once defined, initialization of the scene graph Sofa.Simulation.init(root) # Run the simulation for 10 steps for iteration in range(10): print(f'Iteration #{iteration}') print(root.worm.object.getObject("dofs")) Sofa.Simulation.animate(root, root.dt.value) print("Simulation made 10 time steps. Done") return 0 # Function called when the scene graph is being created def createScene(root): header(root) actuator(root) #floor(root) return 0 def header(parent): config = parent.addChild("Config") # Required Plugins #config.addObject('RequiredPlugin', name="SofaMiscCollision") config.addObject('RequiredPlugin', name="SofaOpenglVisual") #config.addObject('RequiredPlugin', name="SofaLoader") #config.addObject('RequiredPlugin', name="SofaGeneralLoader") config.addObject('RequiredPlugin', name="SofaSimpleFem") #config.addObject('RequiredPlugin', name="SoftRobots") config.addObject('RequiredPlugin', name="SofaConstraint") config.addObject('RequiredPlugin', name="SofaImplicitOdeSolver") config.addObject('RequiredPlugin', name="SofaMeshCollision") # Basic Stuff parent.addObject('DefaultPipeline') parent.addObject('FreeMotionAnimationLoop') parent.findData('gravity').value = [0.0, -9.81, 0.0] parent.findData('dt').value = 0.01 #parent.addObject('OglSceneFrame', style="Arrows", alignment="TopRight") #parent.addObject('OglGrid', nbSubdiv=10, size=1000) # Constraint Solver parent.addObject('LCPConstraintSolver', tolerance="0.001", maxIt="1000") # Collisions parent.addObject('BruteForceBroadPhase') parent.addObject('BVHNarrowPhase') parent.addObject('DefaultContactManager', response='FrictionContact') parent.addObject('LocalMinDistance', alarmDistance="0.2", contactDistance="0.09", angleCone="0.01") return 0 def actuator(parent,volumeMeshFileName="3D.msh",surfaceMeshFileName="2D.msh", poissonRatio="0.4", youngModulus="1000", color="1.0 0.0 1.0 1.0"): actuator = parent.addChild('Actuator') actuator.addObject('EulerImplicitSolver', rayleighStiffness="0.1", rayleighMass="0.1") actuator.addObject('CGLinearSolver', iterations="25", tolerance="1.0e-9", threshold="1.0e-9") #error# actuator.addObject('UncoupledConstraintCorrection') actuator.addObject('GenericConstraintSolver', tolerance="1e-6", maxIterations="1000") actuator.addObject('MeshGmshLoader', name="volume_mesh", filename=volumeMeshFileName) actuator.addObject('MechanicalObject', template='Vec3d') actuator.addObject('TetrahedronSetTopologyContainer', src='@volume_mesh') actuator.addObject('TetrahedronSetGeometryAlgorithms', template="Vec3d") #error# actuator.addObject('DiagonalMass', massDensity=0.2) #error# actuator.addObject('TetrahedronFEMForceField', poissonRatio=poissonRatio, youngModulus=youngModulus) # Visual Model visual = actuator.addChild('Visual') visual.addObject('MeshGmshLoader', name="visual_mesh", filename=surfaceMeshFileName) visual.addObject('OglModel', name="VisualModel", src="@visual_mesh", color=color) #visual.addObject('BarycentricMapping', name="VisualMapping", input="@..", output="@VisualModel") #Collision Model #collision = actuator.addChild('Collision') #collision.addObject('MechanicalObject', template='Vec3d', name='CollisionModel') #collision.addObject('MeshGmshLoader', name="collision_mesh", filename=surfaceMeshFileName) #collision.addObject('TriangleSetTopologyContainer', src='@collision_mesh') #collision.addObject('TriangleCollisionModel') #error# collision.addObject('LineCollisionModel') #collision.addObject('PointCollisionModel') #collision.addObject('BarycentricMapping', name="CollisionMapping", input="@..", output="@CollisionModel") return 0 def floor(parent): floor = parent.addChild('Floor') floor.addObject('MeshTopology', filename="mesh/floor.obj") floor.addObject('MechanicalObject') floor.addObject('TriangleCollisionModel') return 0
LOGS
daserk@pop-os:~/LINX/Cylinder Actuator$ $SOFA_DIR\bin/./runSofa main.pyscn [INFO] [runSofa] PluginRepository paths = /home/daserk/SOFA/build/plugins:/home/daserk/SOFA/build/lib [INFO] [runSofa] DataRepository paths = /home/daserk/SOFA/src/share:/home/daserk/SOFA/src/examples:/home/daserk/SOFA/build:/home/daserk/SOFA/build [INFO] [runSofa] GuiDataRepository paths = /home/daserk/SOFA/src/applications/projects/runSofa/resources:/home/daserk/SOFA/src/modules/SofaGuiQt/src/sofa/gui/qt/resources:/home/daserk/SOFA/build [INFO] [runSofa] Loading automatically plugin list in /home/daserk/SOFA/build/lib/plugin_list.conf.default [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaSimpleFem.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaRigid.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaDeformable.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaObjectInteraction.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMeshCollision.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaEngine.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaExplicitOdeSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaImplicitOdeSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaLoader.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralVisual.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGraphComponent.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralMeshCollision.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaBoundaryCondition.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralAnimationLoop.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralDeformable.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralEngine.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralExplicitOdeSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralImplicitOdeSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralLinearSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralRigid.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralObjectInteraction.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralSimpleFem.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralTopology.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaTopologyMapping.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaUserInteraction.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaConstraint.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralLoader.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaExporter.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaSparseSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaPreconditioner.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaHaptics.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaValidation.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaDenseSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaNonUniformFem.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaOpenglVisual.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscTopology.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscExtra.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscForceField.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscEngine.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscFem.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscMapping.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscCollision.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libCImgPlugin.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libLMConstraint.so [INFO] [SofaPython3] Initializing with python version 3.9.5 (default, May 11 2021, 08:20:37) [GCC 10.3.0] [INFO] [SofaPython3] Registering a scene loader for [.py, .py3, .pyscn, .py3scn] files. [INFO] [SofaPython3] Shared library name is 'libpython3.9m.so' [INFO] [SofaPython3] Intializing python [INFO] [SofaPython3] Added '/home/daserk/SOFA/SoftRobots/python' to sys.path [INFO] [SofaPython3] Added '/home/daserk/SOFA/build/lib/python3/site-packages' to sys.path [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaPython3.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSTLIB.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSoftRobots.so The constructor with a QGLFormat is deprecated, use the regular contructor instead. [INFO] [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias] [INFO] [SceneCheckerVisitor] Finished validating node "root". ########## SIG 11 - SIGSEGV: segfault ########## -> /home/daserk/SOFA/build/lib/libSofa.Helper.so.21.12.99(sofa::helper::BackTrace::dump()+0x20) [0x7fceb3a21a30] -> /home/daserk/SOFA/build/lib/libSofa.Helper.so.21.12.99(sofa::helper::BackTrace::sig(int)+0x364) [0x7fceb3a21fe4] -> /lib/x86_64-linux-gnu/libc.so.6(+0x41040) [0x7fceb331d040] -> /home/daserk/SOFA/build/lib/libSofaBaseTopology.so.21.12.99(sofa::component::topology::TetrahedronSetGeometryAlgorithms<sofa::defaulttype::StdVectorTypes<sofa::type::Vec<3u, double>, sofa::type::Vec<3u, double>, double> >::computeRestTetrahedronVolume(unsigned int) const+0x65) [0x7fceb4d3b7b5] -> /home/daserk/SOFA/build/lib/libSofaBaseMechanics.so.21.12.99(sofa::component::mass::DiagonalMass<sofa::defaulttype::StdVectorTypes<sofa::type::Vec<3u, double>, sofa::type::Vec<3u, double>, double>, double>::computeVertexMass(double)+0x467) [0x7fceb64fe527] -> /home/daserk/SOFA/build/lib/libSofaBaseMechanics.so.21.12.99(sofa::component::mass::DiagonalMass<sofa::defaulttype::StdVectorTypes<sofa::type::Vec<3u, double>, sofa::type::Vec<3u, double>, double>, double>::initFromMassDensity()+0x21e) [0x7fceb650227e] -> /home/daserk/SOFA/build/lib/libSofaBaseMechanics.so.21.12.99(sofa::component::mass::DiagonalMass<sofa::defaulttype::StdVectorTypes<sofa::type::Vec<3u, double>, sofa::type::Vec<3u, double>, double>, double>::massInitialization()+0x59c) [0x7fceb64faf1c] -> /home/daserk/SOFA/build/lib/libSofaBaseMechanics.so.21.12.99(sofa::component::mass::DiagonalMass<sofa::defaulttype::StdVectorTypes<sofa::type::Vec<3u, double>, sofa::type::Vec<3u, double>, double>, double>::init()+0x5e3) [0x7fceb64f81a3] -> /home/daserk/SOFA/build/lib/libSofa.SimulationCore.so.21.12.99(sofa::simulation::InitVisitor::processNodeTopDown(sofa::simulation::Node*)+0xfb) [0x7fceb47a02ab] -> /home/daserk/SOFA/build/lib/libSofaSimulationGraph.so.21.12.99(sofa::simulation::graph::DAGNode::executeVisitorTopDown(sofa::simulation::Visitor*, std::__cxx11::list<sofa::simulation::graph::DAGNode*, std::allocator<sofa::simulation::graph::DAGNode*> >&, std::map<sofa::simulation::graph::DAGNode*, sofa::simulation::graph::DAGNode::StatusStruct, std::less<sofa::simulation::graph::DAGNode*>, std::allocator<std::pair<sofa::simulation::graph::DAGNode* const, sofa::simulation::graph::DAGNode::StatusStruct> > >&, sofa::simulation::graph::DAGNode*)+0x1c2) [0x7fceba28add2] -> /home/daserk/SOFA/build/lib/libSofaSimulationGraph.so.21.12.99(sofa::simulation::graph::DAGNode::executeVisitorTopDown(sofa::simulation::Visitor*, std::__cxx11::list<sofa::simulation::graph::DAGNode*, std::allocator<sofa::simulation::graph::DAGNode*> >&, std::map<sofa::simulation::graph::DAGNode*, sofa::simulation::graph::DAGNode::StatusStruct, std::less<sofa::simulation::graph::DAGNode*>, std::allocator<std::pair<sofa::simulation::graph::DAGNode* const, sofa::simulation::graph::DAGNode::StatusStruct> > >&, sofa::simulation::graph::DAGNode*)+0x3bc) [0x7fceba28afcc] -> /home/daserk/SOFA/build/lib/libSofaSimulationGraph.so.21.12.99(sofa::simulation::graph::DAGNode::doExecuteVisitor(sofa::simulation::Visitor*, bool)+0x145) [0x7fceba28a455] -> /home/daserk/SOFA/build/lib/libSofa.SimulationCore.so.21.12.99(sofa::simulation::Simulation::initNode(sofa::simulation::Node*)+0x8f) [0x7fceb47e1acf] -> /home/daserk/SOFA/build/lib/libSofa.SimulationCore.so.21.12.99(sofa::simulation::Simulation::init(sofa::simulation::Node*)+0x3bb) [0x7fceb47e18ab] -> /home/daserk/SOFA/build/bin/./runSofa() [0x410946] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xd5) [0x7fceb3304565] -> /home/daserk/SOFA/build/bin/./runSofa() [0x40bb1e] Segmentation fault (core dumped)
4 October 2021 at 23:00 #20498daserkBlockedI managed to fix the previous error. Problem was solved when I swapped the topology container and the mechanical object creation lines. However, now that I’ve added the cable and trying to add the python controller to actuate it produces a similar error.
Here’s the new code:
# Required import for python import Sofa import SofaRuntime from softrobots.actuators import PullingCable class CableController(Sofa.Core.Controller): def __init__(self, *args, **kwargs): print('Controller initialized') #self.node = kwargs["node"] #self.actuator = self.node.getChild('Actuator') #self.cable = self.actuator.getChild('Cable') #def onAnimateBeginEvent(self, eventType): #print('onAnimateBeginEvent') #print(self.cableL0Acutator.findData('displacement').value) def main(): # Make sure to load all SOFA libraries SofaRuntime.importPlugin("SofaBaseMechanics") # Call the above function to create the scene graph root = Sofa.Core.Node("root") createScene(root) # Once defined, initialization of the scene graph Sofa.Simulation.init(root) # Run the simulation for 10 steps for iteration in range(10): print(f'Iteration #{iteration}') print(root.worm.object.getObject("dofs")) Sofa.Simulation.animate(root, root.dt.value) print("Simulation made 10 time steps. Done") # Function used only if this script is called from a python environment if __name__ == '__main__': main() # Function called when the scene graph is being created def createScene(root): header(root) actuator(root) # floor(root, translation=[0.0, -20.0, 0.0], scale=3) root.addObject(CableController(node=root)) def header(parent): config = parent.addChild("Config") # Required Plugins #config.addObject('RequiredPlugin', name="SofaMiscCollision") config.addObject('RequiredPlugin', name="SofaOpenglVisual") #config.addObject('RequiredPlugin', name="SofaLoader") #config.addObject('RequiredPlugin', name="SofaGeneralLoader") config.addObject('RequiredPlugin', name="SofaSimpleFem") config.addObject('RequiredPlugin', name="SoftRobots") config.addObject('RequiredPlugin', name="SofaConstraint") config.addObject('RequiredPlugin', name="SofaImplicitOdeSolver") config.addObject('RequiredPlugin', name="SofaMeshCollision") config.addObject('RequiredPlugin', name="SofaBoundaryCondition") config.addObject('RequiredPlugin', name="SofaSparseSolver") parent.addObject('VisualStyle', displayFlags='hideWireframe showVisualModels showBehaviorModels hideCollisionModels hideBoundingCollisionModels hideForceFields hideInteractionForceFields') parent.findData('gravity').value = [0.0, 0.0, 0.0] parent.findData('dt').value = 0.01 parent.addObject('FreeMotionAnimationLoop', maxIt=1000, tolerance=0.01) parent.addObject('LCPConstraintSolver', maxIt=1000, tolerance=0.01) parent.addObject('DefaultPipeline') parent.addObject('BruteForceBroadPhase') parent.addObject('BVHNarrowPhase') parent.addObject('DefaultContactManager', response='FrictionContact', responseParams="mu=0.8") parent.addObject('LocalMinDistance', alarmDistance=2.5, contactDistance=0.5, angleCone=0.0) def actuator(parent,volumeMeshFileName="3D.msh",surfaceMeshFileName="2D.msh", poissonRatio="0.3", youngModulus="18000", color="1.0 0.0 1.0 1.0"): actuator = parent.addChild('Actuator') actuator.addObject('EulerImplicitSolver', rayleighMass=0.015, rayleighStiffness=0.015) actuator.addObject('SparseLDLSolver', template="CompressedRowSparseMatrixd") actuator.addObject("GenericConstraintCorrection", solverName="SparseLDLSolver") actuator.addObject('MeshGmshLoader', name="volume_mesh", filename=volumeMeshFileName) actuator.addObject('TetrahedronSetTopologyContainer', src='@volume_mesh') actuator.addObject('TetrahedronSetGeometryAlgorithms', template="Vec3d") actuator.addObject('MechanicalObject', template='Vec3d') actuator.addObject('DiagonalMass', totalMass=1.0) actuator.addObject('TetrahedronFEMForceField', poissonRatio=poissonRatio, youngModulus=youngModulus) actuator.addObject('UncoupledConstraintCorrection') actuator.addObject('FixedConstraint', indices='0 21 22 23 24 25 26 27 125 126 127 128') # Visual Model visual = actuator.addChild('Visual') visual.addObject('MeshGmshLoader', name="visual_mesh", filename=surfaceMeshFileName) visual.addObject('OglModel', name="VisualModel", src="@visual_mesh", color=color) visual.addObject('BarycentricMapping', name="VisualMapping", input="@..", output="@VisualModel") # Collision Model collision = actuator.addChild('Collision') collision.addObject('MeshGmshLoader', name="collision_mesh", filename=surfaceMeshFileName) collision.addObject('TriangleSetTopologyContainer', src='@collision_mesh') collision.addObject('MechanicalObject', template='Vec3d', name='CollisionModel') collision.addObject('TriangleCollisionModel') collision.addObject('LineCollisionModel') collision.addObject('PointCollisionModel') collision.addObject('BarycentricMapping', name="CollisionMapping", input="@..", output="@CollisionModel") # Cable Actuator cable = actuator.addChild('Cable') # This create a MechanicalObject, a componant holding the degree of freedom of our # mechanical modelling. In the case of a cable it is a set of positions specifying # the points where the cable is passing by. cable.addObject('MechanicalObject', position=[ [10.0, 0.0, 0.0], [10.0, 0.0, 10.0], [10.0, 0.0, 20.0], [10.0, 0.0, 30.0], [10.0, 0.0, 40.0], [10.0, 0.0, 50.0], [10.0, 0.0, 60.0], [10.0, 0.0, 70.0], [10.0, 0.0, 80.0], [10.0, 0.0, 90.0], [10.0, 0.0, 100.0], [10.0, 0.0, 110.0], [10.0, 0.0, 120.0], [10.0, 0.0, 130.0], [10.0, 0.0, 140.0], [10.0, 0.0, 150.0], [10.0, 0.0, 160.0], [10.0, 0.0, 170.0], [10.0, 0.0, 180.0], [10.0, 0.0, 190.0], [10.0, 0.0, 200.0], [10.0, 0.0, 210.0], [10.0, 0.0, 220.0], [10.0, 0.0, 230.0], [10.0, 0.0, 240.0], [10.0, 0.0, 250.0], ]) # Create a CableConstraint object with a name. # The indices are referring to the MechanicalObject's positions. # The last indice is where the pullPoint is connected. cable.addObject('CableConstraint', name='CableConstraint', #indices=range(0,14), indices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25], pullPoint=[10.0, 0.0, -10.0], value=1 , valueType='displacement') cable.addObject('BarycentricMapping') def floor(parent, rotation=[0.0, 0.0, 0.0], translation=[0.0,0.0,0.0], scale=1): floor = parent.addChild('Floor') floor.addObject('MeshTopology', filename="mesh/floor.obj") floor.addObject('MechanicalObject', rotation=rotation, translation=translation, scale=scale) floor.addObject('TriangleCollisionModel') floor.addObject('LineCollisionModel') floor.addObject('PointCollisionModel')
And output in terminal when trying to open the scene:
daserk@pop-os:~/SOFA/build/bin$ ./runSofa ../../../LINX/Cylinder\ Actuator/main.pyscn [INFO] [runSofa] PluginRepository paths = /home/daserk/SOFA/build/plugins:/home/daserk/SOFA/build/lib [INFO] [runSofa] DataRepository paths = /home/daserk/SOFA/src/share:/home/daserk/SOFA/src/examples:/home/daserk/SOFA/build:/home/daserk/SOFA/build [INFO] [runSofa] GuiDataRepository paths = /home/daserk/SOFA/src/applications/projects/runSofa/resources:/home/daserk/SOFA/src/modules/SofaGuiQt/src/sofa/gui/qt/resources:/home/daserk/SOFA/build [INFO] [runSofa] Loading automatically plugin list in /home/daserk/SOFA/build/lib/plugin_list.conf [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaSimpleFem.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaRigid.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaDeformable.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaObjectInteraction.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMeshCollision.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaEngine.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaExplicitOdeSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaImplicitOdeSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaLoader.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralVisual.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGraphComponent.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralMeshCollision.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaBoundaryCondition.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralAnimationLoop.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralDeformable.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralEngine.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralExplicitOdeSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralImplicitOdeSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralLinearSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralRigid.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralObjectInteraction.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralSimpleFem.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralTopology.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaTopologyMapping.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaUserInteraction.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaConstraint.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaGeneralLoader.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaExporter.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaSparseSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaPreconditioner.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaHaptics.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaValidation.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaDenseSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaNonUniformFem.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaOpenglVisual.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscTopology.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscExtra.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscForceField.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscEngine.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscSolver.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscFem.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscMapping.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaMiscCollision.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libCImgPlugin.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libLMConstraint.so [INFO] [SofaPython3] Initializing with python version 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0] [INFO] [SofaPython3] Registering a scene loader for [.py, .py3, .pyscn, .py3scn] files. [INFO] [SofaPython3] Shared library name is 'libpython3.8m.so' [INFO] [SofaPython3] Intializing python [INFO] [SofaPython3] Added '/home/daserk/SOFA/SoftRobots/python' to sys.path [INFO] [SofaPython3] Added '/home/daserk/SOFA/build/lib/python3/site-packages' to sys.path [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSofaPython3.so [INFO] [PluginManager] Loaded plugin: /home/daserk/SOFA/build/lib/libSoftRobots.so [INFO] [QtViewer] OpenGL version: 3.1 Mesa 21.2.1 (X.Org) Controller initialized ########## SIG 11 - SIGSEGV: segfault ########## -> /home/daserk/SOFA/build/lib/libSofa.Helper.so.21.06.00(sofa::helper::BackTrace::dump()+0x20) [0x7f17776b9ad0] -> /home/daserk/SOFA/build/lib/libSofa.Helper.so.21.06.00(sofa::helper::BackTrace::sig(int)+0x364) [0x7f17776ba084] -> /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f1776fcd210] -> /home/daserk/SOFA/build/lib/python3/site-packages/Sofa/Core.cpython-38-x86_64-linux-gnu.so(+0xa6b6b) [0x7f175258bb6b] -> /home/daserk/SOFA/build/lib/python3/site-packages/Sofa/Core.cpython-38-x86_64-linux-gnu.so(+0x66aaa) [0x7f175254baaa] -> /home/daserk/SOFA/build/lib/python3/site-packages/Sofa/Core.cpython-38-x86_64-linux-gnu.so(+0xdea8e) [0x7f17525c3a8e] -> /home/daserk/SOFA/build/lib/python3/site-packages/Sofa/Core.cpython-38-x86_64-linux-gnu.so(+0x60b0c) [0x7f1752545b0c] -> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x2a8738) [0x7f176f961738] -> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyObject_MakeTpCall+0xab) [0x7f176f961b1b] -> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x2a8de0) [0x7f176f961de0] -> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x74d6d) [0x7f176f72dd6d] -> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x7d86) [0x7f176f735ef6] -> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x8006b) [0x7f176f73906b] -> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(PyVectorcall_Call+0x60) [0x7f176f961830] -> /home/daserk/SOFA/build/lib/libSofaPython3.so(+0x617c1) [0x7f176fc707c1] -> /home/daserk/SOFA/build/lib/libSofaPython3.so(sofapython3::SceneLoaderPY3::loadSceneWithArguments(char const*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, boost::intrusive_ptr<sofa::simulation::Node>)+0x45c) [0x7f176fc6f9fc] -> /home/daserk/SOFA/build/lib/libSofaPython3.so(sofapython3::SceneLoaderPY3::doLoad(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x84) [0x7f176fc6f504] -> /home/daserk/SOFA/build/lib/libSofa.SimulationCore.so.21.06.00(sofa::simulation::SceneLoader::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x9f) [0x7f177847e95f] -> /home/daserk/SOFA/build/lib/libSofa.SimulationCore.so.21.06.00(sofa::simulation::Simulation::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x19b) [0x7f1778482b8b] -> ./runSofa() [0x4157db] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f1776fae0b3] -> ./runSofa() [0x410b1e] Segmentation fault (core dumped) daserk@pop-os:~/SOFA/build/bin$
7 October 2021 at 11:13 #20551HugoKeymasterHey @daserk
Sorry SOFA-python debugging is complicated currently, we plan to work on it.
Could you first try to add in your controller:
class CableController(Sofa.Core.Controller): def __init__(self, *args, **kwargs): Sofa.Core.Controller.__init__(self, *args, *kwargs) #this line
Could you try to identify in which step of your script it is failing?
The create Scene worked well, could you add a print (anything) after the lineSofa.Simulation.init(root)
to check whether the initialization ended properly.Best
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.