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?