Isaac ROS RealSense Setup#

Camera Compatibility#

RealSense Model

Supported?

D455

D435i

D415

Note

  • It is required to use RealSense firmware version 5.16.0.1, librealsense SDK version v2.56.3 and realsense-ros driver version r/4.56.3. Any deviation from these versions may break or degrade the performance of Isaac ROS examples.

  • It is required to use USB3 ports and cables to run the cameras at higher resolutions and frame rates that some applications expect.

  • For best results we suggest increasing the maximum Linux kernel receive buffer size as detailed in DDS tuning.

  • The realsense-viewer tool has performance issues when running multiple cameras on the Jetson platforms. However the RealSense ROS drivers work fine with multiple cameras.

Setup Instructions#

This tutorial assumes that you have completed the instructions in Developer Environment Setup.

  1. Start with the RealSense camera unplugged. Then, add RealSense udev rules to your host machine.

    wget https://raw.githubusercontent.com/realsenseai/librealsense/v2.56.3/config/99-realsense-libusb.rules && \
    sudo mv 99-realsense-libusb.rules /etc/udev/rules.d/ && \
    sudo udevadm control --reload-rules && sudo udevadm trigger && echo "Successfully added udev rules"
    

    Verify that you have Successfully added udev rules in the output, which indicates all commands were successful.

  2. Configure the Isaac ROS environment to include librealsense SDK and realsense-ros:

    Create a file called ~/.config/isaac-ros-cli/config.yaml with the following content:

    mkdir -p ~/.config/isaac-ros-cli
    touch ~/.config/isaac-ros-cli/config.yaml
    
    docker:
      image:
        additional_image_keys:
          - realsense
    
    1. Define the following configuration variables to specify the versions used for the installation:

      LIBREALSENSE_VERSION=v2.56.3
      REALSENSE_ROS_VERSION=r/4.56.3
      
    2. Download the RealSense setup scripts from the Isaac ROS CLI repository:

      mkdir -p /tmp/realsense-setup && cd /tmp/realsense-setup
      curl -O https://raw.githubusercontent.com/NVIDIA-ISAAC-ROS/isaac-ros-cli/release-4.1/docker/scripts/install-realsense-dependencies.sh
      curl -O https://raw.githubusercontent.com/NVIDIA-ISAAC-ROS/isaac-ros-cli/release-4.1/docker/scripts/build-librealsense.sh
      
    3. Install the CUDA toolkit:

      sudo apt-get update
      sudo apt-get install -y cuda-toolkit-13-0
      
    4. Install RealSense dependencies:

      cd /tmp/realsense-setup
      chmod +x install-realsense-dependencies.sh
      sudo ./install-realsense-dependencies.sh
      
    5. Build and install librealsense from source:

      cd /tmp/realsense-setup
      chmod +x build-librealsense.sh
      ./build-librealsense.sh -v ${LIBREALSENSE_VERSION} --force_rsusb
      
    6. Clone the realsense-ros repository:

      cd /tmp
      git clone --depth 1 https://github.com/realsenseai/realsense-ros.git -b ${REALSENSE_ROS_VERSION}
      
    7. Install realsense-ros build dependencies:

      sudo apt-get update
      sudo apt-get install -y devscripts dh-make python3-bloom
      rosdep update
      rosdep install -y --from-paths /tmp/realsense-ros --skip-keys librealsense2 --ignore-src
      
    8. Build and install realsense2_camera_msgs:

      cd /tmp/realsense-ros/realsense2_camera_msgs
      bloom-generate rosdebian
      fakeroot debian/rules binary
      cd .. && sudo apt-get install -y ./*.deb && rm ./*.deb
      
    9. Build and install realsense2_description:

      cd /tmp/realsense-ros/realsense2_description
      bloom-generate rosdebian
      fakeroot debian/rules binary
      cd .. && sudo apt-get install -y ./*.deb && rm ./*.deb
      
    10. Build and install realsense2_camera:

      cd /tmp/realsense-ros/realsense2_camera
      bloom-generate rosdebian
      sed -i "s/dh_shlibdeps -/dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info -/g" debian/rules
      sed -i "s/ros-jazzy-librealsense2, //g" debian/control
      fakeroot debian/rules binary
      cd .. && sudo apt-get install -y ./*.deb
      
    11. Clean up the build environment:

      rm -rf /tmp/realsense-ros
      rm -rf /tmp/realsense-setup
      
    1. Define the following configuration variables to specify the versions used for the installation:

      LIBREALSENSE_VERSION=v2.56.3
      REALSENSE_ROS_VERSION=r/4.56.3
      
    2. Download the RealSense setup scripts from the Isaac ROS CLI repository:

      mkdir -p /tmp/realsense-setup && cd /tmp/realsense-setup
      curl -O https://raw.githubusercontent.com/NVIDIA-ISAAC-ROS/isaac-ros-cli/release-4.1/docker/scripts/install-realsense-dependencies.sh
      curl -O https://raw.githubusercontent.com/NVIDIA-ISAAC-ROS/isaac-ros-cli/release-4.1/docker/scripts/build-librealsense.sh
      
    3. Install the CUDA toolkit:

      sudo apt-get update
      sudo apt-get install -y cuda-toolkit-13-0
      
    4. Install RealSense dependencies:

      cd /tmp/realsense-setup
      chmod +x install-realsense-dependencies.sh
      sudo ./install-realsense-dependencies.sh
      
    5. Build and install librealsense from source:

      cd /tmp/realsense-setup
      chmod +x build-librealsense.sh
      ./build-librealsense.sh -v ${LIBREALSENSE_VERSION} --force_rsusb
      
    6. Clone the realsense-ros repository:

      cd /tmp
      git clone --depth 1 https://github.com/realsenseai/realsense-ros.git -b ${REALSENSE_ROS_VERSION}
      
    7. Install realsense-ros build dependencies:

      sudo apt-get update
      sudo apt-get install -y devscripts dh-make python3-bloom
      rosdep update
      rosdep install -y --from-paths /tmp/realsense-ros --skip-keys librealsense2 --ignore-src
      
    8. Build and install realsense2_camera_msgs:

      cd /tmp/realsense-ros/realsense2_camera_msgs
      bloom-generate rosdebian
      fakeroot debian/rules binary
      cd .. && sudo apt-get install -y ./*.deb && rm ./*.deb
      
    9. Build and install realsense2_description:

      cd /tmp/realsense-ros/realsense2_description
      bloom-generate rosdebian
      fakeroot debian/rules binary
      cd .. && sudo apt-get install -y ./*.deb && rm ./*.deb
      
    10. Build and install realsense2_camera:

      cd /tmp/realsense-ros/realsense2_camera
      bloom-generate rosdebian
      sed -i "s/dh_shlibdeps -/dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info -/g" debian/rules
      sed -i "s/ros-jazzy-librealsense2, //g" debian/control
      fakeroot debian/rules binary
      cd .. && sudo apt-get install -y ./*.deb
      
    11. Clean up the build environment:

      rm -rf /tmp/realsense-ros
      rm -rf /tmp/realsense-setup
      
  3. Plug in your RealSense camera to USB3 ports before activating the Isaac ROS environment in the next step.

  4. Activate the Isaac ROS environment:

    isaac-ros activate --build-local
    

    This --build-local flag rebuilds the container image using Dockerfile.realsense in one of its layered stages. Rebuilding can take several minutes.

    After the image has been built once, you can use isaac-ros activate to launch the container without rebuilding the image.

    isaac-ros activate
    
    isaac-ros activate
    
  5. Verify that the RealSense camera is connected by running:

    rs-enumerate-devices
    

    Verify that this returns information about all connected RealSense cameras.

    Note

    The realsense-viewer tool requires a graphical environment, to use it you must connect the host to a monitor, use a remote desktop connection or similar.

    realsense-viewer
    

    If you turn on the “Stereo Module” in the GUI, verify that you have something like the following:

    https://media.githubusercontent.com/media/NVIDIA-ISAAC-ROS/.github/release-4.1/resources/isaac_ros_docs/getting_started/realsense_viewer.png/

If you come across issues, see if it’s covered in Hardware Setup or librealsense SDK issues.