diff --git a/src/xrt/drivers/rift_s/rift_s_tracker.c b/src/xrt/drivers/rift_s/rift_s_tracker.c index 51d504b9b..7b9fcd735 100644 --- a/src/xrt/drivers/rift_s/rift_s_tracker.c +++ b/src/xrt/drivers/rift_s/rift_s_tracker.c @@ -232,6 +232,7 @@ rift_s_create_slam_tracker(struct rift_s_tracker *t, struct xrt_frame_context *x static int rift_s_create_hand_tracker(struct rift_s_tracker *t, struct xrt_frame_context *xfctx, + struct xrt_hand_masks_sink *masks_sink, struct xrt_slam_sinks **out_sinks, struct xrt_device **out_device) { @@ -252,8 +253,7 @@ rift_s_create_hand_tracker(struct rift_s_tracker *t, extra_camera_info.views[0].camera_orientation = CAMERA_ORIENTATION_90; extra_camera_info.views[1].camera_orientation = CAMERA_ORIENTATION_90; - // TODO@mateosss: Use proper masks_sink in all drivers and not null - struct t_hand_tracking_create_info create_info = {.cams_info = extra_camera_info, .masks_sink = NULL}; + struct t_hand_tracking_create_info create_info = {.cams_info = extra_camera_info, .masks_sink = masks_sink}; int create_status = ht_device_create(xfctx, // t->stereo_calib, // @@ -404,8 +404,9 @@ rift_s_tracker_create(struct xrt_tracking_origin *origin, // Initialize hand tracker struct xrt_slam_sinks *hand_sinks = NULL; struct xrt_device *hand_device = NULL; + struct xrt_hand_masks_sink *masks_sink = slam_sinks->hand_masks; if (t->tracking.hand_enabled) { - int hand_status = rift_s_create_hand_tracker(t, xfctx, &hand_sinks, &hand_device); + int hand_status = rift_s_create_hand_tracker(t, xfctx, masks_sink, &hand_sinks, &hand_device); if (hand_status != 0 || hand_sinks == NULL || hand_device == NULL) { RIFT_S_WARN("Unable to setup the hand tracker"); rift_s_tracker_destroy(t); diff --git a/src/xrt/targets/common/target_builder_lighthouse.c b/src/xrt/targets/common/target_builder_lighthouse.c index fb522230d..8b456675a 100644 --- a/src/xrt/targets/common/target_builder_lighthouse.c +++ b/src/xrt/targets/common/target_builder_lighthouse.c @@ -201,6 +201,7 @@ valve_index_hand_track(struct lighthouse_system *lhs, struct xrt_frame_context *xfctx, struct xrt_pose head_in_left_cam, struct t_stereo_camera_calibration *stereo_calib, + struct xrt_hand_masks_sink *masks_sink, struct xrt_slam_sinks **out_sinks, struct xrt_device **out_devices) { @@ -233,7 +234,7 @@ valve_index_hand_track(struct lighthouse_system *lhs, info.views[0].boundary.circle.normalized_radius = 0.55; info.views[1].boundary.circle.normalized_radius = 0.55; - struct t_hand_tracking_create_info create_info = {.cams_info = info, .masks_sink = NULL}; + struct t_hand_tracking_create_info create_info = {.cams_info = info, .masks_sink = masks_sink}; struct xrt_device *ht_device = NULL; int create_status = ht_device_create( // @@ -384,6 +385,7 @@ valve_index_setup_visual_trackers(struct lighthouse_system *lhs, // Initialize hand tracker struct xrt_slam_sinks *hand_sinks = NULL; struct xrt_device *hand_devices[2] = {NULL}; + struct xrt_hand_masks_sink *masks_sink = slam_sinks->hand_masks; if (hand_enabled) { bool success = valve_index_hand_track( // lhs, // @@ -391,6 +393,7 @@ valve_index_setup_visual_trackers(struct lighthouse_system *lhs, xfctx, // head_in_left_cam, // stereo_calib, // + masks_sink, // &hand_sinks, // hand_devices); // if (!success) { diff --git a/src/xrt/targets/common/target_builder_north_star.c b/src/xrt/targets/common/target_builder_north_star.c index 7ea4c4aa4..b4addeff3 100644 --- a/src/xrt/targets/common/target_builder_north_star.c +++ b/src/xrt/targets/common/target_builder_north_star.c @@ -295,8 +295,20 @@ ns_setup_depthai_device(struct ns_builder *nsb, depthai_fs_get_stereo_calibration(the_fs, &calib); + struct xrt_slam_sinks *slam_sinks = NULL; + xret = twrap_slam_create_device(xfctx, XRT_DEVICE_DEPTHAI, &slam_sinks, out_head_device); + if (xret != XRT_SUCCESS) { + U_LOG_E("twrap_slam_create_device: %u", xret); + return xret; + } + if (slam_sinks == NULL) { + U_LOG_E("twrap_slam_create_device: Returned NULL slam_sinks!"); + return XRT_ERROR_DEVICE_CREATION_FAILED; + } + #ifdef XRT_BUILD_DRIVER_HANDTRACKING struct xrt_slam_sinks *hand_sinks = NULL; + struct xrt_hand_masks_sink *masks_sink = slam_sinks->hand_masks; struct t_camera_extra_info extra_camera_info = {0}; @@ -311,7 +323,7 @@ ns_setup_depthai_device(struct ns_builder *nsb, extra_camera_info.views[0].boundary_type = HT_IMAGE_BOUNDARY_NONE; extra_camera_info.views[1].boundary_type = HT_IMAGE_BOUNDARY_NONE; - struct t_hand_tracking_create_info create_info = {.cams_info = extra_camera_info, .masks_sink = NULL}; + struct t_hand_tracking_create_info create_info = {.cams_info = extra_camera_info, .masks_sink = masks_sink}; int create_status = ht_device_create( // xfctx, // @@ -325,17 +337,6 @@ ns_setup_depthai_device(struct ns_builder *nsb, } #endif - struct xrt_slam_sinks *slam_sinks = NULL; - xret = twrap_slam_create_device(xfctx, XRT_DEVICE_DEPTHAI, &slam_sinks, out_head_device); - if (xret != XRT_SUCCESS) { - U_LOG_E("twrap_slam_create_device: %u", xret); - return xret; - } - if (slam_sinks == NULL) { - U_LOG_E("twrap_slam_create_device: Returned NULL slam_sinks!"); - return XRT_ERROR_DEVICE_CREATION_FAILED; - } - struct xrt_slam_sinks entry_sinks = {0}; struct xrt_frame_sink *entry_left_sink = NULL; struct xrt_frame_sink *entry_right_sink = NULL;