From a5fc2fa49e983382ddc5d7c8a0d291a1857671a8 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sat, 9 Oct 2021 22:33:31 +0100 Subject: [PATCH] d/dai: Expose function to get stereo calibration --- src/xrt/drivers/depthai/depthai_driver.cpp | 8 ++++++++ src/xrt/drivers/depthai/depthai_interface.h | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/xrt/drivers/depthai/depthai_driver.cpp b/src/xrt/drivers/depthai/depthai_driver.cpp index 0a2ed25fb..f201b0df5 100644 --- a/src/xrt/drivers/depthai/depthai_driver.cpp +++ b/src/xrt/drivers/depthai/depthai_driver.cpp @@ -664,3 +664,11 @@ depthai_fs_stereo_gray(struct xrt_frame_context *xfctx) return &depthai->base; } + +extern "C" void +depthai_fs_get_stereo_calibration(struct xrt_fs *xfs, struct t_stereo_camera_calibration **c_ptr) +{ + struct depthai_fs *depthai = depthai_fs(xfs); + + depthai_get_gray_cameras_calibration(depthai, c_ptr); +} diff --git a/src/xrt/drivers/depthai/depthai_interface.h b/src/xrt/drivers/depthai/depthai_interface.h index 511300e41..8cb5fc905 100644 --- a/src/xrt/drivers/depthai/depthai_interface.h +++ b/src/xrt/drivers/depthai/depthai_interface.h @@ -17,6 +17,9 @@ extern "C" { #endif +struct t_stereo_camera_calibration; + + /*! * @defgroup drv_depthai DepthAI frameserver driver * @ingroup drv @@ -40,6 +43,14 @@ depthai_fs_single_rgb(struct xrt_frame_context *xfctx); struct xrt_fs * depthai_fs_stereo_gray(struct xrt_frame_context *xfctx); +/*! + * Get the stereo calibration from a depthAI frameserver. + * + * @ingroup drv_depthai + */ +void +depthai_fs_get_stereo_calibration(struct xrt_fs *xfs, struct t_stereo_camera_calibration **c_ptr); + #ifdef __cplusplus }