<aside> ⚠️

This page is synced from GitHub. Edits will be overwritten.

Source: https://github.com/uwrealitylabs/standalone-knowledge-base/blob/main/docs/tracking/VIT.md

Last synced: 2026-11-01 23:20:24 UTC

</aside>

VIT

Part of t_slam.

Sources:

VIT (Visual-Inertial Tracking) is a C ABI between a consumer (Monado's t_slam) and a SLAM system shipped as a shared library. Both sides vendor the same header: Monado at src/external/vit_includes/vit/vit_interface.h, Basalt at thirdparty/vit/vit_interface.h. Both copies are version 2.0.1 (VIT_HEADER_VERSION_*, vit_interface.h:27–29).

Effect: Monado has no build or link dependency on the SLAM system. The algorithm is chosen at runtime by library path. Our GPU SLAM plugs in by implementing this header.

API

Two opaque handles: vit_tracker_t and vit_pose_t. Functions return vit_result_t except the destroys. Declarations at vit_interface.h:347–491.

Group Functions Notes
Version vit_api_get_version The loader calls this first; the major version must match the consumer's header
Lifecycle vit_tracker_create(config), _destroy, _start, _stop, _reset, _is_running vit_config (:147): file (implementation-specific config path), cam_count, imu_count, show_ui
Capabilities _has_image_format, _get_supported_extensions, _get_enabled_extensions, _enable_extension Extensions (:101): ADD_CAMERA_CALIBRATION, ADD_IMU_CALIBRATION, POSE_TIMING, POSE_FEATURES
Calibration _add_camera_calibration, _add_imu_calibration Only if the matching extension is supported. Camera models: none (pinhole), KB4, RT8
Input _push_imu_sample, _push_img_sample vit_imu_sample: timestamp, accel, gyro. vit_img_sample (:188): cam_index, timestamp, data/width/height/stride/size, format (L8 or R8G8B8), masks (regions to ignore)
Output _pop_pose, vit_pose_get_data, _get_timing, _get_features, vit_pose_destroy vit_pose_data (:208): timestamp, position, orientation quaternion, linear velocity, all float. The caller owns a popped pose until it destroys it

How t_slam calls it

Loading

auxiliary/tracking/t_vit_loader.c:

  1. dlopen the library (:44). Path from VIT_SYSTEM_LIBRARY_PATH, default libbasalt.so (t_tracker_slam.cpp:55, :88).
  2. Resolve vit_api_get_version, call it, reject a major version mismatch (:61–70).
  3. Resolve every other symbol with dlsym into the t_vit_bundle function-pointer struct (:73–92).
  4. t_vit_bundle_unload closes the library (:99–102).

Call sequence

All in auxiliary/tracking/t_tracker_slam.cpp.