Sdformat14 w Gazebo Harmonic in python

when trying to use sdformat14 via the python bindings I get this.

>>> import sdformat14
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/python3/dist-packages/sdformat14.cpython-312-x86_64-linux-gnu.so: undefined symbol: _ZN3sdf3v144Root20ClearActorLightModelEv

Gazebo seemed to install fine no errors or missing dependencies.

That sounds like there is missing library but I’m not sure how to find it. (Google didn’t find anything).

How did you installed sdformat14 ? Are you sure that you do not have multiple sdformat version installed in your system? What is the output of ldd /usr/lib/python3/dist-packages/sdformat14.cpython-312-x86_64-linux-gnu.so ?

I installed gazebo via gz-harmonic package as the tutorial said.

ldd gives me this:

$ ldd /usr/lib/python3/dist-packages/sdformat14.cpython-312-x86_64-linux-gnu.so
	linux-vdso.so.1 (0x00007ffe1f3fa000)
	libsdformat14.so.14 => /opt/ros/jazzy/opt/sdformat_vendor/lib/libsdformat14.so.14 (0x00007ac6aac00000)
	libgz-math7.so.7 => /opt/ros/jazzy/opt/gz_math_vendor/lib/libgz-math7.so.7 (0x00007ac6ab2e6000)
	libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ac6aa800000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ac6aaf17000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ac6ab286000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ac6aa400000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ac6ab342000)
	libgz-utils2.so.2 => /opt/ros/jazzy/opt/gz_utils_vendor/lib/libgz-utils2.so.2 (0x00007ac6ab27a000)
	libtinyxml2.so.10 => /lib/x86_64-linux-gnu/libtinyxml2.so.10 (0x00007ac6aaf00000)
	liburdfdom_model.so.4.0 => /opt/ros/jazzy/lib/x86_64-linux-gnu/liburdfdom_model.so.4.0 (0x00007ac6aaee4000)
	libconsole_bridge.so.1.0 => /lib/x86_64-linux-gnu/libconsole_bridge.so.1.0 (0x00007ac6ab272000)

They also seem to exist. (vdso is a kernel thing)

It looks like you’re using Gazebo with ROS. When used with ROS, Gazebo is distributed via vendor packages, so there is no need to install gz-harmonic. You just need to install ros-jazzy-ros-gz. Mixing the two versions (one from packages.ros.org and another from packages.osrfoundation.org) could lead to some ABI issues if the versions are not in sync due to the differences in the release cadence of the two repositories. I’d recommend sticking to the version that comes in packages.ros.org (i.e ros-jazzy-ros-gz). However, the python bindings in that version of Gazebo are not enabled yet (see https://github.com/gazebo-tooling/gz_vendor/issues/2), so if you need that, you could follow the instructions in https://gazebosim.org/docs/latest/ros2_gz_vendor_pkgs/#installing-non-default-gazebo-ros-2-pairings-with-vendor-packages.

1 Like