Monado OpenXR Runtime
rift_s.c File Reference

Oculus Rift S headset tracking system. More...

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <assert.h>
#include "math/m_api.h"
#include "math/m_vec3.h"
#include "os/os_time.h"
#include "util/u_device.h"
#include "util/u_distortion_mesh.h"
#include "util/u_trace_marker.h"
#include "util/u_var.h"
#include "xrt/xrt_device.h"
#include "rift_s.h"
#include "rift_s_hmd.h"
#include "rift_s_controller.h"
#include "rift_s_camera.h"
Include dependency graph for rift_s.c:

Functions

static void * rift_s_run_thread (void *ptr)
 
static void rift_s_system_free (struct rift_s_system *sys)
 
static int read_camera_calibration (struct os_hid_device *hid_hmd, struct rift_s_camera_calibration_block *calibration)
 
static int read_hmd_fw_imu_calibration (struct os_hid_device *hid_hmd, struct rift_s_imu_calibration *imu_calibration)
 
static int read_hmd_proximity_threshold (struct os_hid_device *hid_hmd, int *proximity_threshold)
 
static int read_hmd_config (struct os_hid_device *hid_hmd, struct rift_s_hmd_config *config)
 
struct rift_s_systemrift_s_system_create (struct xrt_prober *xp, const unsigned char *hmd_serial_no, struct os_hid_device *hid_hmd, struct os_hid_device *hid_status, struct os_hid_device *hid_controllers)
 
void rift_s_system_reference (struct rift_s_system **dst, struct rift_s_system *src)
 
struct os_hid_devicerift_s_system_hid_handle (struct rift_s_system *sys)
 
rift_s_radio_staterift_s_system_radio (struct rift_s_system *sys)
 
struct rift_s_trackerrift_s_system_get_tracker (struct rift_s_system *sys)
 
struct xrt_devicerift_s_system_get_hmd (struct rift_s_system *sys)
 
void rift_s_system_remove_hmd (struct rift_s_system *sys)
 
struct xrt_devicerift_s_system_get_controller (struct rift_s_system *sys, int index)
 
void rift_s_system_remove_controller (struct rift_s_system *sys, struct rift_s_controller *ctrl)
 
struct xrt_devicerift_s_system_get_hand_tracking_device (struct rift_s_system *sys)
 
static int update_tracked_device_types (struct rift_s_system *sys)
 
static void handle_hmd_report (struct rift_s_system *sys, timepoint_ns local_ts, const unsigned char *buf, int size)
 
static void handle_controller_report (struct rift_s_system *sys, timepoint_ns local_ts, const unsigned char *buf, int size)
 
static bool handle_packets (struct rift_s_system *sys)
 

Detailed Description

Oculus Rift S headset tracking system.

The Rift S system provides the HID/USB polling thread and dispatches incoming packets to the HMD and controller implementations.

Ported from OpenHMD

Author
Jan Schmidt jan@c.nosp@m.entr.nosp@m.icula.nosp@m.r.co.nosp@m.m