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_ERROR(p, ...) U_LOG_XDEV_IFL_E(&p->base, p->log_level, __VA_ARGS__)
67#define PSVR2_WARN(p, ...) U_LOG_XDEV_IFL_W(&p->base, p->log_level, __VA_ARGS__)
68#define PSVR2_INFO(p, ...) U_LOG_XDEV_IFL_I(&p->base, p->log_level, __VA_ARGS__)
70#define TIMESTAMP_SAMPLES 100
77 uint16_t dp_frame_cnt;
85 bool gaze_point_valid;
89 bool gaze_direction_valid;
94 struct xrt_vec3 filtered_gaze_direction;
97 bool pupil_diameter_valid;
101 bool unk_float_2_valid;
104 bool unk_float_4_valid;
117 bool gaze_point_valid;
121 bool gaze_direction_valid;
126 struct xrt_vec3 filtered_gaze_direction;
130 bool unk_float_8_valid;
133 bool unk_float3_pair_valid;
153 bool data_mutex_created;
158 bool processed_sample_packet;
160 uint32_t last_remote_report_sample_time_us;
163 bool unk_float_4_valid;
166 bool unk_float_5_valid;
187 xrt_atomic_s32_t proximity_sensor;
188 bool function_button;
194 enum psvr2_camera_mode camera_mode;
202 uint32_t last_imu_vts_us;
203 uint16_t last_imu_ts;
208 uint32_t last_slam_vts_us;
211 struct xrt_pose slam_correction_pose;
225 libusb_device_handle *dev;
229 int usb_active_xfers;
232 struct libusb_transfer *status_xfer;
234 struct libusb_transfer *slam_xfer;
236 struct libusb_transfer *camera_xfers[NUM_CAM_XFERS];
238 struct libusb_transfer *led_detector_xfer;
240 struct libusb_transfer *relocalizer_xfer;
242 struct libusb_transfer *vd_xfer;
244 struct libusb_transfer *gaze_xfer;
249 float distortion_calibration[8];
252 int timestamp_samples;
267 bool eye_feature_enabled;
268 bool face_feature_enabled;
280enum psvr2_hmd_input_name
282 PSVR2_HMD_INPUT_HEAD_POSE,
283 PSVR2_HMD_INPUT_FUNCTION_BUTTON,
284 PSVR2_HMD_INPUT_EYE_GAZE_POSE,
285 PSVR2_HMD_INPUT_FB_FACE_TRACKING2_VISUAL,
286 PSVR2_HMD_INPUT_HTC_EYE_FACE_TRACKING,
287 PSVR2_HMD_INPUT_ANDROID_FACE_TRACKING,
288 PSVR2_HMD_INPUT_COUNT,
292psvr2_compute_distortion_asymmetric(
293 float *calibration,
struct xrt_uv_triplet *distCoords,
int eEye,
float fU,
float fV);
296psvr2_usb_xfer_continue(
struct libusb_transfer *xfer,
const char *type);
299send_psvr2_control(
struct psvr2_hmd *
hmd, uint16_t report_id, uint8_t subcmd, uint8_t *pkt_data, uint32_t pkt_len);
308psvr2_get_face_tracking(
struct xrt_device *xdev,
310 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:930
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:144
bool enabled
Whether the eye tracking enable command has been sent.
Definition psvr2.h:148
PSVR2 HMD device.
Definition psvr2.h:176
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:214
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:1967
A pose composed of a position and orientation.
Definition xrt_defines.h:492
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.