Monado OpenXR Runtime
Loading...
Searching...
No Matches
rift_sensor_internal.h
Go to the documentation of this file.
1
// Copyright 2025-2026, Beyley Cardellio
2
// SPDX-License-Identifier: BSL-1.0
3
/*!
4
* @file
5
* @brief Internal structures for Oculus Rift sensor probing/initialization
6
* @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
7
* @ingroup drv_rift_sensor
8
*/
9
10
#include "
os/os_threading.h
"
11
12
#include "
rift_sensor_interface.h
"
13
14
#include <libusb.h>
15
16
17
struct
rift_sensor_context
18
{
19
enum
u_logging_level
log_level;
20
21
struct
libusb_context *usb_ctx;
22
struct
xrt_frame_context
*xfctx;
23
24
struct
rift_sensor
*sensors;
25
size_t
num_sensors;
26
27
struct
os_thread_helper
usb_thread;
28
};
29
30
struct
rift_sensor
31
{
32
enum
rift_sensor_variant variant;
33
struct
xrt_fs
*frame_server;
34
struct
t_camera_calibration
calibration;
35
struct
libusb_device_handle *hid_dev;
36
bool
usb2;
37
38
time_duration_ns
frame_interval;
39
};
40
41
#define SIZE_ASSERT(type, size) \
42
static_assert(sizeof(type) == (size), "Size of " #type " is not " #size " bytes as was expected")
43
44
#pragma pack(push, 1)
45
46
struct
rift_sensor_dk2_calib
47
{
48
uint8_t unk1[18];
// 00
49
__lef64
fx;
// 18
50
uint8_t unk2[4];
// 26
51
__lef64
fy;
// 30
52
uint8_t unk3[4];
// 38
53
__lef64
cx;
// 42
54
uint8_t unk4[4];
// 50
55
__lef64
cy;
// 54
56
uint8_t unk5[4];
// 62
57
__lef64
k1;
// 66
58
uint8_t unk6[4];
// 74
59
__lef64
k2;
// 78
60
uint8_t unk7[4];
// 86
61
__lef64
p1;
// 90
62
uint8_t unk8[4];
// 98
63
__lef64
p2;
// 102
64
uint8_t unk9[4];
// 110
65
__lef64
k3;
// 114
66
uint8_t pad[6];
// 122
67
};
68
SIZE_ASSERT(
struct
rift_sensor_dk2_calib
, 128);
69
70
struct
rift_sensor_cv1_calib
71
{
72
uint8_t unk1[0x30];
// 0x00
73
__lef32
fxy;
// 0x30
74
__lef32
cx;
// 0x34
75
__lef32
cy;
// 0x38
76
uint8_t unk2[0xC];
// 0x3c
77
__lef32
k1;
// 0x48
78
__lef32
k2;
// 0x4c
79
__lef32
k3;
// 0x50
80
__lef32
k4;
// 0x54
81
uint8_t pad[128 - 0x58];
// 0x58
82
};
83
SIZE_ASSERT(
struct
rift_sensor_cv1_calib
, 128);
84
85
#pragma pack(pop)
u_logging_level
u_logging_level
Logging level enum.
Definition
u_logging.h:45
time_duration_ns
int64_t time_duration_ns
Integer duration type in nanoseconds.
Definition
u_time.h:88
os_threading.h
Wrapper around OS threading native functions.
rift_sensor_interface.h
Interface to Oculus Rift sensor probing/initialization.
__lef32
Little endian 32-bit float wrapper struct.
Definition
xrt_byte_order.h:73
__lef64
Little endian 64-bit float wrapper struct.
Definition
xrt_byte_order.h:142
os_thread_helper
All in one helper that handles locking, waiting for change and starting a thread.
Definition
os_threading.h:499
rift_sensor_context
Definition
rift_sensor_internal.h:18
rift_sensor_cv1_calib
Definition
rift_sensor_internal.h:71
rift_sensor_dk2_calib
Definition
rift_sensor_internal.h:47
rift_sensor
Definition
rift_sensor_internal.h:31
t_camera_calibration
Essential calibration data for a single camera, or single lens/sensor of a stereo camera.
Definition
t_tracking.h:236
xrt_frame_context
Object used to track all sinks and frame producers in a graph.
Definition
xrt_frame.h:108
xrt_fs
Frameserver that generates frames.
Definition
xrt_frameserver.h:70
drivers
rift_sensor
rift_sensor_internal.h
Generated by
1.9.8