diff --git a/src/xrt/state_trackers/prober/p_prober.c b/src/xrt/state_trackers/prober/p_prober.c index dc86d621f..5adb904c9 100644 --- a/src/xrt/state_trackers/prober/p_prober.c +++ b/src/xrt/state_trackers/prober/p_prober.c @@ -25,6 +25,10 @@ #include "vf/vf_interface.h" #endif +#ifdef XRT_BUILD_DRIVER_EUROC +#include "euroc/euroc_interface.h" +#endif + #ifdef XRT_BUILD_DRIVER_REMOTE #include "remote/r_interface.h" #endif @@ -939,6 +943,7 @@ open_hid_interface(struct xrt_prober *xp, } DEBUG_GET_ONCE_OPTION(vf_path, "VF_PATH", NULL) +DEBUG_GET_ONCE_OPTION(euroc_path, "EUROC_PATH", NULL) static int open_video_device(struct xrt_prober *xp, @@ -948,6 +953,15 @@ open_video_device(struct xrt_prober *xp, { XRT_MAYBE_UNUSED struct prober_device *pdev = (struct prober_device *)xpdev; +#if defined(XRT_BUILD_DRIVER_EUROC) + // TODO: If both VF_PATH and EUROC_PATH are set, VF will be ignored on calibration + const char *euroc_path = debug_get_option_euroc_path(); + if (euroc_path != NULL) { + *out_xfs = euroc_player_create(xfctx, euroc_path); // Euroc will exit if it can't be created + return 0; + } +#endif + #if defined(XRT_BUILD_DRIVER_VF) const char *path = debug_get_option_vf_path(); if (path != NULL) { @@ -987,6 +1001,11 @@ list_video_devices(struct xrt_prober *xp, xrt_prober_list_video_cb cb, void *ptr cb(xp, NULL, "Video File", "Collabora", path, ptr); } + path = debug_get_option_euroc_path(); + if (path != NULL) { + cb(xp, NULL, "Euroc Dataset", "Collabora", path, ptr); + } + // Loop over all devices and find video devices. for (size_t i = 0; i < p->num_devices; i++) { struct prober_device *pdev = &p->devices[i]; diff --git a/src/xrt/state_trackers/prober/p_tracking.c b/src/xrt/state_trackers/prober/p_tracking.c index 6287f0254..a96799c63 100644 --- a/src/xrt/state_trackers/prober/p_tracking.c +++ b/src/xrt/state_trackers/prober/p_tracking.c @@ -26,6 +26,10 @@ #include #include +#ifdef XRT_BUILD_DRIVER_EUROC +#include "util/u_debug.h" +DEBUG_GET_ONCE_OPTION(euroc_path, "EUROC_PATH", NULL) +#endif /* * @@ -353,6 +357,13 @@ p_tracking_init(struct prober *p) // Finally set us as the tracking factory. p->base.tracking = &fact->base; +#ifdef XRT_BUILD_DRIVER_EUROC + if (debug_get_option_euroc_path() != NULL) { + xrt_prober_open_video_device(&fact->p->base, NULL, &fact->xfctx, &fact->xfs); + xrt_fs_stream_start(fact->xfs, NULL, XRT_FS_CAPTURE_TYPE_TRACKING, 0); + } +#endif + return 0; }