From ea6d6bfb3f1f38fdd5449f48adf90c7b142f4c62 Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Mon, 8 Feb 2021 22:44:13 +0100 Subject: [PATCH] d/rs: Use XRT_INPUT_GENERIC_TRACKER_POSE instead of XRT_INPUT_GENERIC_HEAD_POSE --- src/xrt/drivers/north_star/ns_hmd.c | 12 ++++++------ src/xrt/drivers/realsense/rs_6dof.c | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/xrt/drivers/north_star/ns_hmd.c b/src/xrt/drivers/north_star/ns_hmd.c index a3c080367..c67c43e7d 100644 --- a/src/xrt/drivers/north_star/ns_hmd.c +++ b/src/xrt/drivers/north_star/ns_hmd.c @@ -86,15 +86,15 @@ ns_hmd_get_tracked_pose(struct xrt_device *xdev, { struct ns_hmd *ns = ns_hmd(xdev); - - // If the tracking device is created use it. - if (ns->tracker != NULL) { - xrt_device_get_tracked_pose(ns->tracker, name, at_timestamp_ns, out_relation); + if (name != XRT_INPUT_GENERIC_HEAD_POSE) { + NS_ERROR(ns, "unknown input name"); return; } - if (name != XRT_INPUT_GENERIC_HEAD_POSE) { - NS_ERROR(ns, "unknown input name"); + // If the tracking device is created use it. + if (ns->tracker != NULL) { + enum xrt_input_name tracker_name = XRT_INPUT_GENERIC_TRACKER_POSE; + xrt_device_get_tracked_pose(ns->tracker, tracker_name, at_timestamp_ns, out_relation); return; } diff --git a/src/xrt/drivers/realsense/rs_6dof.c b/src/xrt/drivers/realsense/rs_6dof.c index 67d5265fe..3ab9e1dbe 100644 --- a/src/xrt/drivers/realsense/rs_6dof.c +++ b/src/xrt/drivers/realsense/rs_6dof.c @@ -324,7 +324,7 @@ rs_6dof_get_tracked_pose(struct xrt_device *xdev, { struct rs_6dof *rs = rs_6dof(xdev); - if (name != XRT_INPUT_GENERIC_HEAD_POSE) { + if (name != XRT_INPUT_GENERIC_TRACKER_POSE) { U_LOG_E("unknown input name"); return; } @@ -386,8 +386,7 @@ rs_6dof_create(void) // Print name. snprintf(rs->base.str, XRT_DEVICE_NAME_LEN, "Intel RealSense 6-DOF"); - // Setup input, this is a lie. - rs->base.inputs[0].name = XRT_INPUT_GENERIC_HEAD_POSE; + rs->base.inputs[0].name = XRT_INPUT_GENERIC_TRACKER_POSE; // Thread and other state. ret = os_thread_helper_init(&rs->oth);