Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

15 Commits

Repository files navigation

Freenect-rs

freenect-rs is a rust wrapper to interact with libfreenect. It can be used to fetch rgb and depth data from Kinect and to control its motor.

Documentation

See https://docs.rs/freenectrs

Example

The example directory contains a more complete example. Run it with cargo run --release --example kinect_live.

use freenectrs::freenect;// Init with video functionalitylet ctx = freenect::FreenectContext::init_with_video().unwrap();// Open first devicelet device = ctx.open_device(0).unwrap();// Setup mode for this device
device.set_depth_mode(freenect::FreenectResolution::Medium, freenect::FreenectDepthFormat::MM).unwrap();
device.set_video_mode(freenect::FreenectResolution::Medium, freenect::FreenectVideoFormat::Rgb).unwrap();// Get rgb and depth streamlet dstream = device.depth_stream().unwrap();let vstream = device.video_stream().unwrap();// Start the main-loop-thread
ctx.spawn_process_thread().unwrap();// Fetch the video and depth framesifletOk((data, timestamp)) = dstream.receiver.try_recv(){// ... handle depth data}ifletOk((data, timestamp)) = vstream.receiver.try_recv(){// ... handle rgb data}
ctx.stop_process_thread().unwrap();

About

Freenect wrapper for rust

Topics

Resources

Stars

19 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages