Standalone ROS2_bridge fails to load

Hi, I’m trying to create a standalone application using ros2.

When I try to import omni.isaac.ros2_bridge I get the following errors

2022-01-11 15:00:20 [10,163ms] [Error] [omni.ext.plugin] Could not load the dynamic library from /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/bin/librclcpp.so. Error: /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/bin/librclcpp.so: undefined symbol: _ZNK23libstatistics_collector9collector9Collector15GetStatusStringEv
2022-01-11 15:00:20 [10,165ms] [Error] [omni.ext.plugin] Could not load the dynamic library from /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/bin/librcl_logging_spdlog.so. Error: /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/bin/librcl_logging_spdlog.so: undefined symbol: _ZN6spdlog5sinks9base_sinkISt5mutexE11set_patternERKSs
2022-01-11 15:00:20 [10,207ms] [Error] [carb] [Plugin: libomni.isaac.ros2_bridge.plugin.so] Could not load the dynamic library from /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/bin/libomni.isaac.ros2_bridge.plugin.so. Error: /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/bin/libomni.isaac.ros2_bridge.plugin.so: undefined symbol: _ZNK23libstatistics_collector9collector9Collector15GetStatusStringEv
2022-01-11 15:19:58 [10,313ms] [Warning] [carb] Potential plugin preload failed: /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/bin/libomni.isaac.ros2_bridge.plugin.so
2022-01-11 15:19:58 [10,313ms] [Error] [omni.ext.plugin] [ext: omni.isaac.ros2_bridge-0.1.1] failed to load native plugin: /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/bin/libomni.isaac.ros2_bridge.plugin.so
2022-01-11 15:19:58 [10,315ms] [Error] [carb.scripting-python.plugin] RuntimeError: Failed to acquire interface: omni::isaac::ros2_bridge::Ros2Bridge (pluginName: nullptr)

At:
  /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/omni/isaac/ros2_bridge/scripts/extension.py(35): on_startup
  /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/kit/plugins/bindings-python/omni/ext/impl/_internal.py(141): _startup_ext
  /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/kit/plugins/bindings-python/omni/ext/impl/_internal.py(174): startup_all_extensions_in_module
  /home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/kit/plugins/bindings-python/omni/ext/impl/_internal.py(225): startup_all_extensions_in_module
  PythonExtension.cpp::startup()(2): <module>
  /home/ubb/Documents/docker_sim_comp/Isaac/ubb/Isaacdev/src/sim_spawner/sim_spawner/demo_error.py(7): <module>

2022-01-11 15:19:58 [10,315ms] [Error] [omni.ext.plugin] [ext: omni.isaac.ros2_bridge-0.1.1] Failed to process python module extension in '/home/ubb/.local/share/ov/pkg/isaac_sim-2021.2.1/exts/omni.isaac.ros2_bridge/.'.

I am running my file using the python.sh file present in isaac source folder. I tried running it a terminal without ros sourced and one with it and both time I got the error

A minimal python file to reproduce the error :

from omni.isaac.kit import SimulationApp
simulation_app = SimulationApp({"headless": False})
import omni
ext_manager = omni.kit.app.get_app().get_extension_manager()
simulation_app.update()

ext_manager.set_extension_enabled_immediate("omni.isaac.ros2_bridge", True)

simulation_app.close() # close Isaac Sim

Can you make sure that ROS2 is not sourced in the terminal where you are running this script?
That currently leads to issues with incorrect libraries getting linked at runtime

Yes I made sure of that by checking what was the content of $LD_LIBRARY_PATH (since sourcing ros fill it) and it was empty