Monado OpenXR Runtime
Data Fields
xrt_device Struct Reference

A single HMD or input device. More...

#include <xrt/xrt_device.h>

Collaboration diagram for xrt_device:
Collaboration graph
[legend]

Data Fields

enum xrt_device_name name
 Enum identifier of the device. More...
 
char str [XRT_DEVICE_NAME_LEN]
 A string describing the device. 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 num_inputs
 Number of inputs. More...
 
struct xrt_inputinputs
 Array of input structs. More...
 
size_t num_outputs
 Number of outputs. More...
 
struct xrt_outputoutputs
 Array of output structs. More...
 
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, uint64_t *out_relation_timestamp_ns, struct xrt_space_relation *out_relation)
 Get relationship of a tracked device to the device "base space". More...
 
void(* set_output )(struct xrt_device *xdev, enum xrt_output_name name, union xrt_output_value *value)
 Set a output value. More...
 
void(* get_view_pose )(struct xrt_device *xdev, struct xrt_vec3 *eye_relation, uint32_t view_index, struct xrt_pose *out_pose)
 Get the per view pose in relation to the view space. More...
 
void(* destroy )(struct xrt_device *xdev)
 Destroy device. More...
 

Detailed Description

A single HMD or input device.

Field Documentation

◆ destroy

void(* xrt_device::destroy) (struct xrt_device *xdev)

◆ get_tracked_pose

void(* xrt_device::get_tracked_pose) (struct xrt_device *xdev, enum xrt_input_name name, uint64_t at_timestamp_ns, uint64_t *out_relation_timestamp_ns, struct xrt_space_relation *out_relation)

Get relationship of a tracked device to the device "base space".

Right now the base space is assumed to be local space.

This is very very WIP and will need to be made a lot more advanced.

Parameters
[in]xdevThe device.
[in]nameSome devices may have multiple poses on them, select the one using this field. For HMDs use XRT_INPUT_GENERIC_HEAD_POSE.
[in]at_timestamp_nsIf the device can predict or has a history of positions, this is when the caller wants the pose to be from.
[out]out_relation_timestamp_nsTimestamp when this relation was captured.
[out]out_relationThe relation read from the device.
See also
xrt_input_name

◆ get_view_pose

void(* xrt_device::get_view_pose) (struct xrt_device *xdev, struct xrt_vec3 *eye_relation, uint32_t view_index, struct xrt_pose *out_pose)

Get the per view pose in relation to the view space.

Does not do any device level tracking, use get_tracked_pose for that.

Parameters
eye_relationThe interpupillary relation as a 3D position, most simple stereo devices would just want to set out_puse->position.[x|y|z] = ipd.[x|y|z] / 2.0f. Not to be confused with IPD that is absolute distance, this is a full 3D relation.
indexIndex of view.
out_poseOutput pose, see ipd argument, and in addition orientation most likely identity rotation.

◆ hmd

struct xrt_hmd_parts* xrt_device::hmd

Null if this device does not interface with the users head.

Referenced by hdk_device_create(), u_device_dump_config(), u_device_free(), u_device_setup_split_side_by_side(), vive_device_create(), and vive_init_defaults().

◆ inputs

struct xrt_input* xrt_device::inputs

Array of input structs.

Referenced by oxr_xdev_find_input().

◆ name

enum xrt_device_name xrt_device::name

Enum identifier of the device.

Referenced by arduino_device_create(), daydream_device_create(), and oxr_find_profile_for_device().

◆ num_inputs

size_t xrt_device::num_inputs

Number of inputs.

Referenced by oxr_xdev_find_input(), and u_device_allocate().

◆ num_outputs

size_t xrt_device::num_outputs

Number of outputs.

Referenced by oxr_xdev_find_output().

◆ outputs

struct xrt_output* xrt_device::outputs

Array of output structs.

Referenced by oxr_xdev_find_output().

◆ set_output

void(* xrt_device::set_output) (struct xrt_device *xdev, enum xrt_output_name name, union xrt_output_value *value)

Set a output value.

See also
xrt_output_name

◆ str

char xrt_device::str[XRT_DEVICE_NAME_LEN]

A string describing the device.

Referenced by oxr_system_get_properties().

◆ tracking_origin

struct xrt_tracking_origin* xrt_device::tracking_origin

Always set, pointing to the tracking system for this device.

Referenced by hydra_found(), and oxr_xdev_get_relation_at().

◆ update_inputs

void(* xrt_device::update_inputs) (struct xrt_device *xdev)

Update any attached inputs.

Parameters
[in]xdevThe device.
[in]timekeepingShared time synchronization struct.

Referenced by dummy_hmd_create(), gui_prober_update(), hdk_device_create(), ns_hmd_create(), oh_device_create(), oxr_xdev_update(), psvr_device_create(), rs_6dof_create(), and vive_device_create().


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