Intel realsense sdk linux

Intel realsense sdk linux

Intel® RealSense™ SDK for Linux

The Intel® RealSense™ SDK for Linux provides libraries, tools, and samples to develop applications using Intel® RealSense™ cameras, over the Intel® RealSense™ Cross Platform API (also known as librealsense).

The SDK provides functionality for record and playback of camera streams for test and validation.

The SDK includes libraries which support the camera stream projection of streams into a common world-space viewpoint, and libraries which enable the use of multiple middleware modules simultaneously for common multi-modal scenarios.

Table of Contents

Intel® RealSense™ ZR300

The library is written in standards-conforming C++11. It has been developed and tested on Ubuntu 16.04 x64 (GCC 5.4 toolchain).

Note: This API is experimental and is not an official Intel product. It is subject to incompatible API changes in future updates. Breaking API changes are noted through release numbers.

Record and Play

  • Record: The record module provides a utility to create a file, which can be used by the playback module to create a video source. The record module provides the same camera API as defined by the SDK (Intel® RealSense™ Cross Platform API) and the record API to configure recording parameters such as output file and state (pause and resume). The record module loads Intel® RealSense™ Cross Platform API to access the camera device and execute the set requests and reads, while writing the configuration and changes to the file.
  • Playback: The playback module provides a utility to create a video source from a file. The playback module provides the same camera API as defined by the SDK (Intel® RealSense™ Cross Platform API), and the playback API to configure recording parameters such as input file, playback mode, seek, and playback state (pause and resume). The playback module supports files that were recorded using the Linux SDK recorder and the Windows RSSDK recorder (up to version 2016 R2).

Frame data container The SDK provides an image container for raw image access and basic image processing services, such as format conversion, mirror, rotation, and more. It caches the processing output to optimize multiple requests of the same operation. The image container includes image metadata, which may be used by any pipeline component to attach additional data or computer vision (CV) module processing output to be used by other pipeline components. The SDK uses a correlated samples container to provide access to camera images and motion sensor samples from the relevant streams, which are time-synchronized. The correlated samples container includes all relevant raw buffers, metadata, and information required to access the attached images.

Spatial correlation and projection The Spatial Correlation and Projection library provides utilities for spatial mapping:

  • Map between color or depth image pixel coordinates and real world coordinates
  • Correlate depth and color images and align them in space

Pipeline The pipeline is a class, which abstracts the details of how the cognitive data is produced by the computer vision modules. The application can focus on consuming the computer vision output, leaving the camera configuration and streaming details for the pipeline to handle.

Читайте также:  Overwolf touch controller windows 10

Samples

  • Projection: The sample demonstrates how to use the different spatial correlation and projection functions, from live camera and recorded file.
  • Record and Playback: The sample demonstrates how to record and play back a file while the application is streaming, with and without an active CV module, with minimal changes to the application, compared to live streaming.
  • Video module, asynchronized: The sample demonstrates an application usage of a Computer Vision module, which implements asynchronous sample processing.
  • Video module, synchronized: The sample demonstrates an application usage of a Computer Vision module, which implements synchronous samples processing.
  • Fatal error recovery: The sample demonstrates how the application can recover from a fatal error in one of the SDK components (CV module or core module), without having to terminate.

Tools

  • Capture tool: Provides a GUI to view camera streams, create a new file from a live camera, and play a file in the supported formats. The tool provides options to render the camera or file images.
  • Projection tool: Provides simple visualization of the projection functions output, to allow human eye detection of major offsets in the projection computation.
  • System Info tool: Presents system data such as Linux name, Linux kernel version, CPU information, and more.

Utilities

  • Log: The SDK provides a logging library, which can be used by the SDK components and the application to log meaningful events.
  • Time Sync utility: Provides methods to synchronize multiple streams of images and motion samples based on the samples time-stamp or sample number.
  • SDK Data Path utility: The SDK provides a utility to locate SDK files in the system. The utility is used by Computer Vision modules, which need to locate data files in the system that are constant for all applications (not application- or algorithm-instance specific).
  • FPS counter: Measures the actual FPS in a specific period. You can use this utility to check the actual FPS in all software stack layers in your applications, to analyze FPS latency in those layers.

To successfully compile and use the SDK, you should install the following dependencies:

  • Intel RealSense Cross Platform API v1.12.1
  • OpenCV 3.1
  • CMake
  • OpenGL GLFW version 3
  • liblz4-dev
  • Apache log4cxx – optional. Needed only if you want to enable logs.
  • Doxygen — optional. Needed only if you want to generate dynamic documentation for the project.

Supported Languages and Frameworks

For detailed instructions on developing using this library, please refer to Intel® RealSense™ SDK for Linux Documentation

Copyright 2017 Intel Corporation

Licensed under the Apache License, Version 2.0 (the «License»); you may not use this project except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an «AS IS» BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Toolkit built on top of the Intel® RealSense™ Cross Platform API (librealsense)

Источник

Intel realsense sdk linux

Copy raw contents

Linux Ubuntu Installation

Note: Due to the USB 3.0 translation layer between native hardware and virtual machine, the librealsense team does not support installation in a VM. If you do choose to try it, we recommend using VMware Workstation Player, and not Oracle VirtualBox for proper emulation of the USB3 controller.

Читайте также:  Qemu как установить windows

Please ensure to work with the supported Kernel versions listed here and verify that the kernel is updated properly according to the instructions.

Ubuntu Build Dependencies

The scripts and commands below invoke wget, git, add-apt-repository which may be blocked by router settings or a firewall. Infrequently, apt-get mirrors or repositories may also timeout. For librealsense users behind an enterprise firewall, configuring the system-wide Ubuntu proxy generally resolves most timeout issues.

