This is a comprehensive guide on installing the SDK, setting up the development environment, running the sample programs and developing the application.
For windows, you need to register the metadata associated with frames (this includes things like timestamps and other information about the video frame).
For Linux, we have provided a script to help you set up the environment. You can run the script as follows:
cd scripts/env_setup
./setup.sh
Purpose:
It’s not necessary. If you don’t, there will be no sample executable, and you’ll need to run install libusb rules file manually
setup.sh
Script Requirements:
Expected Outcome:
When the script executes successfully, it will generate the sample executable in the project’s bin directory. This file is the result of compiling the sample program and can be used to demonstrate the functionality.
Connect the device to the computer and run the sample program at your unzip directory.
cd bin
./ob_color # ./ob_color for linux
More information about the examples of Orbbec SDK, please refer to examples.
First, create a new folder for your project root directory and set up the basic CMake files and source code files within it.
Example Project Folder Structure:
MyOrbbecApp/
├── CMakeLists.txt
├── src/
│ └── main.cpp
└── include/
└── (optional custom header files)
Create a lib directory in the project and unpack the Orbbec SDK library files into this lib directory.
Example Project Folder Structure:
MyOrbbecApp/
├── CMakeLists.txt
├── src/
│ └── main.cpp
├── include/
│ └── (optional custom header files)
└── lib/
└── orbbecsdk
└── (Orbbec SDK library files)
Add the following lines to the CMakeLists.txt file:
add_executable(MyOrbbecApp src/main.cpp)
set(OrbbecSDK_DIR lib/orbbecsdk/lib)
find_package(OrbbecSDK REQUIRED)
target_link_libraries(MyOrbbecApp ob::OrbbecSDK)
Now you can develop your application using the Orbbec SDK. You can refer to the sample programs in the Orbbec SDK to get started.
As a cmake project, you can compile the project as the cmake way, depends on your build system and habit. Here is an example of using the command line to compile the project:
mkdir build
cd build
cmake ..
cmake --build . --config Release
cd ..
After compiling, it is important to copy the Orbbec SDK library and its extentions files to the target directory.
cp -r lib/orbbecsdk/lib/extensions build/bin/
cp -r lib/orbbecsdk/lib/libOrbbecSDK.so build/bin/
After all these steps, you can run the application by executing the binary file in the build/bin directory.