Monado OpenXR Runtime
wmr_controller_base Struct Reference

Common base for all WMR controllers. More...

#include <wmr/wmr_controller_base.h>

Inheritance diagram for wmr_controller_base:
Collaboration diagram for wmr_controller_base:

Data Fields

struct xrt_device base
 Base struct. More...
 
struct os_mutex conn_lock
 Mutex protects the controller connection. More...
 
struct wmr_controller_connectionwcc
 The connection for this controller. More...
 
void(* receive_bytes )(struct wmr_controller_base *wcb, uint64_t time_ns, uint8_t *buffer, uint32_t buf_size)
 Callback from the connection when a packet has been received. More...
 
enum u_logging_level log_level
 
struct os_mutex data_lock
 Mutex protects shared data used from OpenXR callbacks. More...
 
bool(* handle_input_packet )(struct wmr_controller_base *wcb, uint64_t time_ns, uint8_t *buffer, uint32_t buf_size)
 Callback to parse a controller update packet and update the input / imu info. Called with the. More...
 
struct wmr_controller_config config
 
uint64_t last_imu_timestamp_ns
 Time of last IMU sample, in CPU time. More...
 
struct m_imu_3dof fusion
 Main fusion calculator. More...
 
struct xrt_vec3 last_angular_velocity
 The last angular velocity from the IMU, for prediction. More...
 
- 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
 
void(* update_inputs )(struct xrt_device *xdev)
 Update any attached inputs. More...
 
void(* get_tracked_pose )(struct xrt_device *xdev, enum xrt_input_name name, uint64_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, uint64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, uint64_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, struct xrt_facial_expression_set *out_value)
 Get the requested blend shape properties & weights for a face 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, uint64_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...
 
void(* destroy )(struct xrt_device *xdev)
 Destroy device. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from xrt_device
static void xrt_device_update_inputs (struct xrt_device *xdev)
 Helper function for xrt_device::update_inputs. More...
 
static void xrt_device_get_tracked_pose (struct xrt_device *xdev, enum xrt_input_name name, uint64_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, uint64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, uint64_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, struct xrt_facial_expression_set *out_value)
 Helper function for xrt_device::get_face_tracking. 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, uint64_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 void xrt_device_destroy (struct xrt_device **xdev_ptr)
 Helper function for xrt_device::destroy. More...
 

Detailed Description

Common base for all WMR controllers.

Field Documentation

◆ base

struct xrt_device wmr_controller_base::base

Base struct.

◆ conn_lock

struct os_mutex wmr_controller_base::conn_lock

Mutex protects the controller connection.

◆ data_lock

struct os_mutex wmr_controller_base::data_lock

Mutex protects shared data used from OpenXR callbacks.

◆ fusion

struct m_imu_3dof wmr_controller_base::fusion

Main fusion calculator.

◆ handle_input_packet

bool(* wmr_controller_base::handle_input_packet) (struct wmr_controller_base *wcb, uint64_t time_ns, uint8_t *buffer, uint32_t buf_size)

Callback to parse a controller update packet and update the input / imu info. Called with the.

◆ last_angular_velocity

struct xrt_vec3 wmr_controller_base::last_angular_velocity

The last angular velocity from the IMU, for prediction.

◆ last_imu_timestamp_ns

uint64_t wmr_controller_base::last_imu_timestamp_ns

Time of last IMU sample, in CPU time.

◆ receive_bytes

void(* wmr_controller_base::receive_bytes) (struct wmr_controller_base *wcb, uint64_t time_ns, uint8_t *buffer, uint32_t buf_size)

Callback from the connection when a packet has been received.

◆ wcc

struct wmr_controller_connection* wmr_controller_base::wcc

The connection for this controller.


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