Important: Running RealSense Depth Cameras on Linux requires patching and inserting modified kernel drivers. Some OEM/Vendors choose to lock the kernel for modifications. Unlocking this capability may require modification of BIOS settings

Make Ubuntu Up-to-date:

  • Update Ubuntu distribution, including getting the latest stable kernel:
    • sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

Note: On stock Ubuntu 14 LTS systems and kernels prior to 4.4.0-04 the standard apt-get upgrade command is not sufficient to bring the distribution to the latest recommended baseline.
It is recommended to upgrade the distribution with:

sudo apt-get install —install-recommends linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial

Update OS Boot and reboot to enforce the correct kernel selection with
sudo update-grub && sudo reboot

Interrupt the boot process at Grub2 Boot Menu -> «Advanced Options for Ubuntu» and select the kernel version installed in the previous step. Press and hold SHIFT if the Boot menu is not presented.

Complete the boot, login and verify that a supported kernel version (4.[4,8,10,13,15,16]]) is in place with uname -r

Download/Clone librealsense github repository:

Get librealsense sources in one of the following ways:

Download the complete source tree with git
git clone https://github.com/IntelRealSense/librealsense.git

Prepare Linux Backend and the Dev. Environment:

Navigate to librealsense root directory to run the following scripts.
Unplug any connected Intel RealSense camera.

Install the core packages required to build librealsense binaries and the affected kernel modules:
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev

Ubuntu 14 or when running Ubuntu 16.04 live-disk:
./scripts/install_glfw3.sh

Ubuntu 16:
sudo apt-get install libglfw3-dev

Ubuntu 18:
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at

Cmake Note: certain librealsense CMAKE flags (e.g. CUDA) require version 3.8+ which is currently not made available via apt manager for Ubuntu LTS.
Go to the official CMake site to download and install the application

Note on graphic sub-system utilization:
glfw3, mesa and gtk packages are required if you plan to build the SDK’s OpenGL-enabled examples. The librealsense core library and a range of demos/tools are designed for headless environment deployment.

Run Intel Realsense permissions script from librealsense root directory:
./scripts/setup_udev_rules.sh

Notice: One can always remove permissions by running: ./scripts/setup_udev_rules.sh —uninstall

Build and apply patched kernel modules for:
* Ubuntu 14/16/18 with LTS kernel

./scripts/patch-realsense-ubuntu-lts.sh
* Ubuntu with Kernel 4.16

* Intel® Joule™ with Ubuntu Based on the custom kernel provided by Canonical Ltd.

The script above will download, patch and build realsense-affected kernel modules (drivers).
Then it will attempt to insert the patched module instead of the active one. If failed the original uvc modules will be restored.

Читайте также:  Как удалить образ диска mac os

Arch-based distributions

  • Install the base-devel package group.
  • Install the matching linux-headers as well (i.e.: linux-lts-headers for the linux-lts kernel).
  • Navigate to the scripts folder
    cd ./scripts/
  • Then run the following script to patch the uvc module:
    ./patch-arch.sh

Odroid XU4 with Ubuntu 16.04 4.14 image Based on the custom kernel provided by Hardkernel
./scripts/patch-realsense-ubuntu-odroid.sh

Some additional details on the Odroid installation can also be found in installation_odroid.md

Check the patched modules installation by examining the generated log as well as inspecting the latest entries in kernel log:
sudo dmesg | tail -n 50
The log should indicate that a new uvcvideo driver has been registered.
Refer to Troubleshooting in case of errors/warning reports.

  • Tracking Module requires hid_sensor_custom kernel module to operate properly. Due to TM1’s power-up sequence constraints, this driver is required to be loaded during boot for the HW to be properly initialized.

In order to accomplish this, add the driver’s name hid_sensor_custom to /etc/modules file, eg:

Building librealsense2 SDK

On Ubuntu 14.04, update your build toolchain to gcc-5:

  • sudo add-apt-repository ppa:ubuntu-toolchain-r/test
  • sudo apt-get update
  • sudo apt-get install gcc-5 g++-5
  • sudo update-alternatives —install /usr/bin/gcc gcc /usr/bin/gcc-5 60 —slave /usr/bin/g++ g++ /usr/bin/g++-5
  • sudo update-alternatives —set gcc «/usr/bin/gcc-5»

You can check the gcc version by typing: gcc -v If everything went fine you should see gcc 5.0.0.

Navigate to librealsense root directory and run mkdir build && cd build

  • cmake ../ — The default build is set to produce the core shared object and unit-tests binaries in Debug mode. Use -DCMAKE_BUILD_TYPE=Release to build with optimizations.
  • cmake ../ -DBUILD_EXAMPLES=true — Builds librealsense along with the demos and tutorials
  • cmake ../ -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=false — For systems without OpenGL or X11 build only textual examples

Recompile and install librealsense binaries:

sudo make uninstall && make clean && make && sudo make install

The shared object will be installed in /usr/local/lib , header files in /usr/local/include .
The binary demos, tutorials and test files will be copied into /usr/local/bin
Tip: Use make -jX for parallel compilation, where X stands for the number of CPU cores available:
sudo make uninstall && make clean && make **-j8** && sudo make install
This enhancement may significantly improve the build time. The side-effect, however, is that it may cause a low-end platform to hang randomly.
Note: Linux build configuration is presently configured to use the V4L2 backend by default.
Note: If you encounter the following error during compilation gcc: internal compiler error it might indicate that you do not have enough memory or swap space on your machine. Try closing memory consuming applications, and if you are running inside a VM, increase available RAM to at least 2 GB.
Note: You can find more information about the available configuration options on this wiki page.

  1. Install IDE (Optional): We use QtCreator as an IDE for Linux development on Ubuntu. Follow the link for QtCreator5 installation

Troubleshooting Installation and Patch-related Issues

Источник

Оцените статью