ROS 2 Launch#

Note

ROS 2 Launch with Isaac Sim is only supported in Linux and Windows with Pixi-based installation. The isaacsim_bringup package is not supported in WSL2.

Learning Objectives#

In this tutorial, we are demonstrating running NVIDIA Isaac Sim from a ROS 2 launch file.

Prerequisite

  • ROS 2 Launch for Isaac Sim is only supported on Linux and Windows with Pixi-based installation.

  • Completed ROS 2 Navigation for ROS 2 Nav2 with a single robot. So that

    • ROS 2 and Nav2 are installed.

    • ROS 2 bridge is enabled.

  • This tutorial requires the carter_navigation, isaac_ros_navigation_goal, and isaacsim_bringup ROS 2 packages that are provided as part of your NVIDIA Isaac Sim download. These ROS 2 packages are located inside the appropriate ros2_ws. They contain the required launch files, navigation parameters, and robot model. Complete ROS 2 Installation, specifically the Setup ROS 2 Workspaces steps, to make sure the ROS 2 workspace is built and sourced correctly.

Launching Isaac Sim with ROS 2#

The isaacsim_bringup package contains scripts and a ROS 2 launch file to launch Isaac Sim.

The launch file called run_isaacsim.launch.xml is included in the launch folder of the isaacsim_bringup package.

The launch parameters are defined below:

  • version: Specify the version of Isaac Sim to use. Isaac Sim will be run from default install root folder for the specified version. Leave empty to use latest version of Isaac Sim. [default_value = “6.1.0”]

  • install_path: If Isaac Sim is installed in a non-default location, provide a specific path to Isaac Sim installation root folder. (If defined, “version” parameter will be ignored). [default_value = “”]

  • use_internal_libs: Set to true if you wish to use internal ROS libraries shipped with Isaac Sim. [default_value = “true” for Humble, “false” for Jazzy]

    Note

    For Humble, use_internal_libs defaults to true because the system ROS libraries are built with Python 3.10, which is incompatible with Isaac Sim’s Python 3.12. For Jazzy, use_internal_libs defaults to false since Jazzy ships with Python 3.12-compatible libraries.

  • dds_type: Set to “fastdds”, “cyclonedds”, or “zenoh” to run Isaac Sim with a specific DDS type. Leave empty to keep the surrounding RMW_IMPLEMENTATION. [default_value = “”]

  • gui: Provide the path to a USD file to open it when starting Isaac Sim in standard gui mode. If left empty, Isaac Sim will open an empty stage in standard gui mode. [default_value = “”]

  • standalone: Provide the path to the Python file to open it and start Isaac Sim in standalone workflow. If left empty, Isaac Sim will open an empty stage in standard Gui mode. [default_value = “”]

  • python_script: Provide the path to a Python script to run inside Isaac Sim after the app starts. Use this for trusted local snippets that expect Isaac Sim to already be running. This parameter is ignored when standalone is set. [default_value = “”]

  • play_sim_on_start: If enabled, Isaac Sim will start playing the scene after it is loaded. (Only applicable when in standard gui mode). [default_value = “false”]

  • ros_distro: Provide ROS version to use. Both Jazzy and Humble are supported. [default_value = “humble”]

  • ros_installation_path: Comma-separated list of ROS installation paths. If ROS is installed in a non-default location (as in not under /opt/ros/), provide the path to your main setup.bash file for your ROS install. (/path/to/custom/ros/install/setup.bash). Similarly add the path to your local_setup.bash file for your workspace installation. (/path/to/custom_ros_workspace/install/local_setup.bash). [default_value = “”]

  • headless: Set to “webrtc” to run Isaac Sim in headless mode with WebRTC. If left empty, Isaac Sim will run in the standard gui mode. This parameter can be overridden by “standalone” parameter. [default_value = “”]

  • custom_args: Add any custom Isaac Sim args that you want to forward to isaac-sim.sh during run time. [default_value = “”]

  • exclude_install_path: Comma-separated list of installation paths to exclude from LD_LIBRARY_PATH, PYTHONPATH, and PATH environment variables. (/path/to/custom_ros_workspace/install/). [default_value = “”]

