diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-20 12:09:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 12:09:06 +0100 |
commit | 7057d26343a8d8b7e743be48cd9207272ce6a8c6 (patch) | |
tree | ffb19ddbe954538e05f45cfac96846d061a83d98 /modules | |
parent | 6073e4cd569ddf1f4bea3f5c7d5f86ebeaacf03b (diff) | |
parent | 173105596e428cd4cd043a158c10b71f612f9783 (diff) |
Merge pull request #56936 from BastiaanOlij/add_tracking_confidence
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mobile_vr/mobile_vr_interface.cpp | 4 | ||||
-rw-r--r-- | modules/mobile_vr/mobile_vr_interface.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/modules/mobile_vr/mobile_vr_interface.cpp b/modules/mobile_vr/mobile_vr_interface.cpp index 59854ad527..49044c4afe 100644 --- a/modules/mobile_vr/mobile_vr_interface.cpp +++ b/modules/mobile_vr/mobile_vr_interface.cpp @@ -181,6 +181,7 @@ void MobileVRInterface::set_position_from_sensors() { orientation = rotate * orientation; tracking_state = XRInterface::XR_NORMAL_TRACKING; + tracking_confidence = XRPose::XR_TRACKING_CONFIDENCE_HIGH; }; ///@TODO improve this, the magnetometer is very fidgety sometimes flipping the axis for no apparent reason (probably a bug on my part) @@ -193,6 +194,7 @@ void MobileVRInterface::set_position_from_sensors() { orientation = Basis(transform_quat); tracking_state = XRInterface::XR_NORMAL_TRACKING; + tracking_confidence = XRPose::XR_TRACKING_CONFIDENCE_HIGH; } else if (has_grav) { // use gravity vector to make sure down is down... // transform gravity into our world space @@ -512,7 +514,7 @@ void MobileVRInterface::process() { if (head.is_valid()) { // Set our head position, note in real space, reference frame and world scale is applied later - head->set_pose("default", head_transform, Vector3(), Vector3()); + head->set_pose("default", head_transform, Vector3(), Vector3(), tracking_confidence); } }; }; diff --git a/modules/mobile_vr/mobile_vr_interface.h b/modules/mobile_vr/mobile_vr_interface.h index ac04763569..47dc33c0c7 100644 --- a/modules/mobile_vr/mobile_vr_interface.h +++ b/modules/mobile_vr/mobile_vr_interface.h @@ -51,6 +51,7 @@ class MobileVRInterface : public XRInterface { private: bool initialized = false; XRInterface::TrackingStatus tracking_state; + XRPose::TrackingConfidence tracking_confidence = XRPose::XR_TRACKING_CONFIDENCE_NONE; // Just set some defaults for these. At some point we need to look at adding a lookup table for common device + headset combos and/or support reading cardboard QR codes double eye_height = 1.85; |