diff --git a/server/driver/pose_list.cpp b/server/driver/pose_list.cpp index a091c261..b3dd7326 100644 --- a/server/driver/pose_list.cpp +++ b/server/driver/pose_list.cpp @@ -260,13 +260,19 @@ std::pair pose_list::get_at(XrTime at_timestamp_ns) if (orientation.y) { - flags(XRT_SPACE_RELATION_ORIENTATION_VALID_BIT | XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT); + if (auto norm2 = orientation.y->squaredNorm(); + norm2 > 0.9 and norm2 < 1.1) + { + flags(XRT_SPACE_RELATION_ORIENTATION_VALID_BIT | XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT); - ret.pose.orientation = { - .x = (*orientation.y)[1], - .y = (*orientation.y)[2], - .z = (*orientation.y)[3], - .w = (*orientation.y)[0]}; + orientation.y->normalize(); + + ret.pose.orientation = { + .x = (*orientation.y)[1], + .y = (*orientation.y)[2], + .z = (*orientation.y)[3], + .w = (*orientation.y)[0]}; + } if (orientation.dy) {