Get Started Guide

  • 2021.3
  • 10/21/2021
  • Public Content

Run an Intel® RealSense™ ROS 2 Sample Application in Docker* Container

Run the Sample Application

  1. Connect an Intel® RealSense™ camera (for example, D435i) to the host.
  2. Go to the
    cd <edge_insights_for_amr_path>/Edge_Insights_for_Autonomous_Mobile_Robots_<version>/AMR_containers
  3. Run the command below to start the Docker container:
    ./ amr-ubuntu2004-full-flavour-sdk:<TAG> eiforamr
  4. Check for latest Intel® RealSense™ firmware updates.
    1. Open the Intel® RealSense™ viewer application:
      In the Intel® RealSense™ viewer, if any firmware update is available, a window popup appears in the upper right corner.
    2. During the firmware update installation, do not disconnect the Intel® RealSense™ camera. Press
      in the window popup.
    3. After the installation is complete or if no update is available, close the Intel® RealSense™ viewer.
  5. Launch ROS nodes for the camera:
    # for D435i camera model: ros2 launch realsense2_camera align_depth:=true &
    Expected output:
  6. Display the ROS topics list:
    ros2 topic list
    The following topics are displayed:
    /camera/aligned_depth_to_color/camera_info /camera/aligned_depth_to_color/image_raw /camera/color/camera_info /camera/color/image_raw /camera/depth/camera_info /camera/depth/image_rect_raw /camera/extrinsics/depth_to_color
  7. Send command to see that RealSense topics are publishing data:
    ros2 topic echo /camera/color/image_raw
    The published data will have the following structure:
    -- header: stamp: sec: 1618393694 nanosec: 869479680 frame_id: camera_color_optical_frame height: 720 width: 1280 encoding: rgb8 is_bigendian: 0 step: 3840 data: - 159 - 174 - 156 - 163 ...
  8. Get data from the Intel® RealSense™ camera (data coming at FPS):
    ros2 topic hz /camera/color/image_raw
    Data received from the device:
    average rate: 29.709 min: 0.020s max: 0.049s std dev: 0.00422s window: 32 average rate: 29.784 min: 0.020s max: 0.051s std dev: 0.00470s window: 62 average rate: 29.772 min: 0.020s max: 0.051s std dev: 0.00436s window: 92
  9. Run the rviz2 command. The image from the Intel® RealSense™ camera will be displayed in rviz2:
    ros2 run rviz2 rviz2 --display-config rviz2
    In rviz2 press:
    1. ADD
      button - By Topic - /camera/color/image_raw/Camera and press
    2. ADD
      button - By Topic - /camera/aligned_depth_to_color/image_raw/Camera and press
    3. From top, left side at
      Fixed Frame
    4. From top, left side go to
      Camera > Topic > Reliability Policy >
      Best Effort
      (perform this step for both Cameras from the left side).
    5. The image from the Intel® RealSense™ camera will be displayed in rviz2, bottom left side.


If the following error is encountered:
$ ./ amr-ubuntu2004-full-flasvour-sdk:<TAG> eiforamr bash: ./ Permission denied
Give executable permission to the script:
$ chmod 755
For Intel® RealSense™ documentation, see

Summary and Next Steps

In this tutorial, you learned how to launch ROS nodes for camera, list the ROS topics, see that Intel® RealSense™ topics are publishing data, get data from Intel® RealSense™ camera (data coming at FPS), and how to see image from Intel® RealSense™ camera displayed in rviz2.

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at