Developer Guide

  • 2022.3
  • 10/25/2022
  • Public Content
Contents

GStreamer* Video Pipeline with an Intel® RealSense™ Camera

Run a GStreamer* video pipeline using the Intel® RealSense™ plugin in a Docker* container in order to use a Intel® RealSense™ video camera as the video source.

Run the Sample Pipeline

  1. Connect an Intel® RealSense™ video camera.
  2. Check if your installation has the amr-gstreamer Docker* image.
    docker images |grep amr-gstreamer #if you have it installed, the result is: amr-gstreamer
    If the image is not installed, continuing with these steps
    triggers a build that takes longer than an hour
    (sometimes, a lot longer depending on the system resources and internet connection).
  3. If the image is not installed, Intel recommends installing the Robot Base Kit or Robot Complete Kit with the Get Started Guide for Robots.
  4. Go to the
    AMR_containers
    folder:
    cd <edge_insights_for_amr_path>/Edge_Insights_for_Autonomous_Mobile_Robots_<version>/AMR_containers
  5. Prepare the environment setup:
    source ./01_docker_sdk_env/docker_compose/common/docker_compose.source export CONTAINER_BASE_PATH=`pwd` export ROS_DOMAIN_ID=45 sudo chmod a+rw /dev/video*
  6. Get the stream from the Intel® RealSense™ camera using gstreamer:
    CHOOSE_USER=eiforamr docker-compose -f 01_docker_sdk_env/docker_compose/05_tutorials/gstreamer_realsensesrc.tutorial.yml up
    Expected output: The stream from the Intel® RealSense™ is displayed.
  7. To close this, do one of the following:
    • Type
      Ctrl-c
      in the terminal where you did the up command.
    • Run this command in another terminal:
    CHOOSE_USER=eiforamr docker-compose -f 01_docker_sdk_env/docker_compose/05_tutorials/gstreamer_realsensesrc.tutorial.yml down
  8. For an explanation of what happened, open the yml file:
    • The first 23 lines are from the EI for AMR infrastructure.
    • Line 26 gets the stream from the Intel® RealSense™ app using GStreamer*.

Troubleshooting

  • In some cases, the stream may not appear due to permission issues on the host. You may see this error message:
    ERROR: Pipeline doesn't want to pause.
    1. To fix this, if you did not install the librealsense udev rules when you configured the host, install them now:
      git clone https://github.com/IntelRealSense/librealsense # Copy the 99-realsense-libusb.rules files to the rules.d folder cd librealsense sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/ sudo udevadm control --reload-rules sudo udevadm trigger
    2. Then open the
      gst-launch
      command.
    If the problem persists, you can try any or all of the following:
    • Verify that $DISPLAY has the correct value.
    • Perform a Intel® RealSense™ hardware reset:
      # Open realsense docker container docker-compose -f 01_docker_sdk_env/docker_compose/01_amr/amr-sdk.all.yml run realsense bash # While in realsense container, open the realsense-viewer application realsense-viewer # In realsense-viewer menu, go to "More" and then select "Hardware Reset" # Wait for reset to complete and then close the realsense-viewer application.
    • Reboot the target.
  • For general robot issues, go to: Troubleshooting for Robot Tutorials.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.