Monado OpenXR Runtime
target_builder_lighthouse.c File Reference

Builder for Lighthouse-tracked devices (vive, index, tundra trackers, etc.) More...

#include "tracking/t_hand_tracking.h"
#include "tracking/t_tracking.h"
#include "xrt/xrt_config_drivers.h"
#include "xrt/xrt_device.h"
#include "xrt/xrt_prober.h"
#include "util/u_builders.h"
#include "util/u_config_json.h"
#include "util/u_debug.h"
#include "util/u_device.h"
#include "util/u_sink.h"
#include "util/u_system_helpers.h"
#include "target_builder_interface.h"
#include "vive/vive_common.h"
#include "vive/vive_config.h"
#include "vive/vive_calibration.h"
#include "vive/vive_builder.h"
#include "vive/vive_device.h"
#include "vive/vive_source.h"
#include "v4l2/v4l2_interface.h"
#include "xrt/xrt_frameserver.h"
#include "xrt/xrt_results.h"
#include "xrt/xrt_tracking.h"
#include <assert.h>
Include dependency graph for target_builder_lighthouse.c:

Data Structures

struct  lighthouse_system
 

Macros

#define DEFAULT_DRIVER   "vive"
 
#define LH_TRACE(...)   U_LOG_IFL_T(debug_get_log_option_lh_log(), __VA_ARGS__)
 
#define LH_DEBUG(...)   U_LOG_IFL_D(debug_get_log_option_lh_log(), __VA_ARGS__)
 
#define LH_INFO(...)   U_LOG_IFL_I(debug_get_log_option_lh_log(), __VA_ARGS__)
 
#define LH_WARN(...)   U_LOG_IFL_W(debug_get_log_option_lh_log(), __VA_ARGS__)
 
#define LH_ERROR(...)   U_LOG_IFL_E(debug_get_log_option_lh_log(), __VA_ARGS__)
 
#define LH_ASSERT(predicate, ...)
 
#define LH_ASSERT_(predicate)   LH_ASSERT(predicate, "Assertion failed " #predicate)
 

Enumerations

enum  lighthouse_driver { DRIVER_VIVE , DRIVER_SURVIVE , DRIVER_STEAMVR }
 

Functions

static uint32_t get_selected_mode (struct xrt_fs *xfs)
 
static void on_video_device (struct xrt_prober *xp, struct xrt_prober_device *pdev, const char *product, const char *manufacturer, const char *serial, void *ptr)
 
static struct xrt_slam_sinksvalve_index_slam_track (struct vive_device *vive_head, struct xrt_frame_context *xfctx, struct t_slam_calibration *slam_calib)
 
static bool valve_index_hand_track (struct lighthouse_system *lhs, struct xrt_device *head, struct xrt_frame_context *xfctx, struct xrt_pose head_in_left_cam, struct t_stereo_camera_calibration *stereo_calib, struct xrt_hand_masks_sink *masks_sink, struct xrt_slam_sinks **out_sinks, struct xrt_device **out_devices)
 
static xrt_result_t lighthouse_estimate_system (struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_builder_estimate *estimate)
 
static bool valve_index_setup_visual_trackers (struct lighthouse_system *lhs, struct xrt_device *head, struct vive_device *vive_head, struct xrt_frame_context *xfctx, struct xrt_prober *xp, struct xrt_slam_sinks *out_sinks, struct xrt_device **out_devices)
 
static bool stream_data_sources (struct lighthouse_system *lhs, struct vive_device *vive_head, struct xrt_prober *xp, struct xrt_slam_sinks sinks)
 
static void try_add_opengloves (struct xrt_device *left, struct xrt_device *right, struct xrt_device **out_left_ht, struct xrt_device **out_right_ht)
 
static xrt_result_t lighthouse_open_system_impl (struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_tracking_origin *origin, struct xrt_system_devices *xsysd, struct xrt_frame_context *xfctx, struct u_builder_roles_helper *ubrh)
 
static void lighthouse_destroy (struct xrt_builder *xb)
 
struct xrt_buildert_builder_lighthouse_create (void)
 Builder for Lighthouse-tracked devices (vive, index, tundra trackers, etc.) More...
 

Variables

static const char * driver_list []
 

Detailed Description

Builder for Lighthouse-tracked devices (vive, index, tundra trackers, etc.)

Author
Moses Turner moses.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Macro Definition Documentation

◆ LH_ASSERT

#define LH_ASSERT (   predicate,
  ... 
)
Value:
do { \
bool p = predicate; \
if (!p) { \
U_LOG(U_LOGGING_ERROR, __VA_ARGS__); \
assert(false && "LH_ASSERT failed: " #predicate); \
exit(EXIT_FAILURE); \
} \
} while (false);
@ U_LOGGING_ERROR
Error messages: indicating a problem.
Definition: u_logging.h:45

Function Documentation

◆ t_builder_lighthouse_create()

struct xrt_builder * t_builder_lighthouse_create ( void  )

Builder for Lighthouse-tracked devices (vive, index, tundra trackers, etc.)

References u_builder::base, xrt_builder::estimate_system, and U_TYPED_CALLOC.

◆ valve_index_setup_visual_trackers()

static bool valve_index_setup_visual_trackers ( struct lighthouse_system lhs,
struct xrt_device head,
struct vive_device vive_head,
struct xrt_frame_context xfctx,
struct xrt_prober xp,
struct xrt_slam_sinks out_sinks,
struct xrt_device **  out_devices 
)
static

Variable Documentation

◆ driver_list

const char* driver_list[]
static
Initial value:
= {
}