6. ROS & ROS 2 Installation

Omniverse Isaac Sim provides both a ROS and ROS 2 bridge for ROS system integration. The same set of common components are used to define the types of data being published/received by the simulator.

For the ROS bridge, Isaac Sim runs a custom roscpp build of ROS Noetic internally so that it works properly with the Omniverse framework and Python 3. This is backwards compatible with ROS Melodic.

For the ROS 2 bridge, Isaac Sim is currently compatible with ROS 2 Foxy. Using Ubuntu 20.04 is recommended for ROS 2.

Important

For ROS, in the steps below replace noetic with melodic if you are installing on Ubuntu 18.04

6.1. Running Native ROS

  1. Download ROS following the instructions on the official website:

  2. Source the ROS environment in the terminal. You must perform this step each time before using any ROS commands.

    ROS

    source /opt/ros/noetic/setup.bash
    

    ROS 2

    source /opt/ros/foxy/setup.bash
    

    You can also automatically source the environment by adding it to your ~/.bashrc file. Change <ros-distro> to noetic, melodic, or foxy, as appropriate

    echo "source /opt/ros/<ros-distro>/setup.bash" >> ~/.bashrc
    source ~/.bashrc
    
  3. For ROS only: Start roscore in a ROS-sourced terminal. Isaac Sim does not run roscore by default to be more flexible for use cases where Isaac Sim is being integrated with existing ROS workflows.

6.2. Enabling the ROS / ROS 2 Bridge Extension

To enable the ROS/ROS2 bridge extension, go to the extension manager menu Window->Extensions and search for ROS bridge. Only one of the ROS Bridge extensions can be enabled at any given time.

../_images/isaac_ros_install_enable.gif

ROS2 Bridge prep

If you intend to use a ROS2 bridge, before launching Isaac Sim, you need to set the Fast DDS middleware with the following steps:

  1. Create a file named fastdds.xml under ~/.ros/, paste the following snippet link into the file.

    <?xml version="1.0" encoding="UTF-8" ?>
    
    <license>Copyright (c) 2022, NVIDIA CORPORATION.  All rights reserved.
    NVIDIA CORPORATION and its licensors retain all intellectual property
    and proprietary rights in and to this software, related documentation
    and any modifications thereto.  Any use, reproduction, disclosure or
    distribution of this software and related documentation without an express
    license agreement from NVIDIA CORPORATION is strictly prohibited.</license>
    
    
    <profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles" >
        <transport_descriptors>
            <transport_descriptor>
                <transport_id>UdpTransport</transport_id>
                <type>UDPv4</type>
            </transport_descriptor>
        </transport_descriptors>
    
        <participant profile_name="udp_transport_profile" is_default_profile="true">
            <rtps>
                <userTransports>
                    <transport_id>UdpTransport</transport_id>
                </userTransports>
                <useBuiltinTransports>false</useBuiltinTransports>
            </rtps>
        </participant>
    </profiles>
    
  2. Run unset LD_LIBRARY_PATH in the terminal.

  3. Run export FASTRTPS_DEFAULT_PROFILES_FILE=~/.ros/fastdds.xml

  4. (Optional) Run export ROS_DOMAIN_ID=(id_number) before launching Isaac Sim. You will have a chance later to decide whether to use this ROS_DOMAIN_ID inside your environment, or explictly use a different id number for any given topic.

  5. Launch Isaac Sim.

Warning

Do not source ROS2 in the terminal running Isaac Sim, standalone python scripts or Isaac Cortex as that can cause errors during startup because of conflicting symbols.

Note

You can only enable one type of ROS2 bridge in a single Isaac Sim session. So if you want to enable ROS2 Humble bridge (Experimental) after disabling ROS2 Foxy bridge (or vice versa), you will need to shutdown Isaac Sim and start a new session in order to enable the second bridge.

Note

For convenience fastdds.xml is also located at the root of the ros2_workspace folder

6.3. Setting Up Workspaces

6.3.1. ROS 1

A few ROS packages are needed to go through the Isaac Sim ROS / ROS 2 tutorial series. To make it easy, an entire ROS workspace with the necessary packages is included. Follow the steps below to build it and source the overlay of this package.

  1. Ensure your native ROS has been sourced if it has not been already:

    source /opt/ros/noetic/setup.bash
    

    You can check if the sourcing is successful by checking the ROS_PACKAGE_PATH environment variable.

    echo $ROS_PACKAGE_PATH
    /opt/ros/noetic/share
    
  2. Resolve any package dependencies from the root of the ROS workspace by running the following command:

    cd ros_workspace
    rosdep install -i --from-path src --rosdistro noetic -y
    
  3. In the ROS-sourced terminal, build the Isaac ros_workspace folder, then source the overlay.

    catkin_make
    source devel/setup.bash
    

    This will put the Isaac Sim ROS workspace in your ROS_PACKAGE_PATH. You can use echo $ROS_PACKAGE_PATH again to see that the path to the Isaac Sim ROS workspace has been added in front of the original one.

  4. Alternatively, you can move the individual ROS packages from the ros_workspace/src folder into your own ROS workspaces and build it.

Go to the ROS website for tutorials on building your own ROS packages.

If you want to give Isaac Sim access to your existing packages, make sure to set the ROS_PACKAGE_PATH environment variable to include the desired ROS workspace in the same terminal before starting up Omniverse Isaac Sim.

6.3.1.1. Included ROS 1 Packages

