60#define NUM_CAM_XFERS 1
62#define PSVR2_TRACE(p, ...) U_LOG_XDEV_IFL_T(&p->base, p->log_level, __VA_ARGS__)
63#define PSVR2_TRACE_HEX(p, data, data_size) U_LOG_XDEV_IFL_T_HEX(&p->base, p->log_level, data, data_size)
64#define PSVR2_DEBUG(p, ...) U_LOG_XDEV_IFL_D(&p->base, p->log_level, __VA_ARGS__)
65#define PSVR2_DEBUG_HEX(p, data, data_size) U_LOG_XDEV_IFL_D_HEX(&p->base, p->log_level, data, data_size)
66#define PSVR2_WARN(p, ...) U_LOG_XDEV_IFL_W(&p->base, p->log_level, __VA_ARGS__)
67#define PSVR2_ERROR(p, ...) U_LOG_XDEV_IFL_E(&p->base, p->log_level, __VA_ARGS__)
69#define TIMESTAMP_SAMPLES 100
88 xrt_atomic_s32_t proximity_sensor;
95 enum psvr2_camera_mode camera_mode;
103 uint32_t last_imu_vts_us;
104 uint16_t last_imu_ts;
109 uint32_t last_slam_vts_us;
112 struct xrt_pose slam_correction_pose;
126 libusb_device_handle *dev;
130 int usb_active_xfers;
133 struct libusb_transfer *status_xfer;
135 struct libusb_transfer *slam_xfer;
137 struct libusb_transfer *camera_xfers[NUM_CAM_XFERS];
139 struct libusb_transfer *led_detector_xfer;
141 struct libusb_transfer *relocalizer_xfer;
143 struct libusb_transfer *vd_xfer;
145 struct libusb_transfer *gaze_xfer;
150 float distortion_calibration[8];
153 int timestamp_samples;
175enum psvr2_hmd_input_name
177 PSVR2_HMD_INPUT_HEAD_POSE,
178 PSVR2_HMD_INPUT_FUNCTION_BUTTON,
179 PSVR2_HMD_INPUT_COUNT,
183psvr2_compute_distortion_asymmetric(
184 float *calibration,
struct xrt_uv_triplet *distCoords,
int eEye,
float fU,
float fV);
187psvr2_usb_xfer_continue(
struct libusb_transfer *xfer,
const char *type);
190send_psvr2_control(
struct psvr2_hmd *
hmd, uint16_t report_id, uint8_t subcmd, uint8_t *pkt_data, uint32_t pkt_len);
u_logging_level
Logging level enum.
Definition: u_logging.h:45
int64_t timepoint_ns
Integer timestamp type.
Definition: u_time.h:77
int64_t time_duration_ns
Integer duration type in nanoseconds.
Definition: u_time.h:88
C interface to math library.
Helpers to estimate offsets between clocks.
A fifo that also lets you dynamically filter.
Header for a "One Euro Filter" implementation.
Wrapper header for <math.h> to ensure pi-related math constants are defined.
Small utility for keeping track of the history of an xrt_space_relation, ie.
Wrapper around OS threading native functions.
Wrapper around OS native time functions.
static struct psvr2_hmd * psvr2_hmd(struct xrt_device *xdev)
Casting helper function.
Definition: psvr2.h:170
PSVR2 HMD protocol defines.
Definition: m_filter_fifo.c:23
Definition: m_relation_history.cpp:49
A wrapper around a native mutex.
Definition: os_threading.h:69
All in one helper that handles locking, waiting for change and starting a thread.
Definition: os_threading.h:499
PSVR2 HMD device.
Definition: psvr2.h:77
Info to describe a very simple headset with diffractive lens optics.
Definition: u_device.h:55
Allows more safely to debug sink inputs and outputs.
Definition: u_sink.h:211
A single HMD or input device.
Definition: xrt_device.h:310
struct xrt_hmd_parts * hmd
Null if this device does not interface with the users head.
Definition: xrt_device.h:322
A pose composed of a position and orientation.
Definition: xrt_defines.h:479
Represents a uv triplet for distortion, basically just three xrt_vec2.
Definition: xrt_defines.h:279
A 3 element vector with single floats.
Definition: xrt_defines.h:289
Misc helpers for device drivers.
Code to generate disortion meshes.
Basic logging functionality.
xrt_frame_sink converters and other helpers.
Time-keeping: a clock that is steady, convertible to system time, and ideally high-resolution.
Tracing support code, see Tracing support.
Endian-specific byte order defines.
Common defines and enums for XRT.
Header defining an xrt display or controller device.
Common interface to probe for devices.
Header defining the tracking system integration in Monado.