The open source OpenXR runtime
at main 73 lines 1.7 kB view raw
1// Copyright 2020, Collabora, Ltd. 2// SPDX-License-Identifier: BSL-1.0 3/*! 4 * @file 5 * @brief Interface to RealSense devices. 6 * @author Jakob Bornecrantz <jakob@collabora.com> 7 * @ingroup drv_realsense 8 */ 9 10#pragma once 11 12#ifdef __cplusplus 13extern "C" { 14#endif 15 16struct xrt_frame_context; 17 18/*! 19 * @defgroup drv_realsense Intel RealSense driver 20 * @ingroup drv 21 * 22 * @brief Driver for the SLAM-capable Intel Realsense devices. 23 */ 24 25#define REALSENSE_MOVIDIUS_VID 0x03E7 26#define REALSENSE_MOVIDIUS_PID 0x2150 27 28#define REALSENSE_TM2_VID 0x8087 29#define REALSENSE_TM2_PID 0x0B37 30 31#define RS_TRACKING_DISABLED -1 32#define RS_TRACKING_UNSPECIFIED 0 33#define RS_TRACKING_DEVICE_SLAM 1 34#define RS_TRACKING_HOST_SLAM 2 35 36/*! 37 * Create a auto prober for rs devices. 38 * 39 * @ingroup drv_realsense 40 */ 41struct xrt_auto_prober * 42rs_create_auto_prober(void); 43 44/*! 45 * Creates a RealSense SLAM source from the appropriate @p device_idx. 46 * The streaming configuration is loaded from the global config file. 47 * 48 * @param xfctx Frame context this frameserver lifetime is tied to. 49 * @param device_idx Index of the realsense device to use. Usually 0 if you only 50 * have one RealSense device. 51 * @return Frameserver with SLAM streaming capabilities. 52 */ 53struct xrt_fs * 54rs_source_create(struct xrt_frame_context *xfctx, int device_idx); 55 56/*! 57 * Creates an xrt_device that exposes the onboard tracking of a Realsense device 58 * (ie. probably a T265) 59 * @return An xrt_device that you can call get_tracked_pose on with XRT_INPUT_GENERIC_TRACKER_POSE 60 */ 61struct xrt_device * 62rs_create_tracked_device_internal_slam(void); 63 64/*! 65 * @dir drivers/realsense 66 * 67 * @brief @ref drv_realsense files. 68 */ 69 70 71#ifdef __cplusplus 72} 73#endif