Now we will go through the main examples for running Isaac Sim from ROS 2 launch. Make sure to quit the launch process before the next example.

  1. To launch Isaac Sim in default configuration run the command below.

    ros2 launch isaacsim_bringup run_isaacsim.launch.xml
    
  2. To launch Isaac Sim with custom ROS packages in your workspace, run the command below.

    ros2 launch isaacsim_bringup run_isaacsim.launch.xml exclude_install_path:=/home/user/IsaacSim-ros_workspaces/humble_ws/install ros_installation_path:=/home/user/IsaacSim-ros_workspaces/build_ws/humble/humble_ws/install/local_setup.bash
    

    Important

    Due to Isaac Sim only supporting Python 3.12, we need to ensure that exclude_install_path parameter is set to the install folder of your workspace (for example: /home/user/IsaacSim-ros_workspaces/humble_ws/install) as that contains the incompatible Python 3.10 modules (for Ubuntu 22.04 only). Next, add the ros_installation_path parameter with path to the local_setup.bash file in your Python 3.12 build of your workspace.

    ros2 launch isaacsim_bringup run_isaacsim.launch.xml exclude_install_path:=/home/user/IsaacSim-ros_workspaces/jazzy_ws/install ros_installation_path:=/home/user/IsaacSim-ros_workspaces/build_ws/jazzy/jazzy_ws/install/local_setup.bash
    

    Important

    (Only in Ubuntu 22.04). Due to Isaac Sim only supporting Python 3.12, we need to ensure that exclude_install_path parameter is set to the install folder of your workspace (for example: /home/user/IsaacSim-ros_workspaces/jazzy_ws/install) as that contains the incompatible Python 3.10 modules. Next, add the ros_installation_path parameter with path to the local_setup.bash file in your Python 3.12 build of your workspace.

  3. Next we will launch Isaac Sim with a USD file open and immediately start playing. Run the command below.

    ros2 launch isaacsim_bringup run_isaacsim.launch.xml gui:=https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/6.1/Isaac/Samples/ROS2/Robots/Nova_Carter_ROS.usd play_sim_on_start:=true
    
  4. Now let’s launch Isaac Sim with standalone workflow. Run the command below.

    ros2 launch isaacsim_bringup run_isaacsim.launch.xml standalone:=$HOME/isaacsim/standalone_examples/api/isaacsim.ros2.bridge/moveit.py
    

Running Python Snippets from ROS 2 Launch#

Use python_script for trusted local Python snippets that run inside a standard Isaac Sim GUI session after the app starts. The snippet is injected into that running session, so it should not create its own SimulationApp or manage the app lifecycle. Use the standalone workflow shown above for full Isaac Sim scripts that create SimulationApp and directly control the simulation loop, stepping, and shutdown. Set isaac_sim_package_path to the Isaac Sim installation root before running these examples, and replace the PATH_TO_* values with your USD files or local Python scripts of your choosing.

export isaac_sim_package_path=$HOME/isaacsim
# Empty stage plus startup snippet.
ros2 launch isaacsim_bringup run_isaacsim.launch.xml \
  install_path:="$isaac_sim_package_path" \
  python_script:="$PATH_TO_SNIPPET"

# Open a USD stage first, then run the snippet.
ros2 launch isaacsim_bringup run_isaacsim.launch.xml \
  install_path:="$isaac_sim_package_path" \
  gui:="$PATH_TO_WORLD_USD" \
  python_script:="$PATH_TO_SNIPPET"

For a quick test, use the sample script installed by isaacsim_bringup. The sample adds a cube, lights, and a camera to the open stage.

ros2 launch isaacsim_bringup run_isaacsim.launch.xml \
  install_path:="$isaac_sim_package_path" \
  python_script:="$(ros2 pkg prefix --share isaacsim_bringup)/scripts/add_cube_and_lights.py"

Launch Isaac Sim with Nav2#

The Isaac Sim launch file can be included in other launch files to incorporate launching Isaac Sim from other ROS 2 workflows.

Here we will demonstrate launching Isaac Sim with the Nav2 example and the isaac_ros_navigation_goal ROS 2 package.

The example launch file can be found in the carter_navigation package in carter_navigation/launch/carter_navigation_isaacsim.launch.xml.

In this scenario, the launch file starts Isaac Sim, Nav2, RViz2, and the navigation goal node together. The navigation goal node waits for the Nav2 action server and an initialpose subscriber before publishing the initial pose and sending goals.

  1. Run the integrated launch file using the command below.

    ros2 launch carter_navigation carter_navigation_isaacsim.launch.xml
    

    Wait a moment for the scene to load. After the warehouse navigation scene is automatically loaded in Isaac Sim, RViz2 will automatically begin displaying the robot’s sensor data and automatic goals will be generated for the robot to navigate towards.

    If Nav2 does not become ready within the configured timeout, the navigation goal node logs an error and exits instead of sending goals prematurely.

You can run the same workflow using the iw_hub robot navigation scene and the iw_hub_navigation package. Run the integrated launch file using the following command:

ros2 launch iw_hub_navigation iw_hub_navigation_isaacsim.launch.xml

Summary#

In this tutorial, we covered

  1. Launching Isaac Sim from a ROS 2 launch file.

  2. Running an integrated launch file with Isaac Sim Nav2 stack, and isaac_ros_navigation_goal package.

Next Steps#

Continue on to the next tutorial in our ROS 2 Tutorials series, ROS 2 Simulation Control, to control simulation state through ROS 2 services and actions.