viture_kit 0.1.1 copy "viture_kit: ^0.1.1" to clipboard
viture_kit: ^0.1.1 copied to clipboard

Native Dart FFI bindings for the VITURE XR Glasses SDK.

Viture Kit #

Native Dart FFI bindings for the VITURE XR Glasses SDK.

showcase

Platform Support #

Platform Support
macOS ✅ Supported
iOS ❌ Unsupported
Linux ❌ Unsupported
Android ✅ Supported
Windows ✅ Supported

API Reference #

Core Class: VitureKit #

Method / Property Type Description
sdkVersion String Returns the native SDK version string.
isHeadTrackingActive bool Indicates whether IMU data is currently streaming.
sensorStream Stream<VitureSensorData> Broadcast stream delivering raw and parsed orientation updates.
getBrightnessLevel() int Reads the current brightness level from the connected device.
setBrightnessLevel(int level) void Sets the brightness level for the connected device.
getVolumeLevel() int Reads the current volume level from the connected device.
setVolumeLevel(int level) void Sets the volume level for the connected device.
startHeadTracking({int imuFrequency = VitureImuFrequency.freq120Hz}) Future<void> Initializes native bindings and starts receiving IMU data.
releaseHeadTracking() Future<void> Safely shuts down the native provider and terminates the worker isolate.
setHeadTrackingEnabled(bool enabled) Future<void> Convenience toggle for starting or stopping head tracking.
dispose() Future<void> Releases tracking and closes the pose controller.

Data Class: VitureSensorData #

Field Type Description
roll, pitch, yaw double Device orientation in Euler angles.
quatW, quatX, quatY, quatZ double Device orientation as a quaternion.
magX, magY, magZ double? Magnetometer axes, populated only on magnetometer-capable devices (Luma / Luma Pro / Beast / Pro 2). null on devices without a magnetometer.
temperature double? Sensor temperature reading, populated alongside the magnetometer fields. null when unavailable.
hasMagnetometer bool Convenience getter indicating whether magX/magY/magZ are present.
timestamp int Timestamp associated with the pose sample.

Usage Example #

import 'dart:async';
import 'package:viture_kit/viture_kit.dart';

Future<void> main() async {
  final viture = VitureKit();

  print('VITURE SDK Version: ${VitureKit.sdkVersion}');

  // 1. Listen to orientation events
  final subscription = viture.sensorStream.listen((VitureSensorData pose) {
    print('Roll: ${pose.roll}, Pitch: ${pose.pitch}, Yaw:${pose.yaw}');
    print('Quat: [${pose.quatW},${pose.quatX}, ${pose.quatY},${pose.quatZ}]');
  });

  // 2. Claim ownership of the IMU
  try {
    await viture.takeHeadTracking();
    print('Head tracking started successfully.');
  } catch (e) {
    print('Failed to start head tracking: $e');
  }

  // 3. Stop tracking and clean up
  await subscription.cancel();
  await viture.releaseHeadTracking();
  await viture.dispose();
  print('Head tracking released.');
}

Caveat #

Important

When the Spacewalker App is open VitureKit will assume control of the IMU for head tracking, stopping tracking on the Spacewalker app.


Notice: This project was initally created to be used in-house, as such the development is first and foremost aligned with the internal requirements.

0
likes
0
points
373
downloads

Publisher

unverified uploader

Weekly Downloads

Native Dart FFI bindings for the VITURE XR Glasses SDK.

Homepage
Repository (GitHub)
View/report issues

Topics

#viture #xr #macos #ffi

License

unknown (license)

Dependencies

code_assets, ffi, hidapi, hooks, logging, native_toolchain_c

More

Packages that depend on viture_kit