Monado OpenXR Runtime
simulated_interface.h
Go to the documentation of this file.
1// Copyright 2020-2023, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Interface to simulated driver.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @ingroup drv_simulated
8 */
9
10#pragma once
11
12#include "xrt/xrt_compiler.h"
13#include "util/u_logging.h"
14
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20
21/*!
22 * @defgroup drv_simulated Simulated driver
23 * @ingroup drv
24 *
25 * @brief Simple do-nothing simulated driver.
26 */
27
28/*!
29 * @dir drivers/simulated
30 *
31 * @brief @ref drv_simulated files.
32 */
33
34/*!
35 * What type of movement should the simulated device do.
36 *
37 * @ingroup drv_simulated
38 */
40{
41 SIMULATED_MOVEMENT_WOBBLE,
42 SIMULATED_MOVEMENT_ROTATE,
43 SIMULATED_MOVEMENT_STATIONARY,
44};
45
46/*!
47 * Return the logging level that we want for the simulated related code.
48 *
49 * @ingroup drv_simulated
50 */
53
54/*!
55 * Create a auto prober for simulated devices.
56 *
57 * @ingroup drv_simulated
58 */
59struct xrt_auto_prober *
61
62/*!
63 * Create a simulated hmd.
64 *
65 * @ingroup drv_simulated
66 */
67struct xrt_device *
68simulated_hmd_create(enum simulated_movement movement, const struct xrt_pose *center);
69
70/*!
71 * Create a simulated controller.
72 *
73 * Supported configs:
74 *
75 * * XRT_DEVICE_SIMPLE_CONTROLLER
76 * * XRT_DEVICE_TYPE_ANY_CONTROLLER
77 * * XRT_DEVICE_WMR_CONTROLLER
78 * * XRT_DEVICE_TYPE_LEFT_CONTROLLER
79 * * XRT_DEVICE_TYPE_RIGHT_CONTROLLER
80 * * XRT_DEVICE_ML2_CONTROLLER
81 * * XRT_DEVICE_TYPE_ANY_CONTROLLER
82 *
83 * @ingroup drv_simulated
84 */
85struct xrt_device *
87 enum xrt_device_type type,
88 const struct xrt_pose *center,
89 struct xrt_tracking_origin *origin);
90
91
92#ifdef __cplusplus
93}
94#endif
u_logging_level
Logging level enum.
Definition: u_logging.h:43
struct xrt_device * simulated_hmd_create(enum simulated_movement movement, const struct xrt_pose *center)
Create a simulated hmd.
Definition: simulated_hmd.c:191
enum u_logging_level simulated_log_level(void)
Return the logging level that we want for the simulated related code.
Definition: simulated_hmd.c:185
struct xrt_auto_prober * simulated_create_auto_prober(void)
Create a auto prober for simulated devices.
Definition: simulated_prober.c:76
simulated_movement
What type of movement should the simulated device do.
Definition: simulated_interface.h:40
struct xrt_device * simulated_create_controller(enum xrt_device_name name, enum xrt_device_type type, const struct xrt_pose *center, struct xrt_tracking_origin *origin)
Create a simulated controller.
Definition: simulated_controller.c:329
xrt_device_type
How an xrt_device can be used.
Definition: xrt_defines.h:786
An interface to be exposed by a device driver that should probe for the existence of its own device o...
Definition: xrt_prober.h:761
A single HMD or input device.
Definition: xrt_device.h:241
enum xrt_device_name name
Enum identifier of the device.
Definition: xrt_device.h:243
A pose composed of a position and orientation.
Definition: xrt_defines.h:465
A tracking system or device origin.
Definition: xrt_tracking.h:71
Basic logging functionality.
Header holding common defines.
xrt_device_name
A enum that is used to name devices so that the state trackers can reason about the devices easier.
Definition: xrt_defines.h:712