librealsense2 API
File-System Structure
Under librealsense2
folder you will find two subfolers:
h - Contains headers for the C language
hpp - Contains headers for the C++ language, depends on C headers
In addition, you can include <librealsense2/rs.h> and <librealsense2/rs.hpp> to get most of SDK functionality in C and C++ respectively.
<librealsense2/rs_advanced_mode.h> and <librealsense2/rs_advanced_mode.hpp> can be included to get the extra Advanced Mode functionality (in C and C++ respectively).
<librealsense2/rsutil.h> contains mathematical helper functions for projection of 2D points into 3D space and back.
Files and Classes
For full up-to-date class documentation see Doxygen class-list
<a href=”librealsense2/hpp/rs_types.hpp”>rs_types.hpp</a>:
This file contains common functionality like the exception types. See ..doc/error_handling.md “Error Handling”
Class |
Description |
---|---|
Common base-class for all exceptions thrown from the SDK |
|
Base class for all recorverable (in software) errors |
|
Base class for non-recoverable errors |
|
Camera Disconnected error |
|
Error from the underlying OS-specific driver |
|
Device requires firmware update |
|
Invalid input was passed to a function |
|
Methods were called in wrong order |
|
Functionality is not available error |
<a href=”librealsense2/hpp/rs_context.hpp”>rs_context.hpp</a>:
Context can be used to enumerate and iterate over connected device, and also get notifications of device events.
Class |
Description |
---|---|
Context serve as a factory for all SDK devices |
|
Helper class that simplifies handling device change events |
|
Information about device change |
<a href=”librealsense2/hpp/rs_device.hpp”>rs_device.hpp</a>:
This file defines the concept of RealSense device.
Class |
Description |
---|---|
Encapsulates Intel RealSense device |
|
Wrapper around list of devices |
|
Debug-extension that allows to send data directly to the firmware |
<a href=”librealsense2/hpp/rs_processing.hpp”>rs_processing.hpp</a>:
The SDK offers many types of post-processing in form of the Processing Blocks. These primitives can be pipelined using queues and configured using options.
Class |
Description |
---|---|
Processing block that accepts frames one-by-one and outputs coherent framesets |
|
Basic primitive abstracting a concurrent queue of frames |
|
Base class for frame processing functions |
|
Processing block that accepts depth and texture frames and outputs 3D points with texture coordinates |
|
Non-blocking version of the syncher processing block |
|
Processing block that accepts frames from different viewports and generates new synthetic frames from a single given viewport |
|
Processing block that accepts depth frames in Z16 format and outputs depth frames in RGB format, applying some depth coloring |
|
Processing block that intelligently reduces the resolution of a depth frame |
|
Processing block that filters depth data by looking into previous frames |
|
Processing block that applies edge-preserving smoothing of depth data |
<a href=”librealsense2/hpp/rs_sensor.hpp”>rs_sensor.hpp</a>:
RealSense devices contain sensors. Sensors are units of streaming, each sensor can be controlled individually.
Class |
Description |
---|---|
Base class for all supported sensors |
|
Sensor that has the ability to focus on a given ROI |
|
Asynchronious message that can be passed to the application |
|
Sensor that can provide depth frames |
<a href=”librealsense2/hpp/rs_frame.hpp”>rs_frame.hpp</a>:
The output of sensors are frames. There are different kinds of frames, not all video frames.
Class |
Description |
---|---|
Base class for all frames |
|
Set of 3D points with texture coordinates |
|
2D image (with width, height and bpp) |
|
Depth frame |
|
A set of frames |
|
Base class for sensor configuration |
|
Video stream configuration |
<a href=”librealsense2/hpp/rs_pipeline.hpp”>rs_pipeline.hpp</a>:
Pipeline is a high-level primitive combining several sensors and processing steps into one simple API.
Class |
Description |
---|---|
High level data-processor combining several sensors, queues and processing blocks |
|
Selected pipeline configuration |
|
Desired pipeline configuration |
<a href=”librealsense2/hpp/rs_record_playback.hpp”>rs_record_playback.hpp</a>:
This file adds playback and record capability using ROS-bag files. See src/media
Class |
Description |
---|---|
Device that mimics live device from given input file |
|
Device that records live device into an output file |
<a href=”librealsense2\hpp\rs_internal.hpp”>rs_internal.hpp</a>:
This file is not intented to be included by SDK users, but rather is used in SDK unit-tests. It allows to record everything that will happen in a specific test into a file and later use that file for dependency injection.