Monado OpenXR Runtime
t_openvr_tracker.h
Go to the documentation of this file.
1// Copyright 2023, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief OpenVR tracking source.
6 * @author Mateo de Mayo <mateo.demayo@collabora.com>
7 * @ingroup aux_tracking
8 */
9
10#pragma once
11
12#include "xrt/xrt_tracking.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/// The type of device
20{
21 T_OPENVR_DEVICE_UNKNOWN = 0,
22 T_OPENVR_DEVICE_HMD,
23 T_OPENVR_DEVICE_LEFT_CONTROLLER,
24 T_OPENVR_DEVICE_RIGHT_CONTROLLER,
25 T_OPENVR_DEVICE_TRACKER,
26};
27
28struct openvr_tracker;
29
30/*!
31 * Creates an OpenVR tracker.
32 *
33 * This creates an OpenVR instance in a separate
34 * thread, and reports the tracking data of each device class `devs[i]` into the
35 * pose sink `sinks[i]` at a rate of `sample_frequency`.
36 *
37 * @param sample_frequency_hz Sample frequency of the tracking data in hertz
38 * @param devs Devices to report tracking data of
39 * @param sinks Where to stream the tracking data of each device in `devs` to
40 * @param sink_count Number of sinks/devices to track
41 * @return struct openvr_tracker* if successfully created, null otherwise.
42 */
43struct openvr_tracker *
44t_openvr_tracker_create(double sample_frequency_hz,
45 enum openvr_device *devs,
46 struct xrt_pose_sink **sinks,
47 int sink_count);
48
49void
50t_openvr_tracker_start(struct openvr_tracker *ovrt);
51
52void
53t_openvr_tracker_stop(struct openvr_tracker *ovrt);
54
55void
56t_openvr_tracker_destroy(struct openvr_tracker *ovrt);
57
58#ifdef __cplusplus
59}
60#endif
An object to send pairs of timestamps and poses to.
Definition: xrt_tracking.h:182
struct openvr_tracker * t_openvr_tracker_create(double sample_frequency_hz, enum openvr_device *devs, struct xrt_pose_sink **sinks, int sink_count)
Creates an OpenVR tracker.
Definition: t_openvr_tracker.cpp:155
openvr_device
The type of device.
Definition: t_openvr_tracker.h:20
Header defining the tracking system integration in Monado.