The open source OpenXR runtime
0
fork

Configure Feed

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

st/prober: Handle SLAM tracker creation failure for the Euroc player

This also adds a do-nothing section to `p_factory_create_tracked_slam`
that could be replicated by new SLAM frame servers.

+16 -4
+16 -4
src/xrt/state_trackers/prober/p_tracking.c
··· 344 344 345 345 struct xrt_tracked_slam *xts = NULL; 346 346 347 + #ifdef XRT_BUILD_DRIVER_EUROC 348 + if (debug_get_option_euroc_path() != NULL) { 349 + // The euroc slam tracker was already created on p_tracking_init because the 350 + // euroc player is not a device so it needs to be started from somewhere 351 + goto end; 352 + } 353 + #endif 354 + 355 + end: 356 + 347 357 if (!fact->started_xts) { 348 358 xts = fact->xts; 349 359 } ··· 394 404 395 405 #ifdef XRT_BUILD_DRIVER_EUROC 396 406 if (debug_get_option_euroc_path() != NULL) { 397 - struct xrt_slam_sinks *sinks = NULL; 407 + struct xrt_slam_sinks empty_sinks = {0}; 408 + struct xrt_slam_sinks *sinks = &empty_sinks; 398 409 399 410 // fact->xfs *will* be an euroc frame server after open, because of prober open_video_device 400 411 xrt_prober_open_video_device(&fact->p->base, NULL, &fact->xfctx, &fact->xfs); 401 412 402 413 #ifdef XRT_HAVE_SLAM 403 - t_slam_create(&fact->xfctx, &fact->xts, &sinks); 414 + int ret = t_slam_create(&fact->xfctx, &fact->xts, &sinks); 415 + if (ret != 0) { 416 + U_LOG_W("Unable to initialize SLAM tracking, the Euroc driver will not be tracked"); 417 + } 404 418 #else 405 419 U_LOG_W("SLAM tracking support is disabled, the Euroc driver will not be tracked"); 406 - struct xrt_slam_sinks empty_sinks = {0}; 407 - sinks = &empty_sinks; 408 420 #endif 409 421 410 422 xrt_fs_slam_stream_start(fact->xfs, sinks);