Crate ar_drivers

source ·
Expand description

This crate contains a simplified driver for Rokid Air (and possibly other) AR glasses. It supports getting basic sensor data and setting up the display. It only uses rusb for communication.

Example usage (in a thread, probably):

let glasses = Glasses::new().unwrap();
loop {
    match glasses.read_event().unwrap() {
        GlassesEvent::Accelerometer(data) => ...,
        GlassesEvent::Gyroscope(data) => ...,
        GlassesEvent::Magnetometer(data) => ...,
        GlassesEvent::Misc(data) => ...,
    }
}

As opposed to Rokid’s own API, this is all that you get, since this is what comes out of the hardware. To get quaternions, you should probably use a lib that implements Madgwicks algorithm or a proper EKF. One good choice is the eskf crate.

Structs

The main structure representing a connected AR glasses
Container for other sensor data
Structure to hold a typical 3D sensor value (accelerometer, gyroscope, magnetomer)

Enums

Possible errors resulting from ar-drivers API calls
AR glasses sensor event, got from Glasses::read_event