Monado OpenXR Runtime
wmr_hmd Struct Reference
Inheritance diagram for wmr_hmd:
Collaboration diagram for wmr_hmd:

Data Fields

struct xrt_device base
 
const struct wmr_headset_descriptorhmd_desc
 
struct wmr_config_header config_hdr
 firmware configuration block, with device names etc More...
 
struct wmr_hmd_config config
 Config data parsed from the firmware JSON. More...
 
struct os_thread_helper oth
 Packet reading thread. More...
 
enum u_logging_level log_level
 
int32_t left_view_y_offset
 
int32_t right_view_y_offset
 
struct os_hid_devicehid_hololens_sensors_dev
 This is the Hololens Sensors device, this is where we get all of the IMU data and read the config from. More...
 
struct os_mutex hid_lock
 
struct os_hid_devicehid_control_dev
 This is the vendor specific companion device of the Hololens Sensors. More...
 
bool hmd_screen_enable
 Current desired HMD screen state. More...
 
uint16_t raw_ipd
 Latest raw IPD value read from the device. More...
 
uint8_t proximity_sensor
 Latest proximity sensor value read from the device. More...
 
struct wmr_hmd_distortion_params distortion_params [2]
 Distortion related parameters. More...
 
struct hololens_sensors_packet packet
 
struct {
   struct os_mutex   mutex
 Protects all members of the fusion substruct. More...
 
   struct m_imu_3dof   i3dof
 Main fusion calculator. More...
 
   struct xrt_vec3   last_angular_velocity
 The last angular velocity from the IMU, for prediction. More...
 
   uint64_t   last_imu_timestamp_ns
 When did we get the last IMU sample, in CPU time. More...
 
fusion
 
struct {
   struct xrt_fs *   source
 Source of video/IMU data for tracking. More...
 
   struct xrt_frame_context   xfctx
 Context for source. More...
 
   struct xrt_tracked_slam *   slam
 SLAM tracker. More...
 
   struct t_slam_calibration   slam_calib
 Calibration data for SLAM. More...
 
   bool   slam_enabled
 Set at start. Whether the SLAM tracker was initialized. More...
 
   bool   hand_enabled
 Set at start. Whether the hand tracker was initialized. More...
 
   bool   imu2me
 SLAM systems track the IMU pose, enabling this corrects it to middle of the eyes. More...
 
tracking
 Fields related to camera-based tracking (SLAM and hand tracking) More...
 
bool slam_over_3dof
 Whether to track the HMD with 6dof SLAM or fallback to the fusion 3dof tracker. More...
 
struct xrt_pose pose
 Last tracked pose. More...
 
struct xrt_pose offset
 Additional offset to apply to pose More...
 
bool average_imus
 Average 4 IMU samples before sending them to the trackers. More...
 
struct u_var_draggable_f32 tracked_offset_ms
 Offset for tracked pose offsets (applies to both fusion and SLAM). More...
 
struct {
   struct u_var_button   hmd_screen_enable_btn
 
   struct u_var_button   switch_tracker_btn
 
   char   hand_status [128]
 
   char   slam_status [128]
 
gui
 
struct os_mutex controller_status_lock
 
struct os_cond controller_status_cond
 
bool have_left_controller_status
 
bool have_right_controller_status
 
struct wmr_hmd_controller_connectioncontroller [2]
 
- Data Fields inherited from xrt_device
enum xrt_device_name name
 Enum identifier of the device. More...
 
enum xrt_device_type device_type
 
char str [256]
 A string describing the device. More...
 
char serial [256]
 A unique identifier. Persistent across configurations, if possible. More...
 
struct xrt_hmd_partshmd
 Null if this device does not interface with the users head. More...
 
struct xrt_tracking_origintracking_origin
 Always set, pointing to the tracking system for this device. More...
 
size_t binding_profile_count
 Number of bindings in xrt_device::binding_profiles. More...
 
struct xrt_binding_profilebinding_profiles
 
size_t input_count
 Number of inputs. More...
 
struct xrt_inputinputs
 Array of input structs. More...
 
size_t output_count
 Number of outputs. More...
 
struct xrt_outputoutputs
 Array of output structs. More...
 
bool orientation_tracking_supported
 
bool position_tracking_supported
 
bool hand_tracking_supported
 
bool eye_gaze_supported
 
bool force_feedback_supported
 
bool ref_space_usage_supported
 
bool form_factor_check_supported
 
bool stage_supported
 
bool face_tracking_supported
 
bool body_tracking_supported
 
bool battery_status_supported
 
xrt_result_t(* update_inputs )(struct xrt_device *xdev)
 Update any attached inputs. More...
 
xrt_result_t(* get_tracked_pose )(struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
 Get relationship of a tracked device to the tracking origin space as the base space. More...
 
void(* get_hand_tracking )(struct xrt_device *xdev, enum xrt_input_name name, int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, int64_t *out_timestamp_ns)
 Get relationship of hand joints to the tracking origin space as the base space. More...
 
xrt_result_t(* get_face_tracking )(struct xrt_device *xdev, enum xrt_input_name facial_expression_type, int64_t at_timestamp_ns, struct xrt_facial_expression_set *out_value)
 Get the requested blend shape properties & weights for a face tracker. More...
 
xrt_result_t(* get_body_skeleton )(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, struct xrt_body_skeleton *out_value)
 Get the body skeleton in T-pose, used to query the skeleton hierarchy, scale, proportions etc. More...
 
xrt_result_t(* get_body_joints )(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, int64_t desired_timestamp_ns, struct xrt_body_joint_set *out_value)
 Get the joint locations for a body tracker. More...
 
void(* set_output )(struct xrt_device *xdev, enum xrt_output_name name, const union xrt_output_value *value)
 Set a output value. More...
 
void(* get_view_poses )(struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, int64_t at_timestamp_ns, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
 Get the per-view pose in relation to the view space. More...
 
bool(* compute_distortion )(struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
 Compute the distortion at a single point. More...
 
xrt_result_t(* get_visibility_mask )(struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
 Get the visibility mask for this device. More...
 
xrt_result_t(* ref_space_usage )(struct xrt_device *xdev, enum xrt_reference_space_type type, enum xrt_input_name name, bool used)
 Called by the xrt_space_overseer when a reference space that is implemented by this device is first used, or when the last usage of the reference space stops. More...
 
bool(* is_form_factor_available )(struct xrt_device *xdev, enum xrt_form_factor form_factor)
 Check if given form factor is available or not. More...
 
xrt_result_t(* get_battery_status )(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
 Get battery status information. More...
 
xrt_result_t(* begin_feature )(struct xrt_device *xdev, enum xrt_device_feature_type type)
 Enable the feature for this device. More...
 
xrt_result_t(* end_feature )(struct xrt_device *xdev, enum xrt_device_feature_type type)
 Disable the feature for this device. More...
 
void(* destroy )(struct xrt_device *xdev)
 Destroy device. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from xrt_device
static xrt_result_t xrt_device_update_inputs (struct xrt_device *xdev)
 Helper function for xrt_device::update_inputs. More...
 
static xrt_result_t xrt_device_get_tracked_pose (struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
 Helper function for xrt_device::get_tracked_pose. More...
 
static void xrt_device_get_hand_tracking (struct xrt_device *xdev, enum xrt_input_name name, int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, int64_t *out_timestamp_ns)
 Helper function for xrt_device::get_hand_tracking. More...
 
static xrt_result_t xrt_device_get_face_tracking (struct xrt_device *xdev, enum xrt_input_name facial_expression_type, int64_t at_timestamp_ns, struct xrt_facial_expression_set *out_value)
 Helper function for xrt_device::get_face_tracking. More...
 
static xrt_result_t xrt_device_get_body_skeleton (struct xrt_device *xdev, enum xrt_input_name body_tracking_type, struct xrt_body_skeleton *out_value)
 Helper function for xrt_device::get_body_skeleton. More...
 
static xrt_result_t xrt_device_get_body_joints (struct xrt_device *xdev, enum xrt_input_name body_tracking_type, int64_t desired_timestamp_ns, struct xrt_body_joint_set *out_value)
 Helper function for xrt_device::get_body_joints. More...
 
static void xrt_device_set_output (struct xrt_device *xdev, enum xrt_output_name name, const union xrt_output_value *value)
 Helper function for xrt_device::set_output. More...
 
static void xrt_device_get_view_poses (struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, int64_t at_timestamp_ns, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
 Helper function for xrt_device::get_view_poses. More...
 
static bool xrt_device_compute_distortion (struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
 Helper function for xrt_device::compute_distortion. More...
 
static xrt_result_t xrt_device_get_visibility_mask (struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
 Helper function for xrt_device::get_visibility_mask. More...
 
static xrt_result_t xrt_device_ref_space_usage (struct xrt_device *xdev, enum xrt_reference_space_type type, enum xrt_input_name name, bool used)
 Helper function for xrt_device::ref_space_usage. More...
 
static bool xrt_device_is_form_factor_available (struct xrt_device *xdev, enum xrt_form_factor form_factor)
 Helper function for xrt_device::is_form_factor_available. More...
 
static xrt_result_t xrt_device_get_battery_status (struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
 Helper function for xrt_device::get_battery_status. More...
 
static xrt_result_t xrt_device_begin_feature (struct xrt_device *xdev, enum xrt_device_feature_type type)
 Helper function for xrt_device::begin_feature. More...
 
static xrt_result_t xrt_device_end_feature (struct xrt_device *xdev, enum xrt_device_feature_type type)
 Helper function for xrt_device::end_feature. More...
 
static void xrt_device_destroy (struct xrt_device **xdev_ptr)
 Helper function for xrt_device::destroy. More...
 

Field Documentation

◆ average_imus

bool wmr_hmd::average_imus

Average 4 IMU samples before sending them to the trackers.

Referenced by wmr_hmd_fill_slam_imu_calibration().

◆ config

struct wmr_hmd_config wmr_hmd::config

Config data parsed from the firmware JSON.

Referenced by wmr_hmd_fill_slam_cams_calibration().

◆ config_hdr

struct wmr_config_header wmr_hmd::config_hdr

firmware configuration block, with device names etc

◆ distortion_params

struct wmr_hmd_distortion_params wmr_hmd::distortion_params[2]

Distortion related parameters.

◆ hand_enabled

bool wmr_hmd::hand_enabled

Set at start. Whether the hand tracker was initialized.

◆ hid_control_dev

struct os_hid_device* wmr_hmd::hid_control_dev

This is the vendor specific companion device of the Hololens Sensors.

When activated, it will report the physical IPD adjustment and proximity sensor status of the headset. It also allows enabling/disabling the HMD screen on Reverb G1/G2.

◆ hid_hololens_sensors_dev

struct os_hid_device* wmr_hmd::hid_hololens_sensors_dev

This is the Hololens Sensors device, this is where we get all of the IMU data and read the config from.

During start it is owned by the thread creating the device, after init it is owned by the reading thread. Read/write access is protected by the hid_lock

◆ hmd_screen_enable

bool wmr_hmd::hmd_screen_enable

Current desired HMD screen state.

◆ i3dof

struct m_imu_3dof wmr_hmd::i3dof

Main fusion calculator.

◆ imu2me

bool wmr_hmd::imu2me

SLAM systems track the IMU pose, enabling this corrects it to middle of the eyes.

◆ last_angular_velocity

struct xrt_vec3 wmr_hmd::last_angular_velocity

The last angular velocity from the IMU, for prediction.

◆ last_imu_timestamp_ns

uint64_t wmr_hmd::last_imu_timestamp_ns

When did we get the last IMU sample, in CPU time.

◆ mutex

struct os_mutex wmr_hmd::mutex

Protects all members of the fusion substruct.

◆ offset

struct xrt_pose wmr_hmd::offset

Additional offset to apply to pose

◆ oth

struct os_thread_helper wmr_hmd::oth

Packet reading thread.

◆ pose

struct xrt_pose wmr_hmd::pose

Last tracked pose.

◆ proximity_sensor

uint8_t wmr_hmd::proximity_sensor

Latest proximity sensor value read from the device.

◆ raw_ipd

uint16_t wmr_hmd::raw_ipd

Latest raw IPD value read from the device.

◆ slam

struct xrt_tracked_slam* wmr_hmd::slam

SLAM tracker.

Todo:
Right now, we are not consistent in how we interface with trackers. In particular, we have a xrt_tracked_slam field but not an equivalent for hand tracking.

◆ slam_calib

struct t_slam_calibration wmr_hmd::slam_calib

Calibration data for SLAM.

Referenced by wmr_hmd_fill_slam_cams_calibration().

◆ slam_enabled

bool wmr_hmd::slam_enabled

Set at start. Whether the SLAM tracker was initialized.

◆ slam_over_3dof

bool wmr_hmd::slam_over_3dof

Whether to track the HMD with 6dof SLAM or fallback to the fusion 3dof tracker.

◆ source

struct xrt_fs* wmr_hmd::source

Source of video/IMU data for tracking.

◆ tracked_offset_ms

struct u_var_draggable_f32 wmr_hmd::tracked_offset_ms

Offset for tracked pose offsets (applies to both fusion and SLAM).

Applied when getting the tracked poses, so is effectively a offset to increase or decrease prediction.

◆ 

struct { ... } wmr_hmd::tracking

Fields related to camera-based tracking (SLAM and hand tracking)

Referenced by wmr_hmd_fill_slam_cams_calibration().

◆ xfctx

struct xrt_frame_context wmr_hmd::xfctx

The documentation for this struct was generated from the following file: