Segmentation Fault after creating Pinocchio robot

Hi,

I was trying to integrate Pinocchio with Isaac Sim. Since Pinocchio is a very popular robot kinematics and dynamics library I believe this issue would also be interesting to other members of the robotics community.

My issue is I encounter a segmentation fault every time I try to create a Robot instance.

The code I am using is called pinocchio_debug.py is

from pinocchio.robot_wrapper import RobotWrapper
from omni.isaac.kit import SimulationApp

simulation_app = SimulationApp({"headless": True})

from omni.isaac.core.utils.extensions import get_extension_path_from_name
from omni.isaac.urdf import _urdf
from omni.isaac.core.utils.nucleus import get_assets_root_path
from omni.isaac.core.utils.stage import add_reference_to_stage
from omni.isaac.core.robots import Robot
from fr3_usd import Franka
from omni.isaac.core import World
import omni.kit.commands
from omni.isaac.core.utils.types import ArticulationAction
from omni.isaac.core import SimulationContext
from fr3 import FR3
import numpy as np


world = World(stage_units_in_meters=1.0, physics_dt=1 / 1000)
world.scene.add_default_ground_plane()
simulation_context = SimulationContext()

# Acquire the URDF extension interface
urdf_interface = _urdf.acquire_urdf_interface()

# Set the settings in the import config
import_config = _urdf.ImportConfig()
import_config.merge_fixed_joints = False
import_config.convex_decomp = False
import_config.import_inertia_tensor = True
import_config.fix_base = True
import_config.make_default_prim = True
import_config.self_collision = False
import_config.create_physics_scene = True
import_config.import_inertia_tensor = False
import_config.default_drive_strength = 1047.19751
import_config.default_position_drive_damping = 52.35988
import_config.default_drive_type = _urdf.UrdfJointTargetType.JOINT_DRIVE_POSITION
import_config.distance_scale = 1
import_config.density = 0.0

# Create pin_robot
package_directory = "/home/mocap/Documents/FR3Env/FR3Env"
urdf_path = "/home/mocap/Documents/FR3Env/FR3Env/robots/fr3.urdf"
robot = RobotWrapper.BuildFromURDF(urdf_path, package_directory)

# Get the urdf file path
extension_path = get_extension_path_from_name("omni.isaac.urdf")
root_path = extension_path + "/data/urdf/robots/franka_description/robots"
file_name = "panda_arm_hand.urdf"
urdf_path = root_path + "/" + file_name

# Finally import the robot
result, prim_path = omni.kit.commands.execute(
    "URDFParseAndImportFile", urdf_path=urdf_path, import_config=import_config
)

fr3_robot = FR3(prim_path=prim_path, name="FR3_robot", position=np.array([0, 0, 0]))

world.scene.add(fr3_robot)

world.reset()

fr3_robot.disable_gravity()
articulation_controller = fr3_robot.get_articulation_controller()
articulation_controller.set_effort_modes("force")
articulation_controller.switch_control_mode("effort")

q_des = np.array(
    [
        np.pi / 4,
        -0.785398163,
        0.0,
        -2.35619449,
        0.0,
        1.57079632679,
        0.785398163397,
        0.0,
        0.0,
    ]
)

q_init = np.array(
    [
        0.0,
        -0.785398163,
        0.0,
        -2.35619449,
        0.0,
        1.57079632679,
        0.785398163397,
        0.0,
        0.0,
    ]
)
fr3_robot.set_joint_positions(q_init)

while simulation_app.is_running():
    q = fr3_robot.get_joint_positions()
    dq = fr3_robot.get_joint_velocities()
    t = simulation_context.current_time

    tau = 10 * (q_des - q) - 10 * dq

    action = ArticulationAction(joint_efforts=tau)
    articulation_controller.apply_action(action)
    world.step(render=True)

    print(q)

simulation_app.close()

To reproduce my error, pinocchio can be installed using pip

python3 -m pip install pin

To get the URDF file specified here:

package_directory = "/home/mocap/Documents/FR3Env/FR3Env"
urdf_path = "/home/mocap/Documents/FR3Env/FR3Env/robots/fr3.urdf"
robot = RobotWrapper.BuildFromURDF(urdf_path, package_directory)

Please clone the package FR3Env

git clone https://github.com/BolunDai0216/FR3Env.git

Then, when I run

gdb python
handle SIGSEGV stop
run /path/to/pinocchio_debug.py

I get the output

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffd01c3aea0 in ?? () from /home/mocap/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.urdf/bin/libomni.isaac.urdf.plugin.so

If I then backtrace it using the bt command, I get the output

#0  0x00007ffd01c3aea0 in ?? ()
   from /home/mocap/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.urdf/bin/libomni.isaac.urdf.plugin.so
#1  0x00007ffd01c59839 in ?? ()
   from /home/mocap/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.urdf/bin/libomni.isaac.urdf.plugin.so
#2  0x00007ffd01c5eb74 in ?? ()
   from /home/mocap/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.urdf/bin/libomni.isaac.urdf.plugin.so
#3  0x00007ffd01c60d08 in ?? ()
   from /home/mocap/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.urdf/bin/libomni.isaac.urdf.plugin.so
#4  0x00007ffd01c61c27 in ?? ()
   from /home/mocap/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.urdf/bin/libomni.isaac.urdf.plugin.so
#5  0x00007ffd01c4aaf2 in ?? ()
   from /home/mocap/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.urdf/bin/libomni.isaac.urdf.plugin.so
--Type <RET> for more, q to quit, c to continue without paging--c
#6  0x00007ffd01971ba7 in ?? () from /home/mocap/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.urdf/omni/isaac/urdf/_urdf.cpython-37m-x86_64-linux-gnu.so
#7  0x00007ffd0199cf15 in ?? () from /home/mocap/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.urdf/omni/isaac/urdf/_urdf.cpython-37m-x86_64-linux-gnu.so
#8  0x00007ffd019a4925 in ?? () from /home/mocap/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.urdf/omni/isaac/urdf/_urdf.cpython-37m-x86_64-linux-gnu.so
#9  0x00000000004aef97 in _PyMethodDef_RawFastCallKeywords (method=<optimized out>, self=0x7ffd01bfaf90, args=0x7ffc9c04f5e8, nargs=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Objects/call.c:693
#10 0x00000000004aed46 in _PyCFunction_FastCallKeywords (func=0x7ffd01bfeb90, args=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Objects/call.c:732
#11 0x00000000004aea19 in call_function (pp_stack=0x7fffffffc7e0, oparg=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:4619
#12 0x00000000004ab36a in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:3093
#13 0x00000000004b9d16 in PyEval_EvalFrameEx (throwflag=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>, f=0x7ffc9c04f450) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:544
#14 function_code_fastcall (globals=<optimized out>, nargs=1, nargs@entry=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>, args=<optimized out>, co=<optimized out>) at /usr/local/src/conda/python-3.7.16/Objects/call.c:283
#15 _PyFunction_FastCallKeywords (func=<optimized out>, stack=0x10e8b1e8, nargs=1, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Objects/call.c:408
#16 0x00000000004ae8df in call_function (pp_stack=0x7fffffffc9b0, oparg=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:4616
#17 0x00000000004a777e in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:3110
#18 0x00000000004b9d16 in PyEval_EvalFrameEx (throwflag=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>, f=0x10e8b010) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:544
#19 function_code_fastcall (globals=<optimized out>, nargs=4, nargs@entry=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>, args=<optimized out>, co=<optimized out>) at /usr/local/src/conda/python-3.7.16/Objects/call.c:283
#20 _PyFunction_FastCallKeywords (func=<optimized out>, stack=0x10e85518, nargs=4, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Objects/call.c:408
#21 0x00000000004ae8df in call_function (pp_stack=0x7fffffffcb88, oparg=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:4616
#22 0x00000000004a7651 in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:3124
#23 0x00000000004b9d16 in PyEval_EvalFrameEx (throwflag=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>, f=0x10e85370) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:544
#24 function_code_fastcall (globals=<optimized out>, nargs=3, nargs@entry=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>, args=<optimized out>, co=<optimized out>) at /usr/local/src/conda/python-3.7.16/Objects/call.c:283
#25 _PyFunction_FastCallKeywords (func=<optimized out>, stack=0x7ffd06af4d30, nargs=3, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Objects/call.c:408
#26 0x00000000004ae8df in call_function (pp_stack=0x7fffffffcd50, oparg=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:4616
#27 0x00000000004ab36a in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:3093
#28 0x00000000004a5a81 in PyEval_EvalFrameEx (throwflag=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>, f=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:547
#29 _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>, kwargs=0x7ffff7557bc8, kwcount=<optimized out>, kwstep=1, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x7ffff6c766f0, qualname=0x7ffff6c766f0) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:3930
#30 0x00000000004b9eac in _PyFunction_FastCallKeywords (func=<optimized out>, stack=0x7ffff7557bc0, nargs=1, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Objects/call.c:433
#31 0x00000000004ae8df in call_function (pp_stack=0x7fffffffd030, oparg=<optimized out>, kwnames=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:4616
#32 0x00000000004a82b6 in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:3139
#33 0x00000000004a5a81 in PyEval_EvalFrameEx (throwflag=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>, f=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:547
#34 _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>, kwargs=0x0, kwcount=<optimized out>, kwstep=2, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:3930
#35 0x00000000004a5879 in PyEval_EvalCodeEx (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kws=<optimized out>, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:3959
#36 0x000000000054a8db in PyEval_EvalCode (co=co@entry=0x7ffff75a6930, globals=globals@entry=0x7ffff75cd230, locals=locals@entry=0x7ffff75cd230) at /usr/local/src/conda/python-3.7.16/Python/ceval.c:524
#37 0x0000000000564e03 in run_mod (mod=<optimized out>, filename=<optimized out>, globals=0x7ffff75cd230, locals=0x7ffff75cd230, flags=<optimized out>, arena=<optimized out>) at /usr/local/src/conda/python-3.7.16/Python/pythonrun.c:1037
#38 0x000000000056b857 in PyRun_FileExFlags (fp=0x7132f0, filename_str=<optimized out>, start=<optimized out>, globals=0x7ffff75cd230, locals=0x7ffff75cd230, closeit=1, flags=0x7fffffffd310) at /usr/local/src/conda/python-3.7.16/Python/pythonrun.c:990
#39 0x000000000056ae34 in PyRun_SimpleFileExFlags (fp=0x7132f0, filename=0x7ffff760b470 "/home/mocap/Documents/DiffOptIsaac/pinocchio_debug.py", closeit=1, flags=0x7fffffffd310) at /usr/local/src/conda/python-3.7.16/Python/pythonrun.c:429
#40 0x000000000053fea3 in pymain_run_file (p_cf=0x7fffffffd310, filename=<optimized out>, fp=0x7132f0) at /usr/local/src/conda/python-3.7.16/Modules/main.c:470
#41 pymain_run_filename (cf=0x7fffffffd310, pymain=0x7fffffffd420) at /usr/local/src/conda/python-3.7.16/Modules/main.c:1660
#42 pymain_run_python (pymain=0x7fffffffd420) at /usr/local/src/conda/python-3.7.16/Modules/main.c:2970
#43 pymain_main (pymain=0x7fffffffd420) at /usr/local/src/conda/python-3.7.16/Modules/main.c:3517
#44 0x000000000053fb3c in _Py_UnixMain (argc=<optimized out>, argv=<optimized out>) at /usr/local/src/conda/python-3.7.16/Modules/main.c:3552
#45 0x00007ffff7c35083 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#46 0x000000000053f9ee in _start () at /usr/local/src/conda/python-3.7.16/Modules/itertoolsmodule.c:2515

If someone can help me understand what might be the issue that would be great! Please let me know if any additional information is needed to reproduce this.

Thanks in advance!

1 Like

Hi Bolun. I’d suggest trying again using the python environment provided with Isaac Sim.

Please see 5. Python Environment Installation — Omniverse IsaacSim latest documentation

@BuckBabich Thanks for the response!

I just tried that and it also gives me a segmentation fault

./python.sh: line 41: 457970 Segmentation fault      (core dumped) $python_exe "$@" $args
There was an error running python

were you able to get it to work on your end?

Just to clarify, you’re running the following?

./python.sh -m pip install pin
./python.sh /path/to/pinocchio_debug.py

Can you tell which line of your script is causing the fault?

@BuckBabich Thanks for the quick response!

Yes, I am running what you have provided. The line that gives me the segmentation fault is

# Finally import the robot
result, prim_path = omni.kit.commands.execute(
    "URDFParseAndImportFile", urdf_path=urdf_path, import_config=import_config
)

I know this because I added a breakpoint right in front of this line and the program is able to go into the breakpoint. Then when I manually ran this line in the pdb debugger I get a segmentation fault.

Could you remove this line and any using RobotWrapper to see if you still get the segfault?

from pinocchio.robot_wrapper import RobotWrapper

If I remove the lines

from pinocchio.robot_wrapper import RobotWrapper

and

robot = RobotWrapper.BuildFromURDF(urdf_path, package_directory)

the segmentation fault goes away.

If I just include the import from pinocchio.robot_wrapper import RobotWrapper there will still be a segmentation fault.

Another thing I noticed is that if instead of using the URDF to create the Robot instance, I use a USD file, the segmentation fault does not appear even if I use pinocchio.

Do you have anything in your LD_LIBRARY_PATH (or LD_PRELOAD)?

My LD_LIBRARY_PATH looks like this

:./../../../:./.:./exts/omni.usd.schema.isaac/bin:./exts/omni.isaac.motion_planning/bin:./kit:./kit/kernel/plugins:./kit/libs/iray:./kit/plugins:./kit/plugins/bindings-python:./kit/plugins/carb_gfx:./kit/plugins/rtx:./kit/plugins/gpu.foundation:./kit/extensions/extensions-bundled/bin

there is nothing in my LD_PRELOAD.

I don’t see any red flags there.

Isaac Sim 2023.1.0 should be releasing this week (exact date TBD). If you’re able to wait, it might be best to try it with that release to see if the issue has been fixed. If it persists, we can dig deeper.

I suspect that the root cause might be an incompatibility between the version of urdfdom used by the Lula library in Isaac Sim and the one used by Pinocchio.

The deprecated omni.isaac.motion_planning extension is finally being removed in 2023.1.0, since it was long ago replaced by omni.isaac.motion_generation. The former linked against lula and thus urdfdom directly, so there’s reason to think that the situation might be improved in 2023.1.0.

Would there be an issue with installing multiple versions of Isaac Sim on the same computer?

Not in general. You can install multiple versions from the Omniverse Launcher, and they should happily coexist.

Do you know how to specify which version of Isaac Sim to use from a python standalone script?

@BuckBabich After testing the script on the new version of Isaac Sim I believe the segmentation fault is still there. The code I am running is

from pinocchio.robot_wrapper import RobotWrapper
from omni.isaac.kit import SimulationApp

simulation_app = SimulationApp({"headless": False})

from omni.isaac.core.utils.extensions import get_extension_path_from_name
from omni.importer.urdf import _urdf
from omni.isaac.core.utils.nucleus import get_assets_root_path
from omni.isaac.core.utils.stage import add_reference_to_stage
from omni.isaac.core.robots import Robot
from fr3_usd import Franka
from omni.isaac.core import World
import omni.kit.commands
from omni.isaac.core.utils.types import ArticulationAction
from omni.isaac.core import SimulationContext
from fr3 import FR3
import numpy as np


world = World(stage_units_in_meters=1.0, physics_dt=1 / 1000)
world.scene.add_default_ground_plane()
simulation_context = SimulationContext()

# Acquire the URDF extension interface
urdf_interface = _urdf.acquire_urdf_interface()

# Set the settings in the import config
import_config = _urdf.ImportConfig()
import_config.merge_fixed_joints = False
import_config.convex_decomp = False
import_config.import_inertia_tensor = True
import_config.fix_base = True
import_config.make_default_prim = True
import_config.self_collision = False
import_config.create_physics_scene = True
import_config.import_inertia_tensor = True
import_config.default_drive_strength = 1047.19751
import_config.default_position_drive_damping = 52.35988
import_config.default_drive_type = _urdf.UrdfJointTargetType.JOINT_DRIVE_POSITION
import_config.distance_scale = 1
import_config.density = 0.0

# Create pin_robot
package_directory = "/home/mocap/Documents/FR3Env/FR3Env"
urdf_path = "/home/mocap/Documents/FR3Env/FR3Env/robots/fr3.urdf"
robot = RobotWrapper.BuildFromURDF(urdf_path, package_directory)

# Finally import the robot
result, prim_path = omni.kit.commands.execute("URDFParseAndImportFile", urdf_path=urdf_path, import_config=import_config)

fr3_robot = FR3(prim_path=prim_path, name="FR3_robot", position=np.array([0, 0, 0]))

world.scene.add(fr3_robot)

world.reset()

fr3_robot.disable_gravity()
articulation_controller = fr3_robot.get_articulation_controller()
articulation_controller.set_effort_modes("force")
articulation_controller.switch_control_mode("effort")

q_des = np.array(
    [
        np.pi / 4,
        -0.785398163,
        0.0,
        -2.35619449,
        0.0,
        1.57079632679,
        0.785398163397,
        0.0,
        0.0,
    ]
)

q_init = np.array(
    [
        0.0,
        -0.785398163,
        0.0,
        -2.35619449,
        0.0,
        1.57079632679,
        0.785398163397,
        0.0,
        0.0,
    ]
)
fr3_robot.set_joint_positions(q_init)

while simulation_app.is_running():
    q = fr3_robot.get_joint_positions()
    dq = fr3_robot.get_joint_velocities()
    t = simulation_context.current_time

    tau = 10 * (q_des - q) - 10 * dq

    action = ArticulationAction(joint_efforts=tau)
    articulation_controller.apply_action(action)
    world.step(render=True)

    print(q)

simulation_app.close()

The output is

[14.547s] Simulation App Startup Complete
Fatal Python error: Segmentation fault

Current thread 0x00007f9f27025b80 (most recent call first):
  File "/home/mocap/.local/share/ov/pkg/isaac_sim-2023.1.0/extscache/omni.importer.urdf-1.1.3+105.1.lx64.r.cp310/omni/importer/urdf/scripts/commands.py", line 107 in do
  File "/home/mocap/.local/share/ov/pkg/isaac_sim-2023.1.0/kit/exts/omni.kit.commands/omni/kit/undo/undo.py", line 419 in _execute
  File "/home/mocap/.local/share/ov/pkg/isaac_sim-2023.1.0/kit/exts/omni.kit.commands/omni/kit/undo/undo.py", line 77 in execute
  File "/home/mocap/.local/share/ov/pkg/isaac_sim-2023.1.0/kit/exts/omni.kit.commands/omni/kit/commands/command.py", line 463 in execute
  File "/home/mocap/Documents/DiffOptIsaac/nvidia_debug.py", line 49 in <module>

