tavie/ros2

Hey there! I’m experiencing an issue on Fedora 41 where ros2 launch is not included with any of the typical jazzy packages.

ros2-jazzy-desktop does not seem to be available on F41. I remember experiencing something similar on F40 when it first came out. So, I once again picked some packages that looked useful, currently these.

However, ros2 launch does not appear to be installed, and I can’t find any documentation on the relationship between this collection’s package names and the ros2 commands.

$ ros2 launch
usage: ros2 [-h] [--use-python-default-buffering]
            Call `ros2 <command> -h` for more detailed usage. ...
ros2: error: argument Call `ros2 <command> -h` for more detailed usage.: invalid choice: 'launch' (choose from action, component, daemon, doctor, extension_points, extensions, interface, lifecycle, multicast, node, param, pkg, run, security, service, topic, wtf)

Because of the dynamic nature of the ros2 command, dnf provides can’t provide any information about the installable subcommands - not even about ros2itself!

$ dnf provides ros2
Updating and loading repositories:
Repositories loaded.
No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.

Can you please assist me in finding the correct package, if available, or rebuilding ros2run with launch support as mentioned here?

Never mind, it’s included with ros2-jazzy-ros2cli_common_extensions-devel. Had the idea 5 seconds after I posted that. :smile:

Hi, back again.

I’m now having trouble using ros2 launch with any arbitrary file due to ros2 expecting a certain file that isn’t provided:

$ ros2 launch launch/initial.yaml
[INFO] [launch]: All log files can be found below /home/barrett/.ros/log/2024-12-27-21-37-05-515888-farts-130437
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [navigator_node-1]: process started with pid [130440]
[navigator_node-1] Traceback (most recent call last):
[navigator_node-1]   File "/home/barrett/Documents/projects/Rover/auto_ros2/install/navigator_node/lib/navigator_node/navigator_node", line 33, in <module>
[navigator_node-1]     sys.exit(load_entry_point('navigator-node', 'console_scripts', 'navigator_node')())
[navigator_node-1]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[navigator_node-1]   File "/home/barrett/Documents/projects/Rover/auto_ros2/install/navigator_node/lib/navigator_node/navigator_node", line 25, in importlib_load_entry_point
[navigator_node-1]     return next(matches).load()
[navigator_node-1]            ^^^^^^^^^^^^^^^^^^^^
[navigator_node-1]   File "/usr/lib64/python3.11/importlib/metadata/__init__.py", line 202, in load
[navigator_node-1]     module = import_module(match.group('module'))
[navigator_node-1]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[navigator_node-1]   File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
[navigator_node-1]     return _bootstrap._gcd_import(name[level:], package, level)
[navigator_node-1]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[navigator_node-1]   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
[navigator_node-1]   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
[navigator_node-1]   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
[navigator_node-1]   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
[navigator_node-1]   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
[navigator_node-1]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[navigator_node-1]   File "/home/barrett/Documents/projects/Rover/auto_ros2/build/navigator_node/navigator_node/main.py", line 1, in <module>
[navigator_node-1]     import rclpy
[navigator_node-1]   File "/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/__init__.py", line 49, in <module>
[navigator_node-1]     from rclpy.signals import install_signal_handlers
[navigator_node-1]   File "/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/signals.py", line 15, in <module>
[navigator_node-1]     from rclpy.exceptions import InvalidHandle
[navigator_node-1]   File "/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/exceptions.py", line 16, in <module>
[navigator_node-1]     from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy
[navigator_node-1]   File "/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/impl/implementation_singleton.py", line 32, in <module>
[navigator_node-1]     rclpy_implementation = import_c_library('._rclpy_pybind11', package)
[navigator_node-1]                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[navigator_node-1]   File "/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rpyutils/import_c_library.py", line 39, in import_c_library
[navigator_node-1]     return importlib.import_module(name, package=package)
[navigator_node-1]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[navigator_node-1]   File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
[navigator_node-1]     return _bootstrap._gcd_import(name[level:], package, level)
[navigator_node-1]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[navigator_node-1] ModuleNotFoundError: No module named 'rclpy._rclpy_pybind11'
[navigator_node-1] The C extension '/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/_rclpy_pybind11.cpython-311-x86_64-linux-gnu.so' isn't present on the system. Please refer to 'https://docs.ros.org/en/jazzy/How-To-Guides/Installation-Troubleshooting.html#import-failing-without-library-present-on-the-system' for possible solutions
[ERROR] [navigator_node-1]: process has died [pid 130440, exit code 1, cmd '/home/barrett/Documents/projects/Rover/auto_ros2/install/navigator_node/lib/navigator_node/navigator_node --ros-args -r __node:=navigator_node'].

However, there is a /usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/_rclpy_pybind11.cpython-313-x86_64-linux-gnu.so.

This is provided by the packages themselves:

$ dnf provides /usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/_rclpy_pybind11.cpython-313-x86_64-linux-gnu.so
Updating and loading repositories:
Repositories loaded.
ros2-jazzy-rclpy-7.1.2-1.fc41.x86_64 : ROS package rclpy
Repo         : @System
Matched From :
Filename     : /usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/_rclpy_pybind11.cpython-313-x86_64-linux-gnu.so

ros2-jazzy-rclpy-7.1.2-1.fc41.x86_64 : ROS package rclpy
Repo         : copr:copr.fedorainfracloud.org:tavie:ros2
Matched From :
Filename     : /usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/_rclpy_pybind11.cpython-313-x86_64-linux-gnu.so

(navigator-node) barrett@farts ~/D/p/R/auto_ros2 (feat/rover_communication)>

Has anyone gotten past this on Fedora 41? Is there any way to politely ask that ROS 2 is agnostic on the exact Python version?

Sorry for the late reply, I somehow completely missed this.
It is not possible to make ROS agnostic to the exact python version because of the numerous times the binaries require pybind11 to provide c(++) code in python.
The policy in ROS is to therefore target the python version that is native to the target Ubuntu Version (and a few packges, e.g., the webots stack even hardcode the python version for specific ROS releases).
I slightly deviate from this by instead targeting the native python version of the respective fedora release (which requires a bit of patching but mostly is a smooth transition).

So if you want to use ROS with a different python version than the one I target, you will need to compile everything yourself and be prepared to replace a few occurrences of hardcoded python versions in packages (but really it rarely happens).

Am I correctly assuming that you tried running your ROS code in these instances with a different python version and that caused the crashes?
Because as far as I am aware the packages work on f41 (tho, I admit I personally still use 40 and currently prepare to switch to 42).

No worries at all! Let me explain:

  • It not working with other Python versions makes total sense to me now! We use uv to manage our Python installation, so there’s no problem. However, it appears that Fedora 41 defaults to Python 3.13, while the ROS 2 installation really wants to use Python 3.10 or 3.11.
  • Sounds good - I won’t be doing any more full-stack compilations like that. Last time I tried, it failed after several hours. D:
  • And, yes - the crashes were caused by mismatched Python and dependency versions. I had to use the virtual environment for all Python dependencies. Otherwise, the versions were too new!

I also had to do some incredibly hacky rosdep package mapping to get packages to install correctly. Thank you so much for the Ubuntu-compatible packages, helped me a lot!

Simulation

While I have you: do you have any plans to package the Gazebo Ignition simulator for aligned ROS 2 and Gazebo versioning?

I’m missing these packages, so I still have to use a Podman container to work on my project:

No match for argument: ros-jazzy-ros2-control
No match for argument: ros-jazzy-tf-transformations
No match for argument: ros-jazzy-ros2-controllers
No match for argument: ros-jazzy-ros-gz-sim
No match for argument: ros-jazzy-controller-manager
No match for argument: ros-jazzy-nav2-bringup
No match for argument: ros-jazzy-rqt-controller-manager
No match for argument: ros-jazzy-gz-ros2-control

In any case, this COPR makes working on a large project much less painful - inline suggestions are incredibly important. Thank you so much for the effort! :grinning_face_with_smiling_eyes:

some of these packages are definitly not a problem (and should already be there for f42, will package them up for f41 as well now). I admit that I neglected f41 quite a bit as my projects are all either running f40 or f42 at the moments.

I havent used gazebo in a long time and I had quite a few issues when packaging their stuff, so if you encounter any issues with gazebo related packages (very likely that you for example need to set some environment variables manually), would be helpful to get feedback and maybe I can fix these up as well.

The packages from your list that I have not touched yet are these, which I will kook into as well this week, i think it should not be a problem to add them:

ros-jazzy-rqt-controller-manager
ros-jazzy-gz-ros2-control

okay, all packages from your list should now be there for f41 and f42.

1 Like

Thank you! All the other packages work (when I allow it to erase non-free FFmpeg packages), but there doesn’t seem to be a ros-jazzy-ros-gz for Gazebo.

In Ubuntu 24.04, that’s a metapackage to grab some important things for Gazebo <=> ROS 2 communication. See: ros_gz — ros_gz 1.0.11 documentation

