202 lines
7.0 KiB
Diff
202 lines
7.0 KiB
Diff
From a0c03b2f602311a8c4299e250ecb64be9528194b Mon Sep 17 00:00:00 2001
|
|
From: rcelyte <rcelyte@battletrains.org>
|
|
Date: Fri, 23 Aug 2024 20:54:53 +0000
|
|
Subject: [PATCH] t/common: Load SolarXR driver
|
|
|
|
---
|
|
src/xrt/drivers/qwerty/qwerty_device.c | 4 ++++
|
|
.../targets/common/target_builder_lighthouse.c | 14 ++++++++++++++
|
|
src/xrt/targets/common/target_builder_qwerty.c | 14 ++++++++++++++
|
|
src/xrt/targets/common/target_builder_rift_s.c | 15 +++++++++++++++
|
|
src/xrt/targets/common/target_builder_steamvr.c | 15 +++++++++++++++
|
|
src/xrt/targets/common/target_builder_wmr.c | 14 ++++++++++++++
|
|
6 files changed, 76 insertions(+)
|
|
|
|
diff --git a/src/xrt/drivers/qwerty/qwerty_device.c b/src/xrt/drivers/qwerty/qwerty_device.c
|
|
index b390af901..fc60c869c 100644
|
|
--- a/src/xrt/drivers/qwerty/qwerty_device.c
|
|
+++ b/src/xrt/drivers/qwerty/qwerty_device.c
|
|
@@ -317,6 +317,8 @@ qwerty_hmd_create(void)
|
|
|
|
xd->inputs[0].name = XRT_INPUT_GENERIC_HEAD_POSE;
|
|
|
|
+ xd->supported.orientation_tracking = true;
|
|
+ xd->supported.position_tracking = true;
|
|
xd->update_inputs = u_device_noop_update_inputs;
|
|
xd->get_tracked_pose = qwerty_get_tracked_pose;
|
|
xd->get_view_poses = u_device_get_view_poses;
|
|
@@ -369,6 +371,8 @@ qwerty_controller_create(bool is_left, struct qwerty_hmd *qhmd)
|
|
xd->binding_profiles = binding_profiles;
|
|
xd->binding_profile_count = ARRAY_SIZE(binding_profiles);
|
|
|
|
+ xd->supported.orientation_tracking = true;
|
|
+ xd->supported.position_tracking = true;
|
|
xd->update_inputs = qwerty_update_inputs;
|
|
xd->get_tracked_pose = qwerty_get_tracked_pose;
|
|
xd->set_output = qwerty_set_output;
|
|
diff --git a/src/xrt/targets/common/target_builder_lighthouse.c b/src/xrt/targets/common/target_builder_lighthouse.c
|
|
index 78fe52ab4..da68c0b4a 100644
|
|
--- a/src/xrt/targets/common/target_builder_lighthouse.c
|
|
+++ b/src/xrt/targets/common/target_builder_lighthouse.c
|
|
@@ -58,6 +58,10 @@
|
|
#include "opengloves/opengloves_interface.h"
|
|
#endif
|
|
|
|
+#ifdef XRT_BUILD_DRIVER_SOLARXR
|
|
+#include "solarxr/solarxr_interface.h"
|
|
+#endif
|
|
+
|
|
#if defined(XRT_BUILD_DRIVER_SURVIVE)
|
|
#define DEFAULT_DRIVER "survive"
|
|
#else
|
|
@@ -740,6 +744,16 @@ end_valve_index:
|
|
try_add_opengloves(left, right, &unobstructed_left_ht, &unobstructed_right_ht);
|
|
}
|
|
|
|
+#ifdef XRT_BUILD_DRIVER_SOLARXR
|
|
+ const uint32_t count = solarxr_device_create_xdevs(head->tracking_origin, &xsysd->xdevs[xsysd->xdev_count],
|
|
+ ARRAY_SIZE(xsysd->xdevs) - xsysd->xdev_count);
|
|
+ if (count != 0) {
|
|
+ xsysd->static_roles.body = xsysd->xdevs[xsysd->xdev_count];
|
|
+ solarxr_device_set_feeder_devices(xsysd->static_roles.body, xsysd->xdevs, xsysd->xdev_count);
|
|
+ }
|
|
+ xsysd->xdev_count += count;
|
|
+#endif
|
|
+
|
|
// Assign to role(s).
|
|
ubrh->head = head;
|
|
ubrh->left = left;
|
|
diff --git a/src/xrt/targets/common/target_builder_qwerty.c b/src/xrt/targets/common/target_builder_qwerty.c
|
|
index 2c66ad303..76444147e 100644
|
|
--- a/src/xrt/targets/common/target_builder_qwerty.c
|
|
+++ b/src/xrt/targets/common/target_builder_qwerty.c
|
|
@@ -18,6 +18,10 @@
|
|
|
|
#include "qwerty/qwerty_interface.h"
|
|
|
|
+#ifdef XRT_BUILD_DRIVER_SOLARXR
|
|
+#include "solarxr/solarxr_interface.h"
|
|
+#endif
|
|
+
|
|
#include <assert.h>
|
|
|
|
|
|
@@ -100,6 +104,16 @@ qwerty_open_system_impl(struct xrt_builder *xb,
|
|
ubrh->left = left;
|
|
ubrh->right = right;
|
|
|
|
+#ifdef XRT_BUILD_DRIVER_SOLARXR
|
|
+ const uint32_t count = solarxr_device_create_xdevs(head->tracking_origin, &xsysd->xdevs[xsysd->xdev_count],
|
|
+ ARRAY_SIZE(xsysd->xdevs) - xsysd->xdev_count);
|
|
+ if (count != 0) {
|
|
+ xsysd->static_roles.body = xsysd->xdevs[xsysd->xdev_count];
|
|
+ solarxr_device_set_feeder_devices(xsysd->static_roles.body, xsysd->xdevs, xsysd->xdev_count);
|
|
+ }
|
|
+ xsysd->xdev_count += count;
|
|
+#endif
|
|
+
|
|
return XRT_SUCCESS;
|
|
}
|
|
|
|
diff --git a/src/xrt/targets/common/target_builder_rift_s.c b/src/xrt/targets/common/target_builder_rift_s.c
|
|
index fb284d77b..f48eebe35 100644
|
|
--- a/src/xrt/targets/common/target_builder_rift_s.c
|
|
+++ b/src/xrt/targets/common/target_builder_rift_s.c
|
|
@@ -28,6 +28,10 @@
|
|
#include "ht_ctrl_emu/ht_ctrl_emu_interface.h"
|
|
#endif
|
|
|
|
+#ifdef XRT_BUILD_DRIVER_SOLARXR
|
|
+#include "solarxr/solarxr_interface.h"
|
|
+#endif
|
|
+
|
|
#include "rift_s/rift_s_interface.h"
|
|
#include "rift_s/rift_s.h"
|
|
|
|
@@ -200,6 +204,17 @@ rift_s_open_system_impl(struct xrt_builder *xb,
|
|
}
|
|
#endif
|
|
|
|
+#ifdef XRT_BUILD_DRIVER_SOLARXR
|
|
+ const uint32_t count =
|
|
+ solarxr_device_create_xdevs((hmd_xdev != NULL) ? hmd_xdev->tracking_origin : NULL,
|
|
+ &xsysd->xdevs[xsysd->xdev_count], ARRAY_SIZE(xsysd->xdevs) - xsysd->xdev_count);
|
|
+ if (count != 0) {
|
|
+ xsysd->static_roles.body = xsysd->xdevs[xsysd->xdev_count];
|
|
+ solarxr_device_set_feeder_devices(xsysd->static_roles.body, xsysd->xdevs, xsysd->xdev_count);
|
|
+ }
|
|
+ xsysd->xdev_count += count;
|
|
+#endif
|
|
+
|
|
// Assign to role(s).
|
|
ubrh->head = hmd_xdev;
|
|
ubrh->left = left_xdev;
|
|
diff --git a/src/xrt/targets/common/target_builder_steamvr.c b/src/xrt/targets/common/target_builder_steamvr.c
|
|
index a603eeaf5..171ad0d9a 100644
|
|
--- a/src/xrt/targets/common/target_builder_steamvr.c
|
|
+++ b/src/xrt/targets/common/target_builder_steamvr.c
|
|
@@ -34,6 +34,10 @@
|
|
#include "xrt/xrt_space.h"
|
|
#include "util/u_space_overseer.h"
|
|
|
|
+#ifdef XRT_BUILD_DRIVER_SOLARXR
|
|
+#include "solarxr/solarxr_interface.h"
|
|
+#endif
|
|
+
|
|
#ifndef XRT_BUILD_DRIVER_STEAMVR_LIGHTHOUSE
|
|
#error "This builder requires the SteamVR Lighthouse driver"
|
|
#endif
|
|
@@ -166,6 +170,17 @@ steamvr_open_system(struct xrt_builder *xb,
|
|
SET_HT_ROLES(conforming)
|
|
#undef SET_HT_ROLES
|
|
|
|
+#ifdef XRT_BUILD_DRIVER_SOLARXR
|
|
+ const uint32_t count =
|
|
+ solarxr_device_create_xdevs(xsysd->static_roles.head->tracking_origin, &xsysd->xdevs[xsysd->xdev_count],
|
|
+ ARRAY_SIZE(xsysd->xdevs) - xsysd->xdev_count);
|
|
+ if (count != 0) {
|
|
+ xsysd->static_roles.body = xsysd->xdevs[xsysd->xdev_count];
|
|
+ solarxr_device_set_feeder_devices(xsysd->static_roles.body, xsysd->xdevs, xsysd->xdev_count);
|
|
+ }
|
|
+ xsysd->xdev_count += count;
|
|
+#endif
|
|
+
|
|
/*
|
|
* Space overseer.
|
|
*/
|
|
diff --git a/src/xrt/targets/common/target_builder_wmr.c b/src/xrt/targets/common/target_builder_wmr.c
|
|
index 57c3bfd7e..c0564c2a8 100644
|
|
--- a/src/xrt/targets/common/target_builder_wmr.c
|
|
+++ b/src/xrt/targets/common/target_builder_wmr.c
|
|
@@ -26,6 +26,10 @@
|
|
|
|
#include <assert.h>
|
|
|
|
+#ifdef XRT_BUILD_DRIVER_SOLARXR
|
|
+#include "solarxr/solarxr_interface.h"
|
|
+#endif
|
|
+
|
|
#ifndef XRT_BUILD_DRIVER_WMR
|
|
#error "Must only be built with XRT_BUILD_DRIVER_WMR set"
|
|
#endif
|
|
@@ -296,6 +300,16 @@ wmr_open_system_impl(struct xrt_builder *xb,
|
|
right = ht_right;
|
|
}
|
|
|
|
+#ifdef XRT_BUILD_DRIVER_SOLARXR
|
|
+ const uint32_t count = solarxr_device_create_xdevs(head->tracking_origin, &xsysd->xdevs[xsysd->xdev_count],
|
|
+ ARRAY_SIZE(xsysd->xdevs) - xsysd->xdev_count);
|
|
+ if (count != 0) {
|
|
+ xsysd->static_roles.body = xsysd->xdevs[xsysd->xdev_count];
|
|
+ solarxr_device_set_feeder_devices(xsysd->static_roles.body, xsysd->xdevs, xsysd->xdev_count);
|
|
+ }
|
|
+ xsysd->xdev_count += count;
|
|
+#endif
|
|
+
|
|
|
|
// Assign to role(s).
|
|
ubrh->head = head;
|
|
--
|
|
2.50.1
|
|
|