OrbbecSDK

introduction

This document introduces the installation of OrbbecSDK dependencies and the compilation instructions of OrbbecSDK Sample.

install dependency

The Orbbec SDK is compatible with the standard UVC protocol, and the standard UVC used by Gemini2、Femto 、Femto W、Femto Mega、Astra+、Astra2、Gemini2 L 、Gemini 330 Series device, so no additional drivers are required.

windows

1. install driver

Dabai, Dabai DCW, Dabai DW, Astra mini Pro, Astra Pro Plus, A1 Pro, Gemini E, Gemini E Lite, Gemini These use the private protocol of openni and need to install private drivers. The directory of the openni driver is as follows: double-click the following .exe image directory to install the driver.

image0

2. Configure OpenCV (Examples dependency)

Data rendering relies on the third-party library OpenCV. Here we take OpenCV 4.3.0 as an example to demonstrate the installation configuration.

2

3

4

3. metadata(timestamp) registration

Now due to the Windows system mechanism, for UVC protocol devices, if you need to obtain metadata information such as timestamps, you need to first register in the registry. Using obsensor_metadata_win10.md document guide to complete the registry registration.

5

4. Generate your first application

Software dependency: VisualStudio2019, cmake 3.10 and above.

6

7

8

Method 1: With cmake, click the “Open Project” button to open the Visual Studio project.

9

Method 2: In the folder, directly start the Visual Studio project in Examples/build, as shown in the figure below.

10

11

14

Linux

1. System environment configuration

2. USB access rights configuration

By default, direct access to USB devices in Linux systems requires root privileges, which can be resolved through the rules configuration file. After the files released by OrbbecSDK are decompressed, there will be a “99-obsensor-libusb.rules” configuration file and “install_udev_rules.sh” installation script in the Script directory.

20 Run the “install_udev_rules.sh” script through the sudo command to complete the rules Installation of configuration files.

sudo chmod +x ./install_udev_rules.sh
sudo ./install_udev_rules.sh

3. Increasing the USBFS buffer size (Optional)

By default, the USBFS buffer size is 16 MB. This value is insufficient for high-resolution images or multiple streams and multiple devices usage. User can increase the buffer size to 128 MB.

Check the USBFS buffer size:

cat /sys/module/usbcore/parameters/usbfs_memory_mb

Increase the USBFS buffer size until the next reboot (here: example value 128)

sudo sh -c 'echo 128 > /sys/module/usbcore/parameters/usbfs_memory_mb'

Increase the USBFS buffer size permanently

To increase the buffer size permanently, add the kernel parameter usbcore.usbfs_memory_mb=128 to the bootloader configuration. How to do this depends on the bootloader on your system.

For GRUB2 (most common):

  1. Open /etc/default/grub. Replace: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" (or other contents within the quotation marks depending on your system) with: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.usbfs_memory_mb=128"
  2. Update grub

     sudo update-grub
    
  3. reboot your system

Other bootloaders: configure additional kernel parameters of other bootloaders, please see the manual of your bootloader.

4. Verify device status

21

VID: 2bc5 PID: 0536 (color camera)
VID: 2bc5 PID: 0636 (depth camera)

5. Linux Sample compile

Create a build directory in the OrbbecSDK directory, as follows: image17

cd OrbbecSDK
mkdir build
cd build
cmake ..
make

MacOS

Install Xcode and Homebrew

  1. Install Xcode:

    • Xcode is the official development tool provided by Apple, which includes the C++ compiler.
    • You can download it for free from the Mac App Store.
    • Installing Xcode will also install the Command Line Tools, which include the GCC compiler and other development tools.
  2. Install Homebrew:

    • Homebrew is a package manager for macOS, useful for installing various development tools and libraries.
    • To install Homebrew, execute the following command in the terminal:
      /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
      
    • With Homebrew, you can easily install other development tools, like Git.

These steps will set up the fundamental tools needed for C++ development on macOS.

Install Dependency

brew install cmake opencv

Compile and run the sample

cd OrbbecSDK
mkdir build
cd build
cmake .. && make -j8
make install
cd install/bin
sudo ./OBHelloOrbbec