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::AccGyro {accelerometer, gyroscope} => ...,
GlassesEvent::Magnetometer(data) => ...,
GlassesEvent::KeyPress(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.
§Feature flags
Support for individual AR glasses types ca be enabled with the following features:
mad_gaze: Mad Gaze Glownreal: Nreal Lightrokid: Rokid Air
All of them are enabled by default, which may bring in some unwanted dependencies if you only want to support a specific type.
Modules§
- grawoow
- Grawoow G530 (a.k.a. MetaVision M53) glasses support. See
GrawoowG530It only usesrusbfor communication. - mad_
gaze - Mad Gaze Glow AR glasses support. See
MadGazeGlowIt only usesserialportfor communication. - nreal_
air - Nreal Air AR glasses support. See
NrealAirIt only useshidapifor communication. - nreal_
light - Nreal Light AR glasses support. See
NrealLightIt only useshidapifor communication. - rokid
- Rokid Air AR glasses support. See
RokidAirIt only usesrusbfor communication.
Structs§
- Camera
Descriptor - Represents one built-in camera
Enums§
- Display
Mode - Display mode used by
ARGlasses::set_display_mode - Error
- Possible errors resulting from
ar-driversAPI calls - Glasses
Event - AR glasses sensor event, got from
ARGlasses::read_event - Side
- Display side used by [
ARGlasses::view_matrix]
Traits§
- ARGlasses
- Common interface for AR implemented glasses
Functions§
- any_
glasses - Convenience function to detect and connect to any of the supported glasses