Cannot enable the ROS2 Humble bridge extension in standalone application

Please advise me on how to enable the ROS2 Humble bridge extension in standalone application. My test code cannot enable the bridge for the following error message:

[39.868s] [ext: omni.isaac.ros2_bridge-humble-1.10.1] startup
2023-03-10 07:54:55 [40,042ms] [Error] [omni.isaac.ros2_bridge.scripts.extension] omni.isaac.ros2_bridge-humble-1.10.1 bridge extension cannot be enabled if omni.isaac.ros2_bridge is enabled

Please find my test code below:

# Create a simulation application instance at first
from omni.isaac.kit import SimulationApp
CONFIG = {
    'renderer': 'RayTracedLighting',
    'headless': False,
    'width': 1280,
    'height': 720
}
simulation_app = SimulationApp(CONFIG) 


import traceback
import os
import carb
import time
from omni.isaac.core import World
from omni.isaac.core.utils.extensions import enable_extension, disable_extension
from omni.isaac.core import SimulationContext
import omni.graph.core as og


ENV_URL = '/Isaac/Environments/Grid/default_environment.usd'
CLOCK_GRAPH_PATH = '/ClockGraph'


def create_clock_graph() -> None:
    """Creates an action graph to generate ROS2 clocks"""

    clock_topic = 'clock'
    system_clock_topic = 'system_time'

    try:
        og.Controller.edit(
            {'graph_path': CLOCK_GRAPH_PATH, 'evaluator_name': 'execution'},
            {
                og.Controller.Keys.CREATE_NODES: [
                    ('ReadSimTime', 'omni.isaac.core_nodes.IsaacReadSimulationTime'),
                    ('ReadSystemTime', 'omni.isaac.core_nodes.IsaacReadSystemTime'),
                    ('OnPlaybackTick', 'omni.graph.action.OnPlaybackTick'),
                    ('PublishClock', 'omni.isaac.ros2_bridge.ROS2PublishClock'),
                    ('PublishSystemClock', 'omni.isaac.ros2_bridge.ROS2PublishClock'),
                ],
                og.Controller.Keys.CONNECT: [
                    ('OnPlaybackTick.outputs:tick', 'PublishClock.inputs:execIn'),
                    ('OnPlaybackTick.outputs:tick', 'PublishSystemClock.inputs:execIn'),
                    ('ReadSimTime.outputs:simulationTime', 'PublishClock.inputs:timeStamp'),
                    ('ReadSystemTime.outputs:systemTime', 'PublishSystemClock.inputs:timeStamp'),
                ],
                og.Controller.Keys.SET_VALUES: [
                    ('PublishClock.inputs:topicName', clock_topic),
                    ('PublishSystemClock.inputs:topicName', system_clock_topic),
                ],
            },
        )
    except Exception as e:
        print(e)

    simulation_app.update()


def main():
    
    # Disable ROS1 bridge extension
    print('Disabling ROS1 bridge extension')
    ret = disable_extension('omni.isaac.ros1_bridge')
    print('Return from disable_extension: {}'.format(ret))
    simulation_app.update()

    # Disable ROS2 bridge extension
    print('Disabling ROS2 bridge extension')
    ret = disable_extension('omni.isaac.ros2_bridge')
    print('Return from disable_extension: {}'.format(ret))
    simulation_app.update()

    # Enable ROS2 Humble bridge extension
    print('Enabling ROS2 Humble bridge extension')
    ret = enable_extension('omni.isaac.ros2_bridge-humble')
    print('Return from enable_extension: {}'.format(ret))
    simulation_app.update()

    world = World(stage_units_in_meters=1.0)
    world.scene.add_default_ground_plane()

    create_clock_graph()

    time.sleep(1.0)
    simulation_context = SimulationContext(physics_dt=1.0 / 60.0, rendering_dt=1.0 / 60.0, stage_units_in_meters=1.0)
    simulation_context.initialize_physics()
    simulation_context.play()

    world.reset()
    
    while(True):
        world.step(render=True)


if __name__ == '__main__':
    try:
        main()
    except KeyboardInterrupt:
        print('Existing...')
    except Exception as e:
        carb.log_error(f'Exception: {e}')
        traceback.print_exc()
    finally:
        simulation_app.close()
        print('Simulation application closed.')

humble_bridge_test.py (3.4 KB)

Thanks.

1 Like

Hi,

I am getting the exact same issue? Is there any fix to this?

Hi!

I’m having the same problem. Any idea how to fix it?

I’m using Isaac Sim 2022.2.0 on Ubuntu 22.04. Thanks!

Hi @dgarcialopez and others,

Please install the latest Isaac Sim 2022.2.1 which was release the last week on Friday and let us know if you are still having any issues.

