The open source OpenXR runtime
0
fork

Configure Feed

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

d/*: pose correction for VIT system

+20 -38
+1 -26
src/xrt/drivers/euroc/euroc_device.c
··· 17 17 #include "xrt/xrt_prober.h" 18 18 #include "xrt/xrt_tracking.h" 19 19 #include "xrt/xrt_config_have.h" 20 + #include "xrt/xrt_config_build.h" 20 21 21 22 #include "euroc_driver.h" 22 23 ··· 101 102 return (struct euroc_device *)xdev; 102 103 } 103 104 104 - //! Corrections specific for original euroc datasets and Kimera. 105 - //! If your datasets comes from a different camera you should probably 106 - //! use a different pose correction function. 107 - XRT_MAYBE_UNUSED static inline struct xrt_pose 108 - euroc_device_correct_pose_from_kimera(struct xrt_pose pose) 109 - { 110 - //! @todo Implement proper pose corrections for the original euroc datasets 111 - //! @todo Allow to use different pose corrections depending on the device used to record 112 - return pose; 113 - } 114 - 115 - //! Similar to `euroc_device_correct_pose_from_kimera` but for Basalt. 116 - XRT_MAYBE_UNUSED static inline struct xrt_pose 117 - euroc_device_correct_pose_from_basalt(struct xrt_pose pose) 118 - { 119 - //! @todo Implement proper pose corrections for the original euroc datasets 120 - //! @todo Allow to use different pose corrections depending on the device used to record 121 - return pose; 122 - } 123 - 124 105 static void 125 106 euroc_device_get_tracked_pose(struct xrt_device *xdev, 126 107 enum xrt_input_name name, ··· 136 117 int pose_bits = XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT | XRT_SPACE_RELATION_POSITION_TRACKED_BIT; 137 118 bool pose_tracked = out_relation->relation_flags & pose_bits; 138 119 if (pose_tracked) { 139 - #if defined(XRT_HAVE_KIMERA) 140 - ed->pose = euroc_device_correct_pose_from_kimera(out_relation->pose); 141 - #elif defined(XRT_HAVE_BASALT) 142 - ed->pose = euroc_device_correct_pose_from_basalt(out_relation->pose); 143 - #else 144 120 ed->pose = out_relation->pose; 145 - #endif 146 121 } 147 122 } 148 123
+4 -3
src/xrt/drivers/realsense/rs_hdev.c
··· 18 18 #include "xrt/xrt_frame.h" 19 19 #include "xrt/xrt_prober.h" 20 20 #include "xrt/xrt_config_have.h" 21 + #include "xrt/xrt_config_build.h" 21 22 22 23 #include "math/m_filter_fifo.h" 23 24 #include "math/m_space.h" ··· 288 289 bool pose_tracked = out_relation->relation_flags & pose_bits; 289 290 290 291 if (pose_tracked) { 291 - #if defined(XRT_HAVE_KIMERA) 292 - rh->pose = rs_hdev_correct_pose_from_kimera(out_relation->pose); 293 - #elif defined(XRT_HAVE_BASALT) 292 + #ifdef XRT_FEATURE_SLAM 293 + // !todo Correct pose depending on the VIT system in use, this should be done in the system itself. 294 + // For now, assume that we are using Basalt. 294 295 rh->pose = rs_hdev_correct_pose_from_basalt(out_relation->pose); 295 296 #else 296 297 rh->pose = out_relation->pose;
+4 -3
src/xrt/drivers/rift_s/rift_s_tracker.c
··· 36 36 #include "util/u_trace_marker.h" 37 37 #include "util/u_var.h" 38 38 39 + #include "xrt/xrt_config_build.h" 39 40 #include "xrt/xrt_config_drivers.h" 40 41 #include "xrt/xrt_device.h" 41 42 ··· 635 636 636 637 // Get the IMU pose from the SLAM tracker 637 638 xrt_tracked_slam_get_tracked_pose(t->tracking.slam, at_timestamp_ns, &imu_relation); 638 - 639 - #if defined(XRT_HAVE_BASALT) 639 + #ifdef XRT_FEATURE_SLAM 640 + // !todo Correct pose depending on the VIT system in use, this should be done in the system itself. 641 + // For now, assume that we are using Basalt. 640 642 rift_s_tracker_correct_pose_from_basalt(&imu_relation.pose); 641 643 #endif 642 - 643 644 imu_relation.relation_flags = (enum xrt_space_relation_flags)( 644 645 XRT_SPACE_RELATION_ORIENTATION_VALID_BIT | XRT_SPACE_RELATION_POSITION_VALID_BIT | 645 646 XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT | XRT_SPACE_RELATION_POSITION_TRACKED_BIT);
+3 -4
src/xrt/drivers/twrap/twrap_slam.c
··· 14 14 #include "xrt/xrt_frameserver.h" 15 15 #include "xrt/xrt_results.h" 16 16 #include "xrt/xrt_tracking.h" 17 + #include "xrt/xrt_config_have.h" 18 + #include "xrt/xrt_config_build.h" 17 19 18 20 #include "util/u_var.h" 19 21 #include "util/u_misc.h" ··· 171 173 snprintf(dx->base.serial, XRT_DEVICE_NAME_LEN, "Generic Inside-Out Head Tracker"); 172 174 173 175 #ifdef XRT_FEATURE_SLAM 174 - #ifdef XRT_HAVE_BASALT 176 + // !todo Correct pose depending on the VIT system in use, this should be done in the system itself. 175 177 // Arrived at mostly by trial and error; seeminly does a 90-degree rotation about the X axis. 176 178 dx->pre_rotate_x = (struct xrt_vec3){1.0f, 0.0f, 0.0f}; 177 179 dx->pre_rotate_z = (struct xrt_vec3){0.0f, 1.0f, 0.0f}; 178 180 dx->pre_rotate = true; 179 - #else 180 - #pragma message "World space conversion not implemented for this SLAM system" 181 - #endif 182 181 #endif 183 182 184 183 // note: we can't put this at the very end; we need u_tracked_imu_3dof, and that needs to be put on the debug
+5 -1
src/xrt/drivers/vive/vive_device.c
··· 34 34 #include "vive_protocol.h" 35 35 #include "vive_source.h" 36 36 #include "xrt/xrt_tracking.h" 37 + #include "xrt/xrt_config_have.h" 38 + #include "xrt/xrt_config_build.h" 37 39 38 40 // Used to scale the IMU range from config. 39 41 #define VIVE_IMU_RANGE_CONVERSION_VALUE (32768.0) ··· 156 158 bool pose_tracked = out_relation->relation_flags & pose_bits; 157 159 158 160 if (pose_tracked) { 159 - #if defined(XRT_HAVE_BASALT) 161 + #ifdef XRT_FEATURE_SLAM 162 + // !todo Correct pose depending on the VIT system in use, this should be done in the system itself. 163 + // For now, assume that we are using Basalt. 160 164 d->pose = vive_device_correct_pose_from_basalt(out_relation->pose); 161 165 #else 162 166 d->pose = out_relation->pose;
+3 -1
src/xrt/drivers/wmr/wmr_hmd.c
··· 1145 1145 bool pose_tracked = out_relation->relation_flags & pose_bits; 1146 1146 1147 1147 if (pose_tracked) { 1148 - #if defined(XRT_HAVE_BASALT) 1148 + #ifdef XRT_FEATURE_SLAM 1149 + // !todo Correct pose depending on the VIT system in use, this should be done in the system itself. 1150 + // For now, assume that we are using Basalt. 1149 1151 wh->pose = wmr_hmd_correct_pose_from_basalt(out_relation->pose); 1150 1152 #else 1151 1153 wh->pose = out_relation->pose;