The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/vive: Add a slider to adjust all tracked pose timestamps

+19 -1
+11
src/xrt/drivers/vive/vive_device.c
··· 178 178 XRT_TRACE_MARKER(); 179 179 180 180 struct vive_device *d = vive_device(xdev); 181 + 182 + // Ajdust the timestamp with the offset. 183 + at_timestamp_ns += (uint64_t)(d->tracked_offset_ms.val * (double)U_TIME_1MS_IN_NS); 184 + 181 185 if (d->tracking.slam_enabled && d->slam_over_3dof) { 182 186 vive_device_get_slam_tracked_pose(xdev, name, at_timestamp_ns, out_relation); 183 187 } else { ··· 829 833 } 830 834 u_var_add_pose(d, &d->pose, "Tracked Pose"); 831 835 u_var_add_pose(d, &d->offset, "Pose Offset"); 836 + u_var_add_draggable_f32(d, &d->tracked_offset_ms, "Timecode offset(ms)"); 832 837 833 838 u_var_add_gui_header(d, NULL, "3DoF Tracking"); 834 839 m_imu_3dof_add_vars(&d->fusion.i3dof, d, ""); ··· 956 961 d->sensors_dev = sensors_dev; 957 962 d->log_level = debug_get_log_option_vive_log(); 958 963 d->watchman_dev = watchman_dev; 964 + d->tracked_offset_ms = (struct u_var_draggable_f32){ 965 + .val = 0.0, 966 + .min = -40.0, 967 + .step = 0.1, 968 + .max = +120.0, 969 + }; 959 970 960 971 d->base.hmd->distortion.models = XRT_DISTORTION_MODEL_COMPUTE; 961 972 d->base.hmd->distortion.preferred = XRT_DISTORTION_MODEL_COMPUTE;
+8 -1
src/xrt/drivers/vive/vive_device.h
··· 1 - // Copyright 2019, Collabora, Ltd. 1 + // Copyright 2019-2023, Collabora, Ltd. 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 /*! 4 4 * @file ··· 98 98 //! SLAM systems track the IMU pose, enabling this corrects it to middle of the eyes 99 99 bool imu2me; 100 100 } tracking; 101 + 102 + /*! 103 + * Offset for tracked pose offsets (applies to both fusion and SLAM). 104 + * Applied when getting the tracked poses, so is effectivily a offset 105 + * to increase or decrease prediction. 106 + */ 107 + struct u_var_draggable_f32 tracked_offset_ms; 101 108 102 109 struct xrt_pose P_imu_me; //!< IMU to head/display/middle-of-eyes transform in OpenXR coords 103 110