Failing to start ROS topics headlessly from .usd stages that work in the GUI

,

Hi all,

I have a .usd scene with RosCamera and RosPoseTree objects in it that should publish data to several rostopics. When I run the simulation from the GUI of Isaac Sim, the topics are published correctly, but if I load the scene with the following script, the topics are not generated/published to. What is missing? I thought starting the simulation with .play would suffice, but it seems it takes more than that, and I found no information on what I left out.

import os
from omni.isaac.python_app import OmniKitHelper
import carb
import omni

# Modified sample to load a usd stage and start simulation
CONFIG = {
    "experience": f'{os.environ["EXP_PATH"]}/omni.isaac.sim.python.kit',
    "width": 1280,
    "height": 720,
    "sync_loads": True,
    "headless": True,
    "renderer": "RayTracedLighting",
}
USD_PATH = "somepath/test.usd"
if __name__ == "__main__":
    kit = OmniKitHelper(config=CONFIG)
    # Open stage
    omni.usd.get_context().open_stage(USD_PATH, None)
    # Wait two frames so that stage starts loading
    kit.app.update()
    kit.app.update()

    print("Loading stage...")
    while kit.is_loading():
        kit.update(1.0 / 60.0)
    print("Loading Complete")
    kit.play()
    while kit.app.is_running():
        # Run in realtime mode, we don't specify the step size
        kit.update()

    kit.stop()
    kit.shutdown()

Hi @bforrai

It seems to be the ROS bridge extension is not enabled
To enable it you have several options such as:

  • Enable the extension from python code

    if __name__ == "__main__":
        kit = OmniKitHelper(config=CONFIG)
    
        # enable ROS bridge extension
        ext_manager = omni.kit.app.get_app().get_extension_manager()
        ext_manager.set_extension_enabled_immediate("omni.isaac.ros_bridge", True)
    
  • Modify the experience settings by editing the file PATH_TO_ISAAC_SIM/apps/omni.isaac.sim.python.kit and adding the extension at the end

    # Isaac Sim Extensions
    ###############################
    [dependencies]
    "omni.add_on.ros_bridge" = {}
    

Thanks for the swift answer! Fixed.

By the way, your contributions to this forum are absolutely impeccable. May I ask where you gathered your experience on Isaac? Any sources you’d recommend?

1 Like

Hi @bforrai

Many thanks you for your kindly comment

Btw, I think I got my experience from:

  1. Read the docs (all the docs: https://docs.omniverse.nvidia.com/ 👀)
  2. Learning from trial and error (A few hours of trial and error can save you several minutes of reading the doc! 😅🙈)
  3. Be persistent…
1 Like