ROS1 Bridge Setup
Overview
This tutorial walks you through how to setup the ros1_bridge
within the Isaac ROS Docker container for communication between ROS 1 and ROS 2 using topics and services.
The tutorial is based on the ROS1 Bridge documentation.
Note
ROS actions are not supported by the ROS1 Bridge
Steps
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 setup a dynamic bridge and use the demo talkers/listeners.
Run the
ros1_bridge/dynamic_bridge
:export ROS_MASTER_URI=http://localhost:11311 && \ ros2 run ros1_bridge dynamic_bridge --bridge-all-topics
Attach a third terminal to the Docker container:
cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces
Source
ros1_noetic
and runroscore
:source /opt/ros/noetic/setup.bash && \ roscore
Attach a fourth terminal to the Docker container:
cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces
Clone
ros2_tutorials
intoisaac_ros_1-dev
directory to build and runrospy_tutorials talker
publisher node:source /opt/ros/noetic/setup.bash && \ cd /workspaces/isaac_ros-dev/isaac_ros_1-dev/src && \ git clone https://github.com/ros/ros_tutorials.git && \ cd .. && \ catkin_make_isolated --install --only-pkg-with-deps rospy_tutorials && \ source install_isolated/setup.bash && \ rosrun rospy_tutorials talker
Attach a fifth terminal to the Docker container:
cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces
Source
ros2_humble
and rundemo_nodes_cpp listener
subscriber node:source /opt/ros/humble/setup.bash && \ ros2 run demo_nodes_cpp listener
You should see messages being published from ROS 1 in terminal 4 and see the same messages being received by ROS 2 in terminal 5.