The following is a list of sample ROS packages created for Omniverse Isaac Sim:

  • carter_2dnav: Contains the required launch file and ROS navigation parameters for the NVIDIA Carter robot.

  • carter_description: A description of the NVIDIA Carter robot model.

  • cortex_control: Tools for establishing communication between Cortex and controllers.

  • cortex_control_franka: Contains launch files and python nodes used to control a physical Franka robot with Cortex.

  • isaac_moveit: Contains the required launch and config files for running ROS MoveIt.

  • isaac_ros_messages: A custom set of messages for 2D/3D bounding boxes and pose service messages.

  • isaac_ros_navigation_goal: Used to automatically set random or user-defined goal poses in ROS Navigation.

  • isaac_tutorials: Contains launch files, RViz config files, and scripts for the tutorial series.

  • isaac_vins: Contains launch, parameters, and config files required to run VINS Fusion with Unitree A1 Quadruped robot.

6.3.2. ROS 2

  1. To build the ros2 workspace, you may need to install additional packages:

    # For rosdep install command
    sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
    # For colcon build command
    sudo apt install python3-colcon-common-extensions
    
  2. Ensure your native ROS2 has been sourced if not already.

    source /opt/ros/foxy/setup.bash
    
  3. Resolve any package dependencies from the root of the ROS2 workspace by running the following command:

    cd ros2_workspace
    rosdep install -i --from-path src --rosdistro foxy -y
    
  4. Build the workspace:

    colcon build
    

    Under the root directory, new build, install, and log directories will be created.

  5. To start using the ROS2 packages built within this workspace, open a new terminal and source the workspace with the following commands:

    source /opt/ros/foxy/setup.bash
    cd ros2_workspace
    source install/local_setup.bash
    

6.3.2.1. Included ROS 2 Packages

A list of sample ROS2 packages created for Omniverse Isaac Sim:

  • carter_description: Description of the NVIDIA Carter robot model.

  • carter_navigation: Contains the required launch file and ROS2 navigation parameters for the NVIDIA Carter robot.

  • isaac_moveit: Contains the required launch and config files for running MoveIt 2.

  • isaac_ros2_messages: A custom set of ROS2 messages for 2d/3d bounding boxes and pose service messages.

  • isaac_ros_navigation_goal: Used to automatically set random or user-defined goal poses in ROS2 Navigation.

  • isaac_tutorials: Contains launch files, RViz2 config files, and scripts for the tutorial series.

Important

Remember to source your ROS2 workspace each time a new terminal is opened or whenever a new ROS2 package is included. But do not source it in the terminal you are launching Isaac Sim.

6.4. ROS 2 Windows Beta

There is experimental ROS2 Foxy support on windows

Follow the ros2 windows install instructions for installing ROS2 Foxy on Windows. Please note that Windows support is currently a Beta version and has been tested to work with the ROS2 installation from this source only.

Once the installation is complete, unlike Linux, we need to source ROS2 before running Isaac Sim.

Similar to the instructions for Opening a developer command prompt:

You will need to do the following to activate a ROS2 command prompt for windows.

  1. From the start menu, look for x64 Native Tools Command Prompt for VS 2019.

  2. Run the shortcut as administrator.

  3. Once the developer command prompt is open, run c:\opt\ros\foxy\x64\setup.bat

  4. Run set FASTRTPS_DEFAULT_PROFILES_FILE=C:\<path_to_isaac_sim_package>\ros2_workspace\fastdds.xml

  5. cd <path_to_isaac_sim_package>

  6. Run isaac-sim.bat

Note

We recommend setting FASTRTPS_DEFAULT_PROFILES_FILE in your environment variables so you don’t need to set it in the individual command prompt windows

6.4.1. Setting up your workspace

When building the ROS2 workspace you may encounter path length errors, we recommend enabling long path support. Note that you may need to re-open your command prompt after enabling for this setting to take effect. Alternatively copy the ros2_workspace folder to C:\ros2_workspace to reduce the overall path lengths when building the environment

  1. Resolve any package dependencies from the root of the ROS2 workspace by running the following command:

    cd ros2_workspace
    rosdep install -i --from-path src --rosdistro foxy -y
    

Note

At the time of writing this guide you will see the following error that can be ignored

ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies:
isaac_moveit: No definition of [gripper_controllers] for OS [windows]
  1. Build the workspace:

    colcon build
    
  2. Activate the workspace:

    install\setup.bat
    
  3. Set the FASTRTPS profile if it has not already been set before running any ros commands

    set FASTRTPS_DEFAULT_PROFILES_FILE=C:\<path_to_isaac_sim_package>\ros2_workspace\fastdds.xml
    

Note

  • In some cases commands like rviz2 might not work, run them via ros2 run. For example you may need to use ros2 run rviz2 rviz2 to run rviz.

  • If images and other messages are not showing up in rviz2 set the reliability and durability policy to System Default for the topic

Important

While most of our ROS2 tutorials and samples should work on windows, windows support is still in Beta and you might encounter issues. Tutorials and samples using RTX Lidar with ROS2 will not work on windows currently.

6.5. ROS 2 Humble Beta

There is an experimental ROS2 Humble bridge that can be enabled in the extension manager. Note that only one ROS2 bridge can be enabled at a time. If the Foxy ROS2 bridge is enabled, you must restart Omniverse Isaac Sim in order to use the Humble ROS2 Bridge. The two bridges cannot be toggled one after the other.

All messages/publishers/subscribers supported in ROS2 Foxy, are supported on ROS2 Humble

On Ubuntu 20.04 you will need to install humble from source

Because the Isaac ROS Gems are only supported on humble, The Interfacing with Nvidia Isaac ROS Visual SLAM GEM tutorial requires the use of the Humble bridge.

6.6. ROS Tutorials

To start using Omniverse Isaac Sim with ROS, complete the ROS Tutorial series starting with Import and Drive TurtleBot3.

6.7. ROS2 Tutorials

To start using Omniverse Isaac Sim with ROS2, complete the ROS2 Tutorial series starting with ROS2 Import and Drive TurtleBot3.