39#define WMR_MAX_CONTROLLERS 2
52 int (*init_func)(
struct wmr_hmd *wh);
53 void (*deinit_func)(
struct wmr_hmd *wh);
54 void (*screen_enable_func)(
struct wmr_hmd *wh,
bool enable);
88 int32_t left_view_y_offset, right_view_y_offset;
188 char hand_status[128];
189 char slam_status[128];
193 struct os_mutex controller_status_lock;
194 struct os_cond controller_status_cond;
195 bool have_left_controller_status;
196 bool have_right_controller_status;
219wmr_hmd_send_controller_packet(
struct wmr_hmd *
hmd,
const uint8_t *buffer, uint32_t buf_size);
221wmr_hmd_read_sync_from_controller(
struct wmr_hmd *
hmd, uint8_t *buffer, uint32_t buf_size,
int timeout_ms);
u_logging_level
Logging level enum.
Definition: u_logging.h:43
wmr_headset_type
Headset type, used to select different control and init/shutdown procedures.
Definition: wmr_common.h:29
A IMU fusion specially made for 3dof devices.
Wrapper around OS threading native functions.
Definition: wmr_protocol.h:79
Definition: m_imu_3dof.h:35
A wrapper around a native conditional variable.
Definition: os_threading.h:189
Representing a single hid interface on a device.
Definition: os_hid.h:29
A wrapper around a native mutex.
Definition: os_threading.h:55
All in one helper that handles locking, waiting for change and starting a thread.
Definition: os_threading.h:453
Calibration information necessary for SLAM tracking.
Definition: t_tracking.h:636
Draggable single precision float information.
Definition: u_var.h:120
const char * debug_name
Friendly ID string for debug.
Definition: wmr_hmd.h:50
const char * dev_id_str
String by which we recognise the device.
Definition: wmr_hmd.h:48
Definition: wmr_config.h:166
Definition: wmr_hmd_controller.h:24
struct xrt_vec2 tex_x_range
tan(angle) FoV min/max for X and Y in the input texture
Definition: wmr_hmd.h:64
struct xrt_matrix_3x3 inv_affine_xform
Inverse affine transform to move from (undistorted) pixels to image plane / normalised image coordina...
Definition: wmr_hmd.h:61
struct wmr_config_header config_hdr
firmware configuration block, with device names etc
Definition: wmr_hmd.h:78
bool slam_enabled
Set at start. Whether the SLAM tracker was initialized.
Definition: wmr_hmd.h:156
struct m_imu_3dof i3dof
Main fusion calculator.
Definition: wmr_hmd.h:128
struct u_var_draggable_f32 tracked_offset_ms
Offset for tracked pose offsets (applies to both fusion and SLAM).
Definition: wmr_hmd.h:182
bool hand_enabled
Set at start. Whether the hand tracker was initialized.
Definition: wmr_hmd.h:159
struct wmr_hmd_config config
Config data parsed from the firmware JSON.
Definition: wmr_hmd.h:81
struct xrt_fs * source
Source of video/IMU data for tracking.
Definition: wmr_hmd.h:141
struct os_thread_helper oth
Packet reading thread.
Definition: wmr_hmd.h:84
struct os_hid_device * hid_hololens_sensors_dev
This is the Hololens Sensors device, this is where we get all of the IMU data and read the config fro...
Definition: wmr_hmd.h:99
bool average_imus
Average 4 IMU samples before sending them to the trackers.
Definition: wmr_hmd.h:175
uint64_t last_imu_timestamp_ns
When did we get the last IMU sample, in CPU time.
Definition: wmr_hmd.h:134
struct wmr_hmd::@209 tracking
Fields related to camera-based tracking (SLAM and hand tracking)
struct xrt_vec3 last_angular_velocity
The last angular velocity from the IMU, for prediction.
Definition: wmr_hmd.h:131
struct xrt_pose offset
Additional offset to apply to pose
Definition: wmr_hmd.h:172
struct xrt_pose pose
Last tracked pose.
Definition: wmr_hmd.h:169
uint16_t raw_ipd
Latest raw IPD value read from the device.
Definition: wmr_hmd.h:113
struct xrt_frame_context xfctx
Context for source.
Definition: wmr_hmd.h:144
bool hmd_screen_enable
Current desired HMD screen state.
Definition: wmr_hmd.h:111
struct t_slam_calibration slam_calib
Calibration data for SLAM.
Definition: wmr_hmd.h:153
bool slam_over_3dof
Whether to track the HMD with 6dof SLAM or fallback to the fusion 3dof tracker.
Definition: wmr_hmd.h:166
uint8_t proximity_sensor
Latest proximity sensor value read from the device.
Definition: wmr_hmd.h:115
struct xrt_tracked_slam * slam
SLAM tracker.
Definition: wmr_hmd.h:150
struct os_hid_device * hid_control_dev
This is the vendor specific companion device of the Hololens Sensors.
Definition: wmr_hmd.h:108
struct wmr_hmd_distortion_params distortion_params[2]
Distortion related parameters.
Definition: wmr_hmd.h:118
struct os_mutex mutex
Protects all members of the fusion substruct.
Definition: wmr_hmd.h:125
bool imu2me
SLAM systems track the IMU pose, enabling this corrects it to middle of the eyes.
Definition: wmr_hmd.h:162
A single HMD or input device.
Definition: xrt_device.h:241
struct xrt_hmd_parts * hmd
Null if this device does not interface with the users head.
Definition: xrt_device.h:253
Object used to track all sinks and frame producers in a graph.
Definition: xrt_frame.h:108
Frameserver that generates frames.
Definition: xrt_frameserver.h:70
A tightly packed 3x3 matrix of floats.
Definition: xrt_defines.h:533
A pose composed of a position and orientation.
Definition: xrt_defines.h:465
A probed device, may or may not be opened.
Definition: xrt_prober.h:85
An adapter that wraps an external SLAM tracker to provide SLAM tracking.
Definition: xrt_tracking.h:294
A 2 element vector with single floats.
Definition: xrt_defines.h:250
A 3 element vector with single floats.
Definition: xrt_defines.h:271
Code to generate disortion meshes.
Basic logging functionality.
Interface to read WMR cameras.
Defines and constants related to WMR driver code.
WMR and MS HoloLens configuration structures.
void wmr_hmd_create(enum wmr_headset_type hmd_type, struct os_hid_device *hid_holo, struct os_hid_device *hid_ctrl, struct xrt_prober_device *dev_holo, enum u_logging_level log_level, struct xrt_device **out_hmd, struct xrt_device **out_handtracker, struct xrt_device **out_left_controller, struct xrt_device **out_right_controller)
Definition: wmr_hmd.c:1930
Implementation of tunnelled controller connection, that translates messages passing via an HP G2 or S...
WMR and MS HoloLens protocol constants, structures and helpers header.
Header defining an xrt display or controller device.
Common interface to probe for devices.