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

  1. Set up your development environment by following the instructions here.

  2. 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 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common.git && \
    git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros.git && \
    git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros_bridge.git
    
  3. 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.

  4. Clone the isaac_ros_noetic_interfaces and isaac_ros_nitros_bridge repositories into the isaac_ros_1-dev directory:

    cd $ISAAC_ROS_1_WS/src && \
    git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_noetic_interfaces.git && \
    git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros_bridge.git
    
  5. Configure the container created by isaac_ros_common/scripts/run_dev.sh to include ros1_noetic. Create the .isaac_ros_common-config file in the isaac_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
    
  6. Remove the following two lines from workspace-entrypoint.sh in the isaac_ros_common/docker/scripts directory because ros1_bridge requires a specific setup.bash script sourcing order:

    echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc
    source /opt/ros/${ROS_DISTRO}/setup.bash
    
  7. Launch the Docker container:

    cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \
    ./scripts/run_dev.sh ${HOME}/workspaces
    
  8. 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
  1. 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.

  2. 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.

  1. Run the ros1_bridge/dynamic_bridge:

    export ROS_MASTER_URI=http://localhost:11311 && \
    ros2 run ros1_bridge dynamic_bridge --bridge-all-topics
    
  2. Attach a third terminal to the Docker container:

    cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \
    ./scripts/run_dev.sh ${HOME}/workspaces
    
  3. Source ros1_noetic and run roscore:

    source /opt/ros/noetic/setup.bash && \
    roscore
    
  4. Attach a fourth terminal to the Docker container:

    cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \
    ./scripts/run_dev.sh ${HOME}/workspaces
    
  5. Clone ros2_tutorials into isaac_ros_1-dev directory to build and run rospy_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
    
  6. Attach a fifth terminal to the Docker container:

    cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \
    ./scripts/run_dev.sh ${HOME}/workspaces
    
  7. Source ros2_humble and run demo_nodes_cpp listener subscriber node:

    source /opt/ros/humble/setup.bash && \
    ros2 run demo_nodes_cpp listener
    
  8. 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.

    https://media.githubusercontent.com/media/NVIDIA-ISAAC-ROS/.github/main/resources/isaac_ros_docs/concepts/nitros_bridge/ros1-bridge-pol.gif/