Monado OpenXR Runtime
Loading...
Searching...
No Matches
t_constellation_tracker.cpp File Reference

Implementation of the main logic for the constellation tracker. More...

#include "xrt/xrt_config_build.h"
#include "xrt/xrt_defines.h"
#include "util/u_time.h"
#include "math/m_predict.h"
#include "constellation/correspondence_search.h"
#include "t_constellation_tracker_internal.hpp"
#include "t_constellation_tracker_dataset.hpp"
#include <atomic>
#include <algorithm>
#include <limits>
#include <string>
#include <cstring>
Include dependency graph for t_constellation_tracker.cpp:

Functions

static void xrt::tracking::constellation::get_pose_gravity_vector (xrt_pose &T_world_pose, xrt_vec3 &gravity)
 Gets the gravity vector of a pose, in the pose's local frame.
 
static uint32_t xrt::tracking::constellation::num_blobs_for_device (CameraSample &sample, t_constellation_device_id_t device_id)
 
static float xrt::tracking::constellation::device_state_camera_distance_sqrd (const DeviceState *device_state)
 Sort key used to search for the devices closest to the camera first, since a near device covers more of the image and is the one most likely to explain the blobs.
 
static uint32_t xrt::tracking::constellation::collect_devices_nearest_first (ConstellationTracker *tracker, CameraSample &sample, std::array< Device *, XRT_CONSTELLATION_MAX_DEVICES > &out_devices)
 Collects the tracker's devices into out_devices, ordered nearest-camera-first for sample.
 
void * xrt::tracking::constellation::run_room_calibration_func (void *ptr)
 
void * constellation_tracker_camera_slow_thread (void *ptr)
 
void * constellation_tracker_camera_fast_thread (void *ptr)
 
void constellation_tracker_camera_push_blobs (t_blob_sink *tbs, t_blob_observation *tbo)
 
void constellation_tracker_camera_destroy (t_blob_sink *tbs)
 
void constellation_tracker_node_break_apart (xrt_frame_node *node)
 
void constellation_tracker_node_destroy (xrt_frame_node *node)
 
int t_constellation_tracker_create (xrt_frame_context *xfctx, t_constellation_tracker_params *params, t_constellation_tracker **out_tracker)
 
int t_constellation_tracker_add_device (t_constellation_tracker *raw_tracker, t_constellation_tracker_device_params *params, t_constellation_tracker_device *device, t_constellation_device_id_t *out_device_id)
 
int t_constellation_tracker_remove_device (t_constellation_tracker *raw_tracker, t_constellation_device_id_t device)
 
xrt_tracking_origin * t_constellation_tracker_get_tracking_origin (t_constellation_tracker *raw_tracker)
 
int t_constellation_tracker_get_tracked_pose (struct t_constellation_tracker *raw_tracker, t_constellation_device_id_t device, timepoint_ns when_ns, struct xrt_space_relation *out_relation)
 

Detailed Description

Implementation of the main logic for the constellation tracker.

Author
Beyley Cardellio ep1cm.nosp@m.1n10.nosp@m.n123@.nosp@m.gmai.nosp@m.l.com

Function Documentation

◆ collect_devices_nearest_first()

static uint32_t xrt::tracking::constellation::collect_devices_nearest_first ( ConstellationTracker *  tracker,
CameraSample &  sample,
std::array< Device *, XRT_CONSTELLATION_MAX_DEVICES > &  out_devices 
)
static

Collects the tracker's devices into out_devices, ordered nearest-camera-first for sample.

The caller must hold ConstellationTracker::device_lock for as long as it uses the result, since these are borrowed pointers into ConstellationTracker::devices.

References xrt::tracking::constellation::collect_devices_nearest_first().

Referenced by xrt::tracking::constellation::collect_devices_nearest_first(), and xrt::tracking::constellation::Camera::processSampleFast().

◆ device_state_camera_distance_sqrd()

static float xrt::tracking::constellation::device_state_camera_distance_sqrd ( const DeviceState *  device_state)
static

Sort key used to search for the devices closest to the camera first, since a near device covers more of the image and is the one most likely to explain the blobs.

Devices we have no prediction for sort last.

Note
The prediction is stored on the sample, so this is usable from the slow thread as well, where the fast thread's predictions are no longer being recomputed.

References xrt::tracking::constellation::device_state_camera_distance_sqrd(), and xrt::tracking::constellation::DeviceState::Tcv_cam_device_predicted.

Referenced by xrt::tracking::constellation::device_state_camera_distance_sqrd().

◆ get_pose_gravity_vector()

static void xrt::tracking::constellation::get_pose_gravity_vector ( xrt_pose &  T_world_pose,
xrt_vec3 &  gravity 
)
static

Gets the gravity vector of a pose, in the pose's local frame.

References xrt::tracking::constellation::get_pose_gravity_vector().

Referenced by xrt::tracking::constellation::get_pose_gravity_vector().