From 604815cb51ad7ad6e20ff8971b0ed310b7538deb Mon Sep 17 00:00:00 2001 From: Mateo de Mayo Date: Thu, 2 Jun 2022 11:25:40 -0300 Subject: [PATCH] d/wmr: Fix pose correction from Basalt There was a confusion about whether this was needed for some apps. It was. --- src/xrt/drivers/wmr/wmr_hmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xrt/drivers/wmr/wmr_hmd.c b/src/xrt/drivers/wmr/wmr_hmd.c index 2252cc8bb..a1594404b 100644 --- a/src/xrt/drivers/wmr/wmr_hmd.c +++ b/src/xrt/drivers/wmr/wmr_hmd.c @@ -969,6 +969,10 @@ wmr_hmd_get_3dof_tracked_pose(struct xrt_device *xdev, XRT_MAYBE_UNUSED static inline struct xrt_pose wmr_hmd_correct_pose_from_basalt(struct xrt_pose pose) { + struct xrt_quat q = {0.70710678, 0, 0, 0.70710678}; + math_quat_rotate(&q, &pose.orientation, &pose.orientation); + math_quat_rotate_vec3(&q, &pose.position, &pose.position); + // Correct swapped axes pose.position.y = -pose.position.y; pose.position.z = -pose.position.z;