Isaac ROS NITROS Bridge

https://media.githubusercontent.com/media/NVIDIA-ISAAC-ROS/.github/main/resources/isaac_ros_docs/repositories_and_packages/isaac_ros_nitros_bridge/isaac_ros_nitros_bridge_overview.png/

Overview

The Isaac ROS NITROS Bridge brings accelerated computing to versions of ROS where it is not supported, by improving the performance of bridging between ROS versions.

Isaac ROS provides accelerated computing ROS packages for robotics development in ROS 2 with NITROS; this is enabled with the addition of type adaptation (REP-2007) and type negotiation (REP-2009) in ROS 2 Humble, which is not available in previous versions of ROS.

Accelerated computing is essential to move beyond the limits of single threaded performance on a CPU. To take advantage of this, it may not be practical to migrate to a new version of ROS 2 for robotics applications that were developed previously. Some developers have chosen to bridge between their current version of ROS, and what is used with Isaac ROS. This improves existing robotics applications with the addition of accelerated computing; unfortunately, the ROS bridge includes a CPU based memory copy bridge toll.

Isaac ROS NITROS Bridge packages improves performance with a ROS bridge. The bridge toll is removed by moving data from CPU to GPU to avoid CPU memory copies. This significantly improves performance across processes in different versions of ROS. In addition the data in GPU memory can be used in place, by accelerated computing.

https://media.githubusercontent.com/media/NVIDIA-ISAAC-ROS/.github/main/resources/isaac_ros_docs/repositories_and_packages/isaac_ros_nitros_bridge/isaac_ros_nitros_bridge.png/

Illustrated above is the use of NITROS Converters between ROS Noetic and ROS 2 Humble. When sending an image from ROS Noetic to ROS 2 Humble, the NITROS converter moves the image to GPU accelerated memory avoiding CPU memory copies. On the Humble side of the bridge the NITROS converter adapts the image in GPU memory into a NITROS image for use with accelerated computing. This also works the other direction from ROS 2 Humble to ROS Noetic. When sending an NITROS image from Humble to Noetic, the NITROS Converter maintains the image in GPU accelerated memory avoiding CPU memory copies over the bridge, moving the image into CPU accessible memory in Noetic.

This same principle can be applied to ROS 2, for example between Foxy and Humble to take advantage of Isaac ROS in Humble, from applications developed in Foxy without migrating versions of ROS.

https://media.githubusercontent.com/media/NVIDIA-ISAAC-ROS/.github/main/resources/isaac_ros_docs/repositories_and_packages/isaac_ros_nitros_bridge/ros_bridge.png/

Illustrated above is the use of the ROS bridge without the benefits of NITROS converters. Images sent from Noetic to Humble and visa-versa are copies across the ROS processes using the CPU limiting performance and increasing latency.

By avoiding unnecessary CPU memory copies the Isaac ROS NITROS bridge improves accelerated computing performance and reduces end to end latency across versions of ROS.

Performance

Isaac ROS NITROS Bridge can move 1080p images between ROS 1 Noetic and Isaac ROS NITROS packages up to 3x faster than the available ros1_bridge. See Isaac ROS Benchmark scripts for NITROS bridge and ros1_bridge.

Packages

Quickstart

Note

NITROS Bridge is functional on both x86 and Jetson platforms. However, Noetic is not supported on Ubuntu 22.04. https://www.ros.org/reps/rep-0003.html.

In order to leverage NITROS Bridge on ROS Noetic applications, you may consider to wrap the ROS Noetic applications in a docker container with Ubuntu 20.04 or use other alternatives.

Here we provide an example docker file to build a docker container with ROS Noetic and NITROS Bridge on x86.

Set Up Development Environment

  1. Set up your Noetic docker follow the instructions here.

  2. Start the Noetic container with baked nitros-bridge-entrypoint, which will initiate the ros1_bridge and isaac_ros_nitros_bridge_ros1 within the container:

    docker run -it --cap-add=SYS_PTRACE --privileged --network host --pid host --runtime nvidia --name nitros_bridge --rm nitros_bridge:latest nitros_bridge_convert_forward.yaml nitros_bridge_convert_forward.launch
    

    Note

    In order to enable the CUDA IPC for NITROS Bridge, the nitros-bridge-entrypoint will change the host ptrace_scope to 0.

  3. Set up your development environment by following the instructions in getting started.

  4. Clone isaac_ros_common under ${ISAAC_ROS_WS}/src.

    cd ${ISAAC_ROS_WS}/src && \
       git clone -b release-3.1 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common.git isaac_ros_common
    

Download Quickstart Assets

  1. Download quickstart data from NGC:

    Make sure required libraries are installed.

    sudo apt-get install -y curl jq tar
    

    Then, run these commands to download the asset from NGC:

    NGC_ORG="nvidia"
    NGC_TEAM="isaac"
    PACKAGE_NAME="isaac_ros_nitros_bridge_ros2"
    NGC_RESOURCE="isaac_ros_nitros_bridge_ros2_assets"
    NGC_FILENAME="quickstart.tar.gz"
    MAJOR_VERSION=3
    MINOR_VERSION=1
    VERSION_REQ_URL="https://catalog.ngc.nvidia.com/api/resources/versions?orgName=$NGC_ORG&teamName=$NGC_TEAM&name=$NGC_RESOURCE&isPublic=true&pageNumber=0&pageSize=100&sortOrder=CREATED_DATE_DESC"
    AVAILABLE_VERSIONS=$(curl -s \
        -H "Accept: application/json" "$VERSION_REQ_URL")
    LATEST_VERSION_ID=$(echo $AVAILABLE_VERSIONS | jq -r "
        .recipeVersions[]
        | .versionId as \$v
        | \$v | select(test(\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\"))
        | split(\".\") | {major: .[0]|tonumber, minor: .[1]|tonumber, patch: .[2]|tonumber}
        | select(.major == $MAJOR_VERSION and .minor <= $MINOR_VERSION)
        | \$v
        " | sort -V | tail -n 1
    )
    if [ -z "$LATEST_VERSION_ID" ]; then
        echo "No corresponding version found for Isaac ROS $MAJOR_VERSION.$MINOR_VERSION"
        echo "Found versions:"
        echo $AVAILABLE_VERSIONS | jq -r '.recipeVersions[].versionId'
    else
        mkdir -p ${ISAAC_ROS_WS}/isaac_ros_assets && \
        FILE_REQ_URL="https://api.ngc.nvidia.com/v2/resources/$NGC_ORG/$NGC_TEAM/$NGC_RESOURCE/\
    versions/$LATEST_VERSION_ID/files/$NGC_FILENAME" && \
        curl -LO --request GET "${FILE_REQ_URL}" && \
        tar -xf ${NGC_FILENAME} -C ${ISAAC_ROS_WS}/isaac_ros_assets && \
        rm ${NGC_FILENAME}
    fi
    

Build isaac_ros_nitros_bridge_ros2

  1. Launch the Docker container using the run_dev.sh script:

    cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \
    ./scripts/run_dev.sh -a --pid=host
    
  2. Install the prebuilt Debian package:

    sudo apt-get install -y ros-humble-isaac-ros-nitros-bridge-ros2
    

Run Launch File

  1. Run the following launch files to spin up a demo of this package:

    cd /workspaces/isaac_ros-dev && \
      source install/setup.bash && \
      ros2 launch isaac_ros_nitros_bridge_ros2 isaac_ros_nitros_bridge_quickstart.launch.py rosbag_path:=${ISAAC_ROS_WS}/isaac_ros_assets/isaac_ros_nitros_bridge_ros2/quickstart.bag
    
  2. Attach a second terminal to the docker container:

    cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \
      ./scripts/run_dev.sh -d ${HOME}/workspaces
    
  3. Visualize the output topic /r2b/ros2_output_image in RViz:

    cd /workspaces/isaac_ros-dev/ && \
      source install/setup.bash && \
      rviz2
    

Try Another Example

For an example to run DNN image segmentation with NITROS Bridge, see here.

For an example to run Isaac Sim with NITROS Bridge, see here.

Troubleshooting

Could not find a package configuration file provided by ament_cmake_auto

Symptoms

If you have both ROS 1 and ROS 2 installed in the Docker environment, you may see the following error message while building ROS 2 packages:

Could not find a package configuration file provided by "ament_cmake_auto"
with any of the following names:
  ament_cmake_autoConfig.cmake
  ament_cmake_auto-config.cmake

Solution

You must source setup.bash from the ROS 2 installation before building:

source /opt/ros/humble/setup.bash

Updates

Date

Changes

2024-09-26

Update for Isaac ROS 3.1

2024-05-30

Update to be compatible with JetPack 6.0

2023-10-18

Initial release