Isaac ROS NITROS Bridge
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.
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.
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
Set up your development environment by following the instructions in getting started.
Set up your
Noetic
docker follow the instructions here.Start the
Noetic
container with bakednitros-bridge-entrypoint
, which will initiate theros1_bridge
andisaac_ros_nitros_bridge_ros1
within the container:docker run -it --cap-add=SYS_PTRACE --privileged --network host --pid host --ipc host --runtime nvidia --name nitros_bridge -e FASTRTPS_DEFAULT_PROFILES_FILE=/usr/local/share/middleware_profiles/rtps_udp_profile.xml --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 hostptrace_scope
to0
.Clone
isaac_ros_common
under${ISAAC_ROS_WS}/src
.cd ${ISAAC_ROS_WS}/src && \ git clone -b release-3.2 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common.git isaac_ros_common
Download Quickstart Assets
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=2 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
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
Install the prebuilt Debian package:
sudo apt-get update
sudo apt-get install -y ros-humble-isaac-ros-nitros-bridge-ros2
Clone this repository under
${ISAAC_ROS_WS}/src
:cd ${ISAAC_ROS_WS}/src && \ git clone -b release-3.2 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros.git isaac_ros_nitros
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
Use
rosdep
to install the package’s dependencies:sudo apt-get update
rosdep update && rosdep install --from-paths ${ISAAC_ROS_WS}/src/isaac_ros_nitros/isaac_ros_nitros_bridge/isaac_ros_nitros_bridge_ros2 --ignore-src -y
Build the package from source:
cd ${ISAAC_ROS_WS}/ && \ colcon build --symlink-install --packages-up-to isaac_ros_nitros_bridge_ros2 --base-paths ${ISAAC_ROS_WS}/src/isaac_ros_nitros/isaac_ros_nitros_bridge/isaac_ros_nitros_bridge_ros2
Source the ROS workspace:
Note
Make sure to repeat this step in every terminal created inside the Docker container.
Because this package was built from source, the enclosing workspace must be sourced for ROS to be able to find the package’s contents.
source install/setup.bash
Run Launch File
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
Attach a second terminal to the docker container:
cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh -d ${HOME}/workspaces
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 |