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
76 uint16_t dp_frame_cnt;
84 bool gaze_point_valid;
88 bool gaze_direction_valid;
93 struct xrt_vec3 filtered_gaze_direction;
96 bool pupil_diameter_valid;
100 bool unk_float_2_valid;
103 bool unk_float_4_valid;
116 bool gaze_point_valid;
120 bool gaze_direction_valid;
125 struct xrt_vec3 filtered_gaze_direction;
129 bool unk_float_8_valid;
132 bool unk_float3_pair_valid;
152 bool data_mutex_created;
157 bool processed_sample_packet;
159 uint32_t last_remote_report_sample_time_us;
162 bool unk_float_4_valid;
165 bool unk_float_5_valid;
186 xrt_atomic_s32_t proximity_sensor;
187 bool function_button;
193 enum psvr2_camera_mode camera_mode;
201 uint32_t last_imu_vts_us;
202 uint16_t last_imu_ts;
207 uint32_t last_slam_vts_us;
210 struct xrt_pose slam_correction_pose;
224 libusb_device_handle *dev;
228 int usb_active_xfers;
231 struct libusb_transfer *status_xfer;
233 struct libusb_transfer *slam_xfer;
235 struct libusb_transfer *camera_xfers[NUM_CAM_XFERS];
237 struct libusb_transfer *led_detector_xfer;
239 struct libusb_transfer *relocalizer_xfer;
241 struct libusb_transfer *vd_xfer;
243 struct libusb_transfer *gaze_xfer;
248 float distortion_calibration[8];
251 int timestamp_samples;
266 bool eye_feature_enabled;
267 bool face_feature_enabled;
279enum psvr2_hmd_input_name
281 PSVR2_HMD_INPUT_HEAD_POSE,
282 PSVR2_HMD_INPUT_FUNCTION_BUTTON,
283 PSVR2_HMD_INPUT_EYE_GAZE_POSE,
284 PSVR2_HMD_INPUT_FB_FACE_TRACKING2_VISUAL,
285 PSVR2_HMD_INPUT_HTC_EYE_FACE_TRACKING,
286 PSVR2_HMD_INPUT_ANDROID_FACE_TRACKING,
287 PSVR2_HMD_INPUT_COUNT,
291psvr2_compute_distortion_asymmetric(
292 float *calibration,
struct xrt_uv_triplet *distCoords,
int eEye,
float fU,
float fV);
295psvr2_usb_xfer_continue(
struct libusb_transfer *xfer,
const char *type);
298send_psvr2_control(
struct psvr2_hmd *
hmd, uint16_t report_id, uint8_t subcmd, uint8_t *pkt_data, uint32_t pkt_len);
307psvr2_get_face_tracking(
struct xrt_device *xdev,
309 int64_t at_timestamp_ns,
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
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition xrt_defines.h:915
enum xrt_result xrt_result_t
Result type used across Monado.
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.
PSVR2 HMD protocol defines.
Definition m_filter_fifo.c:23
One Euro filter for a 3D float measurement.
Definition m_filter_one_euro.h:104
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
bool want_enabled
Whether eye tracking is currently enabled.
Definition psvr2.h:143
bool enabled
Whether the eye tracking enable command has been sent.
Definition psvr2.h:147
PSVR2 HMD device.
Definition psvr2.h:175
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
Definition xrt_defines.h:1934
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 2 element vector with single floats.
Definition xrt_defines.h:268
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.