Monado OpenXR Runtime
rokid_hmd.c File Reference

Driver for the Rokid Air and Max devices. More...

#include "rokid_interface.h"
#include "xrt/xrt_defines.h"
#include "xrt/xrt_device.h"
#include "xrt/xrt_prober.h"
#include "os/os_threading.h"
#include "os/os_time.h"
#include "math/m_api.h"
#include "math/m_imu_3dof.h"
#include "math/m_mathinclude.h"
#include "math/m_predict.h"
#include "util/u_debug.h"
#include "util/u_device.h"
#include "util/u_distortion_mesh.h"
#include "util/u_trace_marker.h"
#include "util/u_var.h"
#include "util/u_linux.h"
#include <libusb.h>
Include dependency graph for rokid_hmd.c:

Data Structures

struct  rokid_fusion
 
struct  rokid_hmd
 
struct  rokid_usb_packed_vec
 
struct  rokid_usb_pkt_combined
 
struct  rokid_usb_pkt_sensor
 

Macros

#define ROKID_USB_INTERFACE_NUM   2
 
#define ROKID_INTERRUPT_IN_ENDPOINT   0x82
 
#define ROKID_USB_BUFFER_LEN   0x40
 
#define ROKID_USB_TRANSFER_TIMEOUT_MS   1000
 
#define ROKID_PACKED
 
#define ROKID_TRACE(hmd, ...)   U_LOG_XDEV_IFL_T(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define ROKID_DEBUG(hmd, ...)   U_LOG_XDEV_IFL_D(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define ROKID_INFO(hmd, ...)   U_LOG_XDEV_IFL_I(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define ROKID_ERROR(hmd, ...)   U_LOG_XDEV_IFL_E(&hmd->base, hmd->log_level, __VA_ARGS__)
 

Functions

static struct xrt_vec3 rokid_convert_vector (struct rokid_usb_packed_vec *v)
 
static struct rokid_hmdrokid_hmd (struct xrt_device *xdev)
 
static void rokid_fusion_create (struct rokid_fusion *fusion)
 
static void rokid_fusion_parse_usb_packet (struct rokid_fusion *fusion, unsigned char usb_buffer[0x40])
 
static void rokid_fusion_get_pose (struct rokid_fusion *fusion, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
 
static void rokid_fusion_destroy (struct rokid_fusion *fusion)
 
static void rokid_fusion_add_vars (struct rokid_fusion *fusion, void *root)
 
static void * rokid_usb_thread (void *ptr)
 
static int rokid_hmd_get_display_mode (struct rokid_hmd *rokid)
 
static bool rokid_hmd_set_display_mode (struct rokid_hmd *rokid, uint16_t mode)
 
static bool rokid_hmd_usb_init (struct rokid_hmd *rokid, struct xrt_prober_device *prober_device)
 
static void rokid_hmd_destroy (struct xrt_device *xdev)
 
static xrt_result_t rokid_hmd_get_tracked_pose (struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
 
static struct xrt_devicerokid_hmd_create (struct xrt_prober_device *prober_device)
 
int rokid_found (struct xrt_prober *xp, struct xrt_prober_device **devices, size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev)
 Probing function for Rokid devices. More...
 

Detailed Description

Driver for the Rokid Air and Max devices.

Author
Alex Badics admin.nosp@m.@sti.nosp@m.ckman.nosp@m..hu