Crate ar_drivers

source ·
Expand description

This crate contains a simplified driver for Rokid Air and Mad Gaze Glow AR glasses. It supports getting basic sensor data and setting up the display.

Example usage (in a thread, probably):

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

As opposed to e.g. 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.

Modules

Mad Gaze Glow AR glasses support. See MadGazeGlow It only uses serialport for communication.
Rokid Air AR glasses support. See RokidAir It only uses rusb for communication.

Structs

Container for other sensor data
Structure to hold a typical 3D sensor value (accelerometer, gyroscope, magnetomer)

Enums

Display mode used by [Glasses::set_display_mode]
Possible errors resulting from ar-drivers API calls
AR glasses sensor event, got from [Glasses::read_event]

Traits

Common interface for AR implemented glasses

Functions

Convenience function to detect and connect to any of the supported glasses