RealSense Bindings for Rust

The project provides high-level bindings (crate realsense_rust) to librealsense2 library as well as low-level FFI (crate realsense_sys) interface.

Default bindings are for librealsense version: 2.44.0

This project is hosted on both Github and Gitlab. While we're happy to receive pull / merge requests on either platform, we focus most of our work on Gitlab, so please submit an issue there if you've found something we need to improve or have a question regarding how things work.

Getting Started

Make sure the current librealsense version above is installed on your system. Visit the RealSense official repository to download and install this on the host machine.

Once that's done, add this crate to your project's Cargo.toml.

Examples and Usage

Check out the examples folder for helpful snippets of code, as well as minimal configurations that fit some of the most popular RealSense devices. For more explanation, see the crate documentation.

Features

Use these by running cargo run --features <name of feature>

Regenerating the API Bindings

Non-Linux users: The current bindings are formatted for Linux. Users on systems other than Linux must run with the buildtime-bindgen feature to reformat the bindings. See the README in realsense-sys for more.

Backwards compatibility: If you're using an older librealsense version, you may enable the buildtime-bindgen feature to re-generate the bindings. We make no claims of backwards compatibility; good luck.

Special Considerations

Realsense-sys: A low-level API

The realsense-sys crate provides C bindings generated from librealsense headers. See the realsense-sys README for more information.

Design Philosophy

There's a lot of thought that went into making this library Rust-safe. Check out the architecture doc for our thoughts on Rust safety, error handling, and more for this API.

Contributing

First, check out our contributing guidelines. After that, make sure that you read through the documentation in lib.rs as well as any of the modules you might be interested in contributing to! If you find documentation missing, this is considered a bug, so please submit a bug report!

License

Apache 2.0. See LICENSE file.