1 Like

Thanks @rthaker for the quick reply.

I just tested it on 2002.2.1 and it loads ros2_bridge-humble correctly.

The example provided by @tfuru2 runs as expected!

@rthaker @dgarcialopez
Thank you.
The problem have been resolved by Isaac Sim 2022.2.1 on my side too.

1 Like

@rthaker

I also tried with provided python script but did not make it with the following message. I am currently working on Ubuntu 22.04 and Isaac Sim 2022.2.1 version.

[245.087s] Simulation App Startup Complete
Disabling ROS1 bridge extension
Return from disable_extension: True
Disabling ROS2 bridge extension
Return from disable_extension: True
Enabling ROS2 Humble bridge extension
[245.111s] [ext: omni.isaac.ros2_bridge-humble-1.12.2] startup
2023-03-23 07:42:07 [245,281ms] [Warning] [carb] [Plugin: libomni.isaac.ros2_humble_bridge.plugin.so] Could not locate the function: carbGetFrameworkVersion
2023-03-23 07:42:07 [245,281ms] [Warning] [carb] Potential plugin preload failed: /home/sim/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.ros2_bridge-humble/bin/libomni.isaac.ros2_humble_bridge.plugin.so
2023-03-23 07:42:07 [245,284ms] [Warning] [carb] [Plugin: libomni.structuredlog.plugin.so] Module /home/sim/.local/share/ov/pkg/isaac_sim-2022.2.1/kit/libomni.structuredlog.plugin.so remained loaded after unload request
2023-03-23 07:42:07 [245,284ms] [Error] [omni.isaac.ros2_bridge.scripts.extension] Failed to acquire interface: omni::isaac::ros2_bridge::Ros2BridgeHumble (pluginName: nullptr)
2023-03-23 07:42:07 [245,284ms] [Error] [omni.isaac.ros2_bridge.scripts.extension] Cannot load ROS2 humble bridge after loading ROS2 bridge, please restart Isaac Sim and only enable/use one of the ROS2 bridges
Return from enable_extension: True
[245.402s] [ext: omni.isaac.ros2_bridge-humble-1.12.2] shutdown
Could not create node using unrecognized type 'omni.isaac.ros2_bridge.ROS2PublishClock'. Perhaps the extension 'omni.isaac.ros2_bridge' is not loaded?

@kyungho.yoo - Have you tried to restart the app and tried loading it again?

Thanks for your response, but it did not work. The log shows the ROS2 bridge extension is successfully disabled before enabling the ROS2 humble bridge extension as follows:

Disabling ROS1 bridge extension
Return from disable_extension: True
Disabling ROS2 bridge extension
Return from disable_extension: True

However, the error shows ROS2 bridge extension is already loaded before loading ROS2 humble bridge extension.

2023-03-23 07:42:07 [245,284ms] [Error] [omni.isaac.ros2_bridge.scripts.extension] Failed to acquire interface: omni::isaac::ros2_bridge::Ros2BridgeHumble (pluginName: nullptr)
2023-03-23 07:42:07 [245,284ms] [Error] [omni.isaac.ros2_bridge.scripts.extension] Cannot load ROS2 humble bridge after loading ROS2 bridge, please restart Isaac Sim and only enable/use one of the ROS2 bridges

I used the same script(humble_bridge_test.py), which is @tfuru2 provided.

@kyungho.yoo
For your reference, I attached a log from humble_bridge_test.py which runs successfully on Isaac Sim 2022.2.1.

Isaac Sim is installed by Omniverse Launcher (not docker container) at my side.
I’m placing humble_bridge_test.py at ~/.local/share/ov/pkg/isaac_sim-2022.2.1/user_apps.
Then I open ~/.local/share/ov/pkg/isaac_sim-2022.2.1 with VS Code, and run humble_bridge_test.py with launch.json which is bundled with Isaac Sim so that the right environment is set to run.

humble_bridge_test_log.txt (18.8 KB)

@tfuru2,
Thanks for your detailed instruction. I have the same configuration as you (Installed Isaac sim via Omniverse Launcher and used VSCode). However, always get the same error as above even I reinstalled Isaac sim and tried from scratch. Really weird.

@kyungho.yoo check that you’re not sourcing ROS2 in the same terminal that you run Isaac Sim (Remove “source /opt/ros/humble/local.bash” from your “~/.bashrc” file). If you’re launching the script from VS Code, remember to reload the app or close and open it, after you modify the bash file.

When I was trying to launch Isaac sim with ROS sourced I got the same error you’re reporting. This is explained in the documentation here as a warning note. I guess this is necessary because they use a different rclpy compiled version to match their Python 3.7 environment.

2 Likes

Thank you, @dgarcialopez! It works!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.