mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-29 01:48:31 +00:00
d/rs: Allow Realsense device to be created outside of normal target list
This commit is contained in:
parent
17acb376f9
commit
cc62600972
|
@ -47,6 +47,14 @@ rs_create_auto_prober(void);
|
|||
struct xrt_fs *
|
||||
rs_source_create(struct xrt_frame_context *xfctx, int device_idx);
|
||||
|
||||
/*!
|
||||
* Creates an xrt_device that exposes the onboard tracking of a Realsense device
|
||||
* (ie. probably a T265)
|
||||
* @return An xrt_device that you can call get_tracked_pose on with XRT_INPUT_GENERIC_TRACKER_POSE
|
||||
*/
|
||||
struct xrt_device *
|
||||
rs_create_tracked_device_internal_slam();
|
||||
|
||||
/*!
|
||||
* @dir drivers/realsense
|
||||
*
|
||||
|
|
|
@ -223,6 +223,33 @@ create_tracked_rs_device(struct xrt_prober *xp)
|
|||
return dev;
|
||||
}
|
||||
|
||||
|
||||
//! Basically just for T265
|
||||
struct xrt_device *
|
||||
rs_create_tracked_device_internal_slam()
|
||||
{
|
||||
rs2_error *e = NULL;
|
||||
struct rs_container rsc = {0};
|
||||
|
||||
rsc.context = DO(rs2_create_context, RS2_API_VERSION);
|
||||
rsc.device_list = DO(rs2_query_devices, rsc.context);
|
||||
rsc.device_count = DO(rs2_get_device_count, rsc.device_list);
|
||||
|
||||
|
||||
int ddev_idx = find_capable_device(RS_TRACKING_DEVICE_SLAM, rsc.device_list);
|
||||
|
||||
|
||||
|
||||
rs_container_cleanup(&rsc); // We got ddev_idx and hdev_idx, release realsense resources
|
||||
|
||||
struct xrt_device *dev = NULL;
|
||||
|
||||
dev = rs_ddev_create(ddev_idx);
|
||||
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
//! @public @memberof rs_prober
|
||||
static int
|
||||
rs_prober_autoprobe(struct xrt_auto_prober *xap,
|
||||
|
|
Loading…
Reference in a new issue