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.
Example
The example directory contains a more complete example. Run it with cargo run --release --example kinect_live
.
use freenect;
// Init with video functionality
let ctx = init_with_video.unwrap;
// Open first device
let device = ctx.open_device.unwrap;
// Setup mode for this device
device.set_depth_mode.unwrap;
device.set_video_mode.unwrap;
// Get rgb and depth stream
let 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 frames
if let Ok = dstream.receiver.try_recv
if let Ok = vstream.receiver.try_recv
ctx.stop_process_thread.unwrap;