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.
Packages
Supported Platforms
Supported |
Jetson |
GPU x86_64 |
---|---|---|
|
x |
✓ |
|
x |
✓ |
Note
Isaac ROS NITROS Bridge does not yet support Jetson platforms.
Quickstart
Note
The ROS Noetic environment requires more storage space than the usual Isaac ROS Dev Docker-based development environment. We recommend at least 60 GB, to account for the size of the ROS Noetic container and datasets.
On Jetson platforms, NVMe SSD storage is required for sufficient and fast storage. See here
Set up your development environment by following the instructions here.
Clone the
isaac_ros_nitros_bridge
repository and its dependencies under Isaac ROS workspace:mkdir -p $ISAAC_ROS_WS/src && cd $ISAAC_ROS_WS/src && \ git clone https://github.com/ros2/ros1_bridge && \ git clone -b release-3.1 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common.git isaac_ros_common && \ git clone -b release-3.1 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros.git isaac_ros_nitros && \ git clone -b release-3.1 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros_bridge.git isaac_ros_nitros_bridge
Create a ROS 1 workspace for experimenting with Isaac ROS:
mkdir -p ${HOME}/workspaces/isaac_ros_1-dev/src echo "export ISAAC_ROS_1_WS=${HOME}/workspaces/isaac_ros_1-dev/" >> ~/.bashrc source ~/.bashrc
Note
Note that we are going to use the ISAAC_ROS_1_WS environmental variable in the future to refer to this ROS 1 workspace directory.
Clone the
isaac_ros_noetic_interfaces
andisaac_ros_nitros_bridge
repositories into theisaac_ros_1-dev
directory:cd $ISAAC_ROS_1_WS/src && \ git clone -b release-3.1 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_noetic_interfaces.git isaac_ros_noetic_interfaces && \ git clone -b release-3.1 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros_bridge.git isaac_ros_nitros_bridge
Configure the container created by
isaac_ros_common/scripts/run_dev.sh
to includeros1_noetic
. Create the.isaac_ros_common-config
file in theisaac_ros_common/scripts
directory:cd ${ISAAC_ROS_WS}/src/isaac_ros_common/scripts && \ touch .isaac_ros_common-config && \ echo CONFIG_IMAGE_KEY=ros2_humble.ros1_noetic >> .isaac_ros_common-config && \ echo "CONFIG_DOCKER_SEARCH_DIRS=(../../isaac_ros_nitros_bridge/docker)" >> .isaac_ros_common-config
Remove the following two lines from workspace-entrypoint.sh in the
isaac_ros_common/docker/scripts
directory becauseros1_bridge
requires a specificsetup.bash
script sourcing order:echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc source /opt/ros/${ROS_DISTRO}/setup.bash
Launch the Docker container:
cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces
Build the custom ROS 1 packages and the ROS 2 packages. But do NOT build the
ros1_bridge
package:source /opt/ros/noetic/setup.bash && \ cd /workspaces/isaac_ros-dev/isaac_ros_1-dev && \ catkin_make_isolated --install --ignore-pkg isaac_ros_nitros_bridge_ros2 && \ source /opt/ros/humble/setup.bash && \ cd /workspaces/isaac_ros-dev/isaac_ros-dev && \ colcon build --symlink-install --packages-skip ros1_bridge
Note
You will see the following warning messages while building under ROS 2 Humble. This is expected as isaac_ros_nitros_bridge_ros1 and isaac_ros_ros1_forward are ROS Noetic packages and they are skipped from the building. Please ignore those warnings.
WARNING:colcon.colcon_cmake.task.cmake.build:Could not run installation step for package 'isaac_ros_nitros_bridge_ros1' because it has no 'install' target WARNING:colcon.colcon_cmake.task.cmake.build:Could not run installation step for package 'isaac_ros_ros1_forward' because it has no 'install' target
Attach a second terminal to the container:
cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces
Note
Do NOT close the first terminal when you attach this second terminal to the container.
In the second terminal, build
ros1_bridge
and source the workspace:source isaac_ros_1-dev/install_isolated/setup.bash && \ source isaac_ros-dev/install/setup.bash && \ cd /workspaces/isaac_ros-dev/isaac_ros-dev && \ colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure && \ source install/setup.bash
Now, we can playback a test rosbag through the bridge. The launch file will send out the images from the rosbag through the NITROS bridge from ROS 2 to ROS 1, then echo back to ROS2 for visualize.
Pull down a rosbag of sample data:
cd /workspaces/isaac_ros-dev/isaac_ros-dev/src/isaac_ros_nitros_bridge && \ git lfs pull -X "" -I "resources/quickstart.bag"
(Optional) Run tests to verify complete and correct installation:
cd /workspaces/isaac_ros-dev/isaac_ros-dev && \ colcon test --executor sequential --packages-skip ros1_bridge
Run the following launch files to spin up a demo of this package:
cd /workspaces/isaac_ros-dev/isaac_ros-dev && \ source install/setup.bash && \ ros2 launch isaac_ros_nitros_bridge_ros2 isaac_ros_nitros_bridge.launch.py rosbag_path:=/workspaces/isaac_ros-dev/isaac_ros-dev/src/isaac_ros_nitros_bridge/resources/quickstart.bag/ ros1_ws_path:=/workspaces/isaac_ros-dev/isaac_ros_1-dev/
Attach another terminal to the container, visualize the output topic
/ros2_output_image
in RViz:source isaac_ros-dev/install/setup.bash && \ rviz2
Try Another Example
For an example of a more advanced setup with talkers and listeners, see here. For an example to run DNN image segmentation 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 |
---|---|
2023-10-18 |
Initial release |