(autonomous) barrett@farts ~/D/p/R/auto_ros2 (feat/object_avoidance)> sudo dnf install --allowerasing ros-jazzy-launch-ros ros-jazzy-tf2-ros ros-jazzy-depthimage-to-laserscan ros-jazzy-tf-transformations ros-jazzy-launch-testing-ament-cmake ros-jazzy-ros-gz ros-jazzy-rqt-graph ros-jazzy-nav2-msgs ros-jazzy-cv-bridge ros-jazzy-launch ros-jazzy-vision-opencv ros-jazzy-robot-localization ros-jazzy-tf2 ros-jazzy-ament-lint-auto ros-jazzy-nav2-behavior-tree ros-jazzy-rmw-cyclonedds-cpp ros-jazzy-ros-gz-image ros-jazzy-rqt-controller-manager ros-jazzy-nav2-bringup ros-jazzy-nav2-simple-commander ros-jazzy-geographic-msgs ros-jazzy-ros-gz-bridge ros-jazzy-rosidl-default-generators ros-jazzy-rqt-tf-tree ros-jazzy-ament-cmake-clang-format ros-jazzy-ros-gz-sim ros-jazzy-xacro ros-jazzy-geometry-msgs ros-jazzy-ament-cmake-auto ros-jazzy-cyclonedds ros-jazzy-ament-lint-common ros-jazzy-joint-state-publisher ros-jazzy-ament-pep257 ros-jazzy-rclpy ros-jazzy-ament-cmake ros-jazzy-tf2-tools ros-jazzy-sensor-msgs ros-jazzy-controller-manager ros-jazzy-ros2-control ros-jazzy-robot-state-publisher ros-jazzy-launch-testing ros-jazzy-rosidl-default-runtime ros-jazzy-gz-ros2-control ros-jazzy-ros2-controllers ros-jazzy-rviz2
Updating and loading repositories:
Repositories loaded.
Failed to resolve the transaction:
Package "ros-jazzy-launch-ros-0.26.7-1.fc41.noarch" is already installed.
Package "ros-jazzy-tf2-ros-0.36.10-1.fc41.noarch" is already installed.
Package "ros-jazzy-depthimage-to-laserscan-2.5.1-3.el9.20250430.003808.x86_64" is already installed.
Package "ros-jazzy-launch-testing-ament-cmake-3.4.4-1.fc41.noarch" is already installed.
No match for argument: ros-jazzy-ros-gz
Package "ros-jazzy-rqt-graph-1.5.4-1.fc41.noarch" is already installed.
Package "ros-jazzy-nav2-msgs-1.3.6-1.fc41.noarch" is already installed.
Package "ros-jazzy-cv-bridge-4.1.0-1.fc41.noarch" is already installed.
Package "ros-jazzy-launch-3.4.4-1.fc41.noarch" is already installed.
Package "ros-jazzy-vision-opencv-4.1.0-1.fc41.noarch" is already installed.
Package "ros-jazzy-robot-localization-3.8.2-1.fc41.noarch" is already installed.
Package "ros-jazzy-tf2-0.36.10-1.fc41.noarch" is already installed.
Package "ros-jazzy-ament-lint-auto-0.17.2-1.fc41.noarch" is already installed.
Package "ros-jazzy-nav2-behavior-tree-1.3.6-1.fc41.noarch" is already installed.
Package "ros-jazzy-rmw-cyclonedds-cpp-2.2.3-1.fc41.noarch" is already installed.
Package "ros-jazzy-nav2-simple-commander-1.3.6-1.fc41.noarch" is already installed.
Package "ros-jazzy-geographic-msgs-1.0.6-2.el9.20250424.114835.x86_64" is already installed.
Package "ros-jazzy-ros-gz-bridge-1.0.11-1.fc41.noarch" is already installed.
Package "ros-jazzy-rosidl-default-generators-1.6.0-3.el9.20250424.111415.x86_64" is already installed.
Package "ros-jazzy-rqt-tf-tree-1.0.5-1.el9.20250430.012622.x86_64" is already installed.
Package "ros-jazzy-ament-cmake-clang-format-0.17.2-1.el9.20250424.100939.x86_64" is already installed.
Package "ros-jazzy-xacro-2.0.13-1.fc41.noarch" is already installed.
Package "ros-jazzy-geometry-msgs-5.3.6-1.fc41.noarch" is already installed.
Package "ros-jazzy-ament-cmake-auto-2.5.4-1.fc41.noarch" is already installed.
Package "ros-jazzy-cyclonedds-0.10.5-1.fc41.noarch" is already installed.
Package "ros-jazzy-ament-lint-common-0.17.2-1.fc41.noarch" is already installed.
Package "ros-jazzy-joint-state-publisher-2.4.0-3.el9.20250429.230758.x86_64" is already installed.
Package "ros-jazzy-ament-pep257-0.17.2-1.fc41.noarch" is already installed.
Package "ros-jazzy-rclpy-7.1.4-1.fc41.noarch" is already installed.
Package "ros-jazzy-ament-cmake-2.5.4-1.fc41.noarch" is already installed.
Package "ros-jazzy-sensor-msgs-5.3.6-1.fc41.noarch" is already installed.
Package "ros-jazzy-robot-state-publisher-3.3.3-3.el9.20250430.003915.x86_64" is already installed.
Package "ros-jazzy-launch-testing-3.4.4-1.fc41.noarch" is already installed.
Package "ros-jazzy-rosidl-default-runtime-1.6.0-3.el9.20250424.111425.x86_64" is already installed.
Package "ros-jazzy-rviz2-14.1.10-1.fc41.noarch" is already installed.
You can try to add to command line:
  --skip-unavailable to skip unavailable packages
