The open source OpenXR runtime
at prediction-2 92 lines 2.1 kB view raw
1// Copyright 2019-2021, Collabora, Ltd. 2// SPDX-License-Identifier: BSL-1.0 3/*! 4 * @file 5 * @brief Interface header for DepthAI camera. 6 * @author Moshi Turner <moshiturner@protonmail.com> 7 * @author Jakob Bornecrantz <jakob@collabora.com> 8 * @ingroup drv_depthai 9 */ 10 11#pragma once 12 13#include "xrt/xrt_frameserver.h" 14#include "xrt/xrt_device.h" 15#include "xrt/xrt_prober.h" 16 17#ifdef __cplusplus 18extern "C" { 19#endif 20 21#undef DEPTHAI_HAS_MULTICAM_SUPPORT 22 23 24struct t_stereo_camera_calibration; 25 26 27#define DEPTHAI_VID 0x03e7 28#define DEPTHAI_PID 0x2485 29// FWIW, when the device is actively running, it reboots with the PID 0xf63b. 30 31struct depthai_slam_startup_settings 32{ 33 bool want_cameras; 34 bool want_imu; 35 bool half_size_ov9282; 36 int frames_per_second; 37}; 38 39int 40depthai_3dof_device_found(struct xrt_prober *xp, 41 struct xrt_prober_device **devices, 42 size_t device_count, 43 size_t index, 44 cJSON *attached_data, 45 struct xrt_device **out_xdev); 46 47/*! 48 * @defgroup drv_depthai DepthAI frameserver driver 49 * @ingroup drv 50 * 51 * @brief Frameserver for the DepthAI camera module. 52 */ 53 54/*! 55 * Create a DepthAI frameserver using a single RGB camera. 56 * 57 * @ingroup drv_depthai 58 */ 59struct xrt_fs * 60depthai_fs_monocular_rgb(struct xrt_frame_context *xfctx); 61 62/*! 63 * Create a DepthAI frameserver using two gray cameras. 64 * Either OAK-D or OAK-D Lite. Custom FFC setups may or may not work. 65 * 66 * @ingroup drv_depthai 67 */ 68struct xrt_fs * 69depthai_fs_slam(struct xrt_frame_context *xfctx, struct depthai_slam_startup_settings *settings); 70 71#ifdef DEPTHAI_HAS_MULTICAM_SUPPORT 72/*! 73 * Create a DepthAI frameserver using two rgb cameras. 74 * 75 * @ingroup drv_depthai 76 */ 77struct xrt_fs * 78depthai_fs_stereo_rgb(struct xrt_frame_context *xfctx); 79#endif 80 81/*! 82 * Get the stereo calibration from a depthAI frameserver. 83 * 84 * @ingroup drv_depthai 85 */ 86bool 87depthai_fs_get_stereo_calibration(struct xrt_fs *xfs, struct t_stereo_camera_calibration **c_ptr); 88 89 90#ifdef __cplusplus 91} 92#endif