Extension modules: numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, hppfcl.hppfcl, pinocchio.pinocchio_pywrap, psutil._psutil_linux, psutil._psutil_posix, pydantic.version, pydantic.utils, pydantic.color, pydantic.validators, pydantic.error_wrappers, pydantic.fields, pydantic.parse, pydantic.schema, pydantic.annotated_types, omni.mdl.pymdlsdk._pymdlsdk, torch._C, torch._C._fft, torch._C._linalg, torch._C._nested, torch._C._nn, torch._C._sparse, torch._C._special, scipy._lib._ccallback_c, scipy.sparse._sparsetools, _csparsetools, scipy.sparse._csparsetools, scipy.sparse.linalg._isolve._iterative, scipy.linalg._fblas, scipy.linalg._flapack, scipy.linalg._cythonized_array_utils, scipy.linalg._flinalg, scipy.linalg._solve_toeplitz, scipy.linalg._matfuncs_sqrtm_triu, scipy.linalg.cython_lapack, scipy.linalg.cython_blas, scipy.linalg._matfuncs_expm, scipy.linalg._decomp_update, scipy.sparse.linalg._dsolve._superlu, scipy.sparse.linalg._eigen.arpack._arpack, scipy.sparse.csgraph._tools, scipy.sparse.csgraph._shortest_path, scipy.sparse.csgraph._traversal, scipy.sparse.csgraph._min_spanning_tree, scipy.sparse.csgraph._flow, scipy.sparse.csgraph._matching, scipy.sparse.csgraph._reordering, scipy.spatial._ckdtree, scipy._lib.messagestream, scipy.spatial._qhull, scipy.spatial._voronoi, scipy.spatial._distance_wrap, scipy.spatial._hausdorff, scipy.special._ufuncs_cxx, scipy.special._ufuncs, scipy.special._specfun, scipy.special._comb, scipy.special._ellip_harm_2, scipy.spatial.transform._rotation, PIL._imaging, numpy.linalg.lapack_lite, PIL._imagingft, scipy.ndimage._nd_image, _ni_label, scipy.ndimage._ni_label, osqp._osqp, multidict._multidict, yarl._quoting_c, aiohttp._helpers, aiohttp._http_writer, aiohttp._http_parser, aiohttp._websocket, cchardet._cchardet, _cffi_backend, frozenlist._frozenlist, yaml._yaml, scipy.io.matlab._mio_utils, scipy.io.matlab._streams, scipy.io.matlab._mio5_utils (total: 90)
./python.sh: line 41: 62020 Segmentation fault      (core dumped) $python_exe "$@" $args
There was an error running python

The line that’s giving the issue is

result, prim_path = omni.kit.commands.execute("URDFParseAndImportFile", urdf_path=urdf_path, import_config=import_config)

Please let me know if you need more information.

You probably figured this out, but it’s just determined by which python.sh you use to run your script.

1 Like

Hi @bolun - According to the posted error message, the issue arises from the “URDFParseAndImportFile” command during the execution of your script. The segmentation fault signals that your script is trying to access memory that it shouldn’t.

There could be several reasons for this issue:

  1. Incorrect URDF File or Path: Ensure that the URDF file located at urdf_path is valid and correctly formatted. An invalid URDF file might lead to unexpected behavior. Also, verify that the file path to the URDF file is correct and accessible from the environment executing the script.
  2. Import Config Settings: You may need to tweak the import config settings to match the specific needs of your URDF file. The problem might come from incorrect configuration settings like setting import_inertia_tensor to True when there might not be correct inertia tensor data in the URDF file.
  3. Version Incompatibility: Ensure that you’re using compatible versions of Isaac Sim, the PhysX SDK or any other related libraries or APIs. A version mismatch can lead to unpredictable segmentation faults.
  4. Multi-Threading Issue: When working with multiple threads, segmentation faults can be caused by race conditions or other timing issues, where two threads are trying to access or modify the same memory resource at the same time. If your setup uses multiple threads, you may need to investigate in this direction.

The URDF reader will crash if the URDF (or robot description yaml) references a link that doesn’t exist in the URDF. If you have a prismatic joint without a limit it will also crash IIRC. To debug keep simplifying the URDF until it doesn’t crash, then add stuff back until it does crash.