ROS 2 Launch

Note

ROS 2 Launch with Isaac Sim is fully supported on Linux. On Windows, running the isaacsim package could potentially produce errors.

Learning Objectives

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

Important

Make sure to source your ROS 2 installation from the terminal before running Isaac Sim. If sourcing ROS 2 is a part of your bashrc then Isaac Sim can be run directly.

Prerequisite

  • ROS 2 Launch for Isaac Sim is only supported on Linux.

  • Completed ROS2 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 carter_navigation, isaac_ros_navigation_goal and isaacsim ROS 2 packages which are provided as part of your Omniverse Isaac Sim download. These ROS 2 packages are located inside the appropriate ros2_ws (foxy_ws or humble_ws). They contain the required launch files, navigation parameters, and robot model. Complete ROS and ROS 2 Installation, make sure the ROS 2 workspace environment is setup correctly.

Launching Isaac Sim with ROS 2

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

The launch file called run_isaacsim.launch.py is included in the launch folder of the isaacsim 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 = “4.1.0”]

  • install_path: If Isaac Sim is installed in a non-default location, provide a specific path to Isaac Sim installation root folder which is the package path displayed in Isaac Sim App Selector. (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 = “false”]

  • dds_type: Set to “fastdds” or “cyclonedds” (Cyclone only supported for ROS 2 Humble) to run Isaac Sim with a specific dds type. [default_value = “fastdds”]

  • 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 = “”]

  • play_sim_on_start: If enabled and 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. Only Humble and Foxy is supported. [default_value = “humble”]

  • ros_installation_path: 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). [default_value = “”]

  • headless: Set to “native” or “webrtc” to run Isaac Sim with different headless modes. If left empty, Isaac Sim will run in the standard gui mode. This parameter can be overridden by “standalone” parameter. [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 run_isaacsim.launch.py
    
  2. Next we will launch Isaac Sim with a usd file open and immediately start playing. Run the command below.

    ros2 launch isaacsim run_isaacsim.launch.py gui:=omniverse://localhost/NVIDIA/Assets/Isaac/4.1/Isaac/Samples/ROS2/Robots/Nova_Carter_ROS.usd play_sim_on_start:=true
    
  3. Now lets launch Isaac Sim with standalone workflow. Run the command below.

    ros2 launch isaacsim run_isaacsim.launch.py standalone:=$HOME/.local/share/ov/pkg/isaac-sim-4.1.0/standalone_examples/api/omni.isaac.ros2_bridge/moveit.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.py.

In this scenario, the launch file is configured to wait for a console output from Isaac Sim: “Stage loaded and simulation is playing.”. This message is printed from the open_isaacsim_stage.py script which is used to load any scene in GUI mode. This is found in the scripts folder of isaacsim package.

Note

If running Isaac Sim in standalone workflow, you would need to add your own print statement that launch files can listen for and act accordingly.

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

    ros2 launch carter_navigation carter_navigation_isaacsim.launch.py
    

    Wait a moment for the scene to load. Once 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.

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 ROS2 Tutorials series, ROS 2 Publish Real Time Factor (RTF).