(autonomous) barrett@farts ~/D/p/R/auto_ros2 (feat/object_avoidance) [1]>

Nonetheless, with sudo dnf install --allowerasing --skip-unavailable, everything else installs perfectly. Thank you so much for the updates!

Alright, so I’m able to build everything perfectly, which is incredible! I also have zero errors in my editor.

However, when running the simulator, one of my launch files fails:

[ERROR] [launch]: Caught exception in launch (see debug for traceback): "package 'depthimage_to_laserscan' not found, searching: ['/usr/lib64/ros2-jazzy', <other local packages>]"
error: Recipe `sim` failed with exit code 1

This seems to be correct, as I can’t find depthimage_to_laserscan in the Fedora path for ROS 2. It does appear in the more typical /opt/ros/jazzy folder:

barrett@farts ~> rg "depthimage" /usr/lib64/ros2-jazzy
barrett@farts ~ [1]> rg "depthimage" /opt/ros/jazzy
/opt/ros/jazzy/share/depthimage_to_laserscan/package.xml
3:  <name>depthimage_to_laserscan</name>
5:  <description>depthimage_to_laserscan</description>
10:  <url type="website">http://ros.org/wiki/depthimage_to_laserscan</url>
11:  <url type="bugtracker">https://github.com/ros-perception/depthimage_to_laserscan/issues</url>
12:  <url type="repository">https://github.com/ros-perception/depthimage_to_laserscan</url>

# (...snip)

I want to help search results for future users! So, here’s a little story about how I fixed it up…

I grabbed the source with dnf download --source ros2-jazzy-depthimage_to_laserscan.x86_64, ran sudo dnf install mock rpmdevtools && sudo usermod -a -G mock $(whoami) && newgrp mock to grab build tools, and unarchived the source file with rpm -ivh ros2-jazzy-depthimage_to_laserscan-2.5.1-1.fc41.src.rpm. In ~/SPECS, there was ros2-depthimage_to_laserscan.spec.

Looking in that file, there was a misspelling: GZ_BUILD_FROM_SURCE=1; export GZ_BUILD_FROM_SOURCE. That seems like it’d hurt something…

I fixed it to be GZ_BUILD_FROM_SOURCE=1; export GZ_BUILD_FROM_SOURCE, then saved the file. We can build the package now. Doing so is pretty simple with mock, but we’ll want the COPR installed within the container - otherwise, we’ll get errors like this:

Start: build phase for ros2-jazzy-depthimage_to_laserscan-2.5.1-1.fc41.src.rpm
Start: build setup for ros2-jazzy-depthimage_to_laserscan-2.5.1-1.fc41.src.rpm
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1714176000
Wrote: /builddir/build/SRPMS/ros2-jazzy-depthimage_to_laserscan-2.5.1-1.fc41.src.rpm
Updating and loading repositories:
 updates                                100% | 111.2 KiB/s |  30.6 KiB |  00m00s
 fedora                                 100% | 121.9 KiB/s |  30.8 KiB |  00m00s
Repositories loaded.
Failed to resolve the transaction:
Package "coreutils-9.5-11.fc41.x86_64" is already installed.
Package "patch-2.7.6-25.fc41.x86_64" is already installed.
No match for argument: ros2-jazzy-ament_cmake_ros-devel
No match for argument: ros2-jazzy-ament_package-devel
No match for argument: ros2-jazzy-image_geometry-devel
No match for argument: ros2-jazzy-rclcpp-devel
No match for argument: ros2-jazzy-rclcpp_components-devel
No match for argument: ros2-jazzy-sensor_msgs-devel
You can try to add to command line:
  --skip-unavailable to skip unavailable packages
Finish: build setup for ros2-jazzy-depthimage_to_laserscan-2.5.1-1.fc41.src.rpm
Finish: build phase for ros2-jazzy-depthimage_to_laserscan-2.5.1-1.fc41.src.rpm
ERROR: Exception(/home/barrett/rpmbuild/SRPMS/ros2-jazzy-depthimage_to_laserscan-2.5.1-1.fc41.src.rpm) Config(fedora-41-x86_64) 0 minutes 48 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-41-x86_64/result
ERROR: Command failed:
 # /usr/bin/systemd-nspawn -q -M 849f0e10766c42bba9771224be4f2a10 -D /var/lib/mock/fedora-41-x86_64-bootstrap/root -a --capability=cap_ipc_lock --bind=/tmp/mock-resolv.gqq4nxpe:/etc/resolv.conf --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/var/lib/mock/fedora-41-x86_64/root/installation-homedir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin '--setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007"' '--setenv=PS1=<mock-chroot> \s-\v\$ ' --setenv=LANG=C.UTF-8 --setenv=LC_MESSAGES=C.UTF-8 --resolv-conf=off /usr/bin/dnf5 builddep --installroot /var/lib/mock/fedora-41-x86_64/root/ --releasever 41 /var/lib/mock/fedora-41-x86_64/root//builddir/build/SRPMS/ros2-jazzy-depthimage_to_laserscan-2.5.1-1.fc41.src.rpm --setopt=deltarpm=False --setopt=allow_vendor_change=yes --allowerasing --setopt=tsflags=nocontexts
Updating and loading repositories:
 updates                                100% | 111.2 KiB/s |  30.6 KiB |  00m00s
 fedora                                 100% | 121.9 KiB/s |  30.8 KiB |  00m00s
Repositories loaded.
Failed to resolve the transaction:
Package "coreutils-9.5-11.fc41.x86_64" is already installed.
Package "patch-2.7.6-25.fc41.x86_64" is already installed.
No match for argument: ros2-jazzy-ament_cmake_ros-devel
No match for argument: ros2-jazzy-ament_package-devel
No match for argument: ros2-jazzy-image_geometry-devel
No match for argument: ros2-jazzy-rclcpp-devel
No match for argument: ros2-jazzy-rclcpp_components-devel
No match for argument: ros2-jazzy-sensor_msgs-devel
You can try to add to command line:
  --skip-unavailable to skip unavailable packages

(autonomous) barrett@farts ~/rpmbuild [30]>

To get the COPR in there, just run sudo cp /etc/mock/fedora-41-x86_64.cfg /etc/mock/fedora-41-ros2-x86_64.cfg, then sudo nano /etc/mock/fedora-41-ros2-x86_64.cfg to add the COPR:

config_opts['releasever'] = '41'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)

include('templates/fedora-branched.tpl')

config_opts['yum.conf'] += """
[ros2]
name=ROS 2 Fedora Repository
baseurl=https://download.copr.fedorainfracloud.org/results/tavie/ros2/fedora-$releasever-$basearch/
enabled=1
gpgcheck=0
"""

To build the package, we first need to generate an archive: rpmbuild -bs ~/rpmbuild/SPECS/ros2-depthimage_to_laserscan.spec

After that, we can build the package in the mock container with mock -r fedora-41-ros2-x86_64 --rebuild ~/rpmbuild/SRPMS/ros2-jazzy-depthimage_to_laserscan-2.5.1-2.fc41.src.rpm. It takes a second, but eventually, completes with:

Recommends: ros2-jazzy-depthimage_to_laserscan-debugsource(x86-64) = 2.5.1-2.fc41
Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILD/ros2-jazzy-depthimage_to_laserscan-2.5.1-build/BUILDROOT
Wrote: /builddir/build/RPMS/ros2-jazzy-depthimage_to_laserscan-debugsource-2.5.1-2.fc41.x86_64.rpm
Wrote: /builddir/build/RPMS/ros2-jazzy-depthimage_to_laserscan-devel-2.5.1-2.fc41.x86_64.rpm
Wrote: /builddir/build/RPMS/ros2-jazzy-depthimage_to_laserscan-2.5.1-2.fc41.x86_64.rpm
Wrote: /builddir/build/RPMS/ros2-jazzy-depthimage_to_laserscan-debuginfo-2.5.1-2.fc41.x86_64.rpm
Finish: rpmbuild ros2-jazzy-depthimage_to_laserscan-2.5.1-2.fc41.src.rpm
Finish: build phase for ros2-jazzy-depthimage_to_laserscan-2.5.1-2.fc41.src.rpm
INFO: Done(/home/barrett/rpmbuild/SRPMS/ros2-jazzy-depthimage_to_laserscan-2.5.1-2.fc41.src.rpm) Config(fedora-41-ros2-x86_64) 2 minutes 23 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-41-x86_64/result
Finish: run
(autonomous) barrett@farts ~/rpmbuild>

Finally, we can check if the RPM installs how we want it to from that result dir it said to use…

(autonomous) barrett@farts ~/rpmbuild> rpm -qlp /var/lib/mock/fedora-41-x86_64/result/ros2-jazzy-depthimage_to_laserscan-*.rpm | rg /usr/lib64/ros2-jazzy/share/depthimage_to_laserscan
/usr/lib64/ros2-jazzy/share/depthimage_to_laserscan
/usr/lib64/ros2-jazzy/share/depthimage_to_laserscan/cfg
# (...snip)

Sure enough, the package is fixed!

Here’s a patch if you don’t mind contributions:

--- ros2-depthimage_to_laserscan.OLD.spec	2024-04-26 19:00:00.000000000 -0500
+++ ros2-depthimage_to_laserscan.spec	2025-05-03 17:28:33.520601017 -0500
@@ -1,6 +1,6 @@
 Name:           ros2-jazzy-depthimage_to_laserscan
 Version:        2.5.1
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        ROS package depthimage_to_laserscan

 License:        BSD
@@ -92,7 +92,7 @@
 %install

 PYTHONUNBUFFERED=1 ; export PYTHONUNBUFFERED
-GZ_BUILD_FROM_SURCE=1; export GZ_BUILD_FROM_SOURCE
+GZ_BUILD_FROM_SOURCE=1; export GZ_BUILD_FROM_SOURCE
 export GZ_VERSION=harmonic;

 CFLAGS=" -Wno-error ${CFLAGS:-%optflags} -Wno-error -w -Wno-error=int-conversion" ; export CFLAGS ; \
@@ -259,5 +259,8 @@


 %changelog
+* Sat May 03 2025 Barrett Ray <contact@barretts.club> - jazzy.2.5.1-2
+- Fix installation path from `GZ_BUILD_FROM_SOURCE` typo
+
 * Sat Apr 27 2024 Tarik Viehmann <viehmann@kbsg.rwth-aachen.de> - jazzy.2.5.1-1
 - Update to latest release

Alright, we can now pass that initial launch process, but Gazebo is not happy with one of its provided paths:

(autonomous) barrett@farts ~/D/p/R/auto_ros2 (feat/object_avoidance)> ros2 launch simulator sim.launch.py -d
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'
[INFO] [launch]: All log files can be found below /home/barrett/.ros/log/2025-05-03-17-56-44-913934-farts-441464
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7ff1e6059550>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7ff1e6059550>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x7ff1e6058d70>'
python3: /builddir/build/BUILD/ros-jazzy-rcl-interfaces-2.0.2/.obj-x86_64-redhat-linux-gnu/rosidl_generator_py/rcl_interfaces/msg/_parameter_event_s.c:53: rcl_interfaces__msg__parameter_event__convert_from_py: Assertion `PyUnicode_IS_READY(name_attr)' failed.
fish: Job 1, 'ros2 launch simulator sim.launc…' terminated by signal SIGABRT (Abort)

Trying to launch Gazebo in particular…

(autonomous) barrett@farts ~/D/p/R/auto_ros2 (feat/object_avoidance)> gz sim
[Err] [Gui.cc:100] Failed to copy installed config [/builddir/build/BUILD/ros2-jazzy-gz_sim_vendor-0.0.8-build/BUILDROOT/usr/lib64/ros2-jazzy/opt/gz_sim_vendor/share/gz/gz-sim8/gui/gui.config] to default config [/home/barrett/.gz/sim/8/gui.config].
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string: construction from null is not valid
Stack trace (most recent call last):
#31   Object "/lib64/libc.so.6", at 0x7f0ae5e8230a, in __libc_start_main
#30   Object "/lib64/libc.so.6", at 0x7f0ae5e82247, in
#29   Object "gz sim gui", at 0x55e751afd194, in
#28   Object "/lib64/libruby.so.3.3", at 0x7f0ae62939f2, in ruby_run_node
#27   Object "/lib64/libruby.so.3.3", at 0x7f0ae6292fb9, in
#26   Object "/lib64/libruby.so.3.3", at 0x7f0ae6439f67, in
#25   Object "/lib64/libruby.so.3.3", at 0x7f0ae64238cb, in
#24   Object "/lib64/libruby.so.3.3", at 0x7f0ae64185f5, in
#23   Object "/lib64/libruby.so.3.3", at 0x7f0ae635cb39, in
#22   Object "/lib64/libruby.so.3.3", at 0x7f0ae628c9f6, in rb_protect
#21   Object "/lib64/libruby.so.3.3", at 0x7f0ae6427091, in rb_yield
#20   Object "/lib64/libruby.so.3.3", at 0x7f0ae6439d3c, in
#19   Object "/lib64/libruby.so.3.3", at 0x7f0ae64238cb, in
#18   Object "/lib64/libruby.so.3.3", at 0x7f0ae64185f5, in
#17   Object "/usr/lib64/ruby/fiddle.so", at 0x7f0acab17173, in
#16   Object "/lib64/libruby.so.3.3", at 0x7f0ae63e8a10, in rb_nogvl
#15   Object "/usr/lib64/ruby/fiddle.so", at 0x7f0acab135ab, in
#14   Object "/lib64/libffi.so.8", at 0x7f0acaa2664d, in ffi_call
#13   Object "/lib64/libffi.so.8", at 0x7f0acaa2374c, in
#12   Object "/lib64/libffi.so.8", at 0x7f0acaa28055, in
#11   Object "/usr/lib64/ros2-jazzy/opt/gz_sim_vendor/lib64/libgz-sim8-gz.so.8.9.0", at 0x7f0aca97a010, in runGui
#10   Object "/usr/lib64/ros2-jazzy/opt/gz_sim_vendor/lib64/libgz-sim8-gui.so.8", at 0x7f0ac9a38f3a, in gz::sim::v8::gui::runGui(int&, char**, char const*, char const*, int, char const*, char const*)
#9    Object "/usr/lib64/ros2-jazzy/opt/gz_sim_vendor/lib64/libgz-sim8-gui.so.8", at 0x7f0ac9a362a1, in gz::sim::v8::gui::createGui(int&, char**, char const*, char const*, bool, char const*, int, char const*, char const*)
#8    Object "/usr/lib64/ros2-jazzy/opt/gz_sim_vendor/lib64/libgz-sim8-gui.so.8", at 0x7f0ac9a059f1, in
#7    Object "/lib64/libstdc++.so.6", at 0x7f0aca60c631, in std::__throw_logic_error(char const*)
#6    Object "/lib64/libstdc++.so.6", at 0x7f0aca61beb7, in __cxa_throw
#5    Object "/lib64/libstdc++.so.6", at 0x7f0aca609950, in std::terminate()
#4    Object "/lib64/libstdc++.so.6", at 0x7f0aca61bc2b, in
#3    Object "/lib64/libstdc++.so.6", at 0x7f0aca609da8, in
#2    Object "/lib64/libc.so.6", at 0x7f0ae5e80941, in abort
#1    Object "/lib64/libc.so.6", at 0x7f0ae5e98f9d, in gsignal
#0    Object "/lib64/libc.so.6", at 0x7f0ae5ef1f54, in
Aborted (Signal sent by tkill() 464053 1000)

My guess is that /builddir/build/BUILD/ros2-jazzy-gz_sim_vendor-0.0.8-build/BUILDROOT/ is intended to be outside a variable, but was accidentally exported.

If you’ve got any leads, I’m happy to take a look myself!

in Pythonland…

It also appears that different versions of Python are causing problems internally:

barrett@farts ~> ls /usr/lib64/ros2-jazzy/lib | grep python3
python3.11
python3.13

There’s an error in one of my packages during runtime, and another error at comptime with another Python version. I’m not sure why, but providing it with 3.10 in .python-version fixes those problems with our custom interfaces:

(autonomous) barrett@farts ~/D/p/R/auto_ros2 (feat/object_avoidance)> just build
Building the ROS 2 workspace...
colcon build --symlink-install
Starting >>> aruco_node
# ...
Finished <<< custom_interfaces [38.9s]

Summary: 10 packages finished [39.5s]
Build complete!
(autonomous) barrett@farts ~/D/p/R/auto_ros2 (feat/object_avoidance)> cat .python-version
3.10

It fails with another setting, or when using the system Python:

(autonomous) barrett@farts ~/D/p/R/auto_ros2 (feat/object_avoidance)> just build
Building the ROS 2 workspace...
colcon build --symlink-install
Starting >>> aruco_node
# ...
Finished <<< simulator [10.9s]
--- stderr: custom_interfaces
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Python3_LIBRARIES
  Development NumPy Development.Module Development.Embed) (found version
  "3.11.12")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindPython/Support.cmake:4001 (find_package_handle_standard_args)
  /usr/share/cmake/Modules/FindPython3.cmake:602 (include)
  /usr/lib64/ros2-jazzy/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:22 (find_package)
  /usr/lib64/ros2-jazzy/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /usr/lib64/ros2-jazzy/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:280 (ament_execute_extensions)
  CMakeLists.txt:28 (rosidl_generate_interfaces)

However, like I said, one of my packages fails to run after this build completes…

(autonomous) barrett@farts ~/D/p/R/auto_ros2 (feat/object_avoidance) [1]> ros2 run simulator simulator
Traceback (most recent call last):
  File "/home/barrett/Documents/projects/Rover/auto_ros2/install/simulator/lib/simulator/simulator", line 5, in <module>
    from simulator.main import main
  File "/home/barrett/Documents/projects/Rover/auto_ros2/install/simulator/lib/python3.10/site-packages/simulator/main.py", line 5, in <module>
    import rclpy
  File "/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/__init__.py", line 49, in <module>
    from rclpy.signals import install_signal_handlers
  File "/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/signals.py", line 15, in <module>
    from rclpy.exceptions import InvalidHandle
  File "/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/exceptions.py", line 16, in <module>
    from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy
  File "/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rclpy/impl/implementation_singleton.py", line 32, in <module>
    rclpy_implementation = import_c_library('._rclpy_pybind11', package)
  File "/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/rpyutils/import_c_library.py", line 39, in import_c_library
    return importlib.import_module(name, package=package)
  File "/usr/lib64/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'rclpy._rclpy_pybind11'
The C extension '/usr/lib64/ros2-jazzy/lib/python3.13/site-packages/_rclpy_pybind11.cpython-310-x86_64-linux-gnu.so' isn't present on the system. Please refer to 'https://docs.ros.org/en/jazzy/How-To-Guides/Installation-Troubleshooting.html#import-failing-without-library-present-on-the-system' for possible solutions
[ros2run]: Process exited with failure 1

If you know how to solve these problems, can you please help me out? My apologies for throwing all these logs on here, but I hope they help others at some point..!

alright, will also package up ros_gz, should be no problem.

The non-free ffmpeg stuff is caused by the usb-cam package that pulls in the dep from official repos which clash with rpmfusion.

Typo regarding GZ_BUILD_FROM_SOURCE

Good catch, will fix it, but it is not causing your problems regarding depthimage_to_laserscan. The spec files are generated by rosfed, hence I will adjust it directly there.

depthimage_to_laserscan

Indeed, your reported location of it in /opt/ros/jazzy is not coming from my packages.
I double checked this using:

 dnf repoquery -l ros-jazzy-depthimage-to-laserscan
 dnf repoquery -l ros2-jazzy-depthimage_to_laserscan
 dnf repoquery -l ros2-jazzy-depthimage_to_laserscan-devel

and also by spinning up a container and installing everything (dnf install ros-jazzy-*) and checking it. So I am not sure how you ended up with that.

python3.11 in /usr/lib64/ros2-jazzy

This as well is not (directly) caused through the packages. Neither on my f42 nor in a f41 container I could reproduce this issue. If you have been using my copr on older fedora versions and always just upgraded there might be some older artefacts still there, hence I would recommend purging everything and installing the packages again:

dnf rm ros-jazzy*
dnf rm ros2-jazzy*
rm -rfd /usr/lib64/ros2-jazzy
# install whatever you need

Gazebo Buildroot Artefacts

I kinda expected that. I remember I had some unresolved issues and digged through that again.

The root cause is in the vendored gz_cmake package and its gz_add_get_install_prefix_impl cmake macro that generates a c++ binary. It generates something like this (taken from source-built gz_sim_vendor):

// This file is automatically generated by the gz_add_get_install_prefix_impl CMake macro.
#include <string>

#include <gz/sim/InstallationDirectories.hh>

#ifdef _MSC_VER
  #pragma warning(push)
  // Disable warnings related to the use of std::getenv
  // See https://stackoverflow.com/questions/66090389/c17-what-new-with-error-c4996-getenv-this-function-or-variable-may-be-un
  #pragma warning(disable: 4996)
#endif

std::string gz::sim::getInstallPrefix()
{
  if(const char* override_env_var = std::getenv("GZ_SIM_INSTALL_PREFIX"))
  {
    return std::string(override_env_var);
  }

  return "/home/user/ros2/gz_vendors_ws/install/gz_sim_vendor/opt/gz_sim_vendor";
}

#ifdef _MSC_VER
  #pragma warning(pop)
#endif

Basically it helps gazebo to find all the needed components, controllable via environment variables (in this example GZ_SIM_INSTALL_PREFIX) with a fallback to the CMAKE_INSTALL_PREFIX (this is what produces the absolute path to my workspace).

Problem is that during build process my install dir is relative to the buildroot ( /builddir/build/BUILD/) when building the rpm, while the finished package then strips this prefix again. But since it is compiled in the binary, we end up with this mess.

I guess I could patch specifically that generator file and hardcode the desired path in (I did not do that back when I first realized this issue because it feels like a rather brute-force way of handling this, and back than I was less experienced with patching stuff through ament_vendor as needed here).

Long story short: Basically every possible gazebo related variable has a non-sensical default value because of this (include GZ_SIM_INSTALL_PREFIX GZ_RENDERING_INSTALL_PREFIX and many more …).

By setting these manually you can get the packages to work, e.g. using something like:

export GZ_SIM_INSTALL_PREFIX="/usr/lib64/ros-jazzy/opt/gz_sim_vendor"

But I think i will actually just patch this cmake macro and be done with that mess soon … .