The open source OpenXR runtime
0
fork

Configure Feed

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

d/ht: Remove DepthAI hand tracking device

This was super crufty. Instead now you use a builder to create SLAM sinks with the DepthAI builder and plug them into a regular HT device

-111
-5
src/xrt/drivers/CMakeLists.txt
··· 262 262 hand_async 263 263 ) 264 264 265 - if(XRT_BUILD_DRIVER_DEPTHAI) 266 - target_sources(drv_ht PRIVATE ht/ht_prober.c) 267 - target_link_libraries(drv_ht PRIVATE drv_depthai) 268 - endif() 269 - 270 265 target_include_directories(drv_ht PRIVATE ${OpenCV_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR}) 271 266 list(APPEND ENABLED_DRIVERS ht) 272 267 endif()
-44
src/xrt/drivers/ht/ht_driver.c
··· 268 268 *out_device = &htd->base; 269 269 return 0; 270 270 } 271 - 272 - #ifdef XRT_BUILD_DRIVER_DEPTHAI 273 - struct xrt_device * 274 - ht_device_create_depthai_ov9282() 275 - { 276 - XRT_TRACE_MARKER(); 277 - 278 - struct xrt_frame_context xfctx = {0}; 279 - 280 - struct xrt_fs *xfs = depthai_fs_stereo_grayscale(&xfctx); 281 - 282 - if (xfs == NULL) { 283 - return NULL; 284 - } 285 - 286 - struct t_stereo_camera_calibration *calib = NULL; 287 - 288 - depthai_fs_get_stereo_calibration(xfs, &calib); 289 - 290 - assert(calib != NULL); 291 - 292 - struct t_hand_tracking_sync *sync; 293 - 294 - struct t_camera_extra_info info; 295 - info.views[0].boundary_type = HT_IMAGE_BOUNDARY_NONE; 296 - info.views[1].boundary_type = HT_IMAGE_BOUNDARY_NONE; 297 - 298 - sync = t_hand_tracking_sync_mercury_create(calib, info); 299 - 300 - struct ht_device *htd = ht_device_create_common(calib, true, &xfctx, sync); 301 - 302 - struct xrt_slam_sinks tmp; 303 - 304 - t_stereo_camera_calibration_reference(&calib, NULL); 305 - 306 - u_sink_force_genlock_create(&htd->xfctx, &htd->async->left, &htd->async->right, &tmp.left, &tmp.right); 307 - 308 - xrt_fs_slam_stream_start(xfs, &tmp); 309 - 310 - HT_DEBUG(htd, "Hand Tracker initialized!"); 311 - 312 - return &htd->base; 313 - } 314 - #endif
-57
src/xrt/drivers/ht/ht_prober.c
··· 1 - // Copyright 2021, Collabora, Ltd. 2 - // SPDX-License-Identifier: BSL-1.0 3 - /*! 4 - * @file 5 - * @brief Hack for making it easy to run our tracking with DepthAI cameras. 6 - * @author Moses Turner <moses@collabora.com> 7 - * @ingroup drv_ht 8 - */ 9 - 10 - #include "ht_interface.h" 11 - 12 - #include "util/u_debug.h" 13 - 14 - 15 - DEBUG_GET_ONCE_BOOL_OPTION(ht_use_depthai, "HT_USE_DEPTHAI", false) 16 - 17 - static void 18 - ht_prober_destroy(struct xrt_auto_prober *p) 19 - { 20 - free(p); 21 - } 22 - 23 - static int 24 - ht_prober_autoprobe(struct xrt_auto_prober *xap, 25 - cJSON *attached_data, 26 - bool no_hmds, 27 - struct xrt_prober *xp, 28 - struct xrt_device **out_xdevs) 29 - { 30 - if (!debug_get_bool_option_ht_use_depthai()) { 31 - return 0; 32 - } 33 - 34 - struct xrt_device *ht = ht_device_create_depthai_ov9282(); 35 - 36 - if (ht == NULL) { 37 - return 0; 38 - } 39 - 40 - int out_idx = 0; 41 - 42 - out_xdevs[out_idx++] = ht; 43 - return out_idx; 44 - } 45 - 46 - 47 - 48 - struct xrt_auto_prober * 49 - ht_create_auto_prober() 50 - { 51 - struct xrt_auto_prober *xap = U_TYPED_CALLOC(struct xrt_auto_prober); 52 - xap->name = "ht_depthai"; 53 - xap->destroy = ht_prober_destroy; 54 - xap->lelo_dallas_autoprobe = ht_prober_autoprobe; 55 - 56 - return xap; 57 - }
-5
src/xrt/targets/common/target_lists.c
··· 216 216 simulated_create_auto_prober, 217 217 #endif 218 218 219 - #ifdef XRT_BUILD_DRIVER_HANDTRACKING 220 - #ifdef XRT_BUILD_DRIVER_DEPTHAI 221 - ht_create_auto_prober, 222 - #endif 223 - #endif 224 219 NULL, // Terminate 225 220 }; 226 221