Cause and solution for failure to start ros2 after installing ISAAC SIM
- M K
- Oct 2, 2024
- 2 min read
Execution environment: Ubuntu 22.04.5 LTS, ROS2 humble
After installing ros2 and ISAAC SIM, if you try to start ros2 alone, it may fail to start because spdlog.so cannot be imported.
mizuki@mizuki-FRONTIER:~/PX4-Autopilot$ ros2Traceback (most recent call last): File "/opt/ros/humble/bin/ros2", line 33, in <module> sys.exit(load_entry_point('ros2cli==0.18.11', 'console_scripts', 'ros2')()) File "/opt/ros/humble/bin/ros2", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load module = import_module(match.group('module')) File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/opt/ros/humble/lib/python3.10/site-packages/ros2cli/cli.py", line 22, in <module> from rclpy.executors import ExternalShutdownException File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/__init__.py", line 49, in <module> from rclpy.signals import install_signal_handlers File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/signals.py", line 15, in <module> from rclpy.exceptions import InvalidHandle File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/exceptions.py", line 15, in <module> from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/impl/implementation_singleton.py", line 32, in <module> rclpy_implementation = import_c_library('._rclpy_pybind11', package) File "/opt/ros/humble/lib/python3.10/site-packages/rpyutils/import_c_library.py", line 39, in import_c_library return importlib.import_module(name, package=package) File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level)ImportError: /opt/ros/humble/lib/librcl_logging_spdlog.so: undefined symbol: _ZN6spdlog7details7log_msgC1ENS_10source_locEN3fmt2v817basic_string_viewIcEENS_5level10level_enumES6_The C extension '/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/_rclpy_pybind11.cpython-310-x86_64-linux-gnu.so' failed to be imported while being present on the system. Please refer to 'https://docs.ros.org/en/{distro}/Guides/Installation-Troubleshooting.html#import-failing-even-with-library-present-on-the-system' for possible solutionsThis error can occur when librcl_logging_spdlog.so is corrupted, so normally it would seem that simply reinstalling ros2 would solve the problem, but if ISAAC SIM is installed, the ROS2 bundled with ISAAC SIM (humble in this case) may be loaded first. If ISAAC SIM is corrupted, comment out the following line from ~.bashrc (the following line should exist if you followed the ISAAC SIM tutorial) to prevent the humble bundled with ISAAC SIM from being loaded, and then restart the terminal.
After that, you can enter the ros2 command without any errors and it will start normally.
The following example starts the ros2 listener for px4.




Comments