Monado OpenXR Runtime
Loading...
Searching...
No Matches
correspondence_search.h File Reference

Ab-initio blob<->LED correspondence search. More...

#include "tracking/t_constellation.h"
#include "pose_metrics.h"
#include "camera_model.h"
Include dependency graph for correspondence_search.h:

Go to the source code of this file.

Data Structures

struct  cs_image_point
 
struct  cs_model_info
 
struct  correspondence_search
 

Macros

#define MAX_BLOB_SEARCH_DEPTH   5
 
#define ANCHOR_LED_MAX_DISTANCE_M_SQ   (0.025 * 0.025)
 Lambdatwist can sometimes have spurious failures, the anchor LED must be within 2.5mm to be accepted.
 

Enumerations

enum  correspondence_search_flags {
  CS_FLAG_NONE = 0x0 , CS_FLAG_SHALLOW_SEARCH = 0x1 , CS_FLAG_DEEP_SEARCH = 0x2 , CS_FLAG_STOP_FOR_STRONG_MATCH = 0x4 ,
  CS_FLAG_MATCH_ALL_BLOBS = 0x8 , CS_FLAG_HAVE_POSE_PRIOR = 0x10 , CS_FLAG_MATCH_GRAVITY = 0x20
}
 

Functions

struct correspondence_search * correspondence_search_new (const enum u_logging_level *ct_log_level, struct camera_model *camera_calib)
 
void correspondence_search_free (struct correspondence_search *cs)
 
void correspondence_search_set_blobs (struct correspondence_search *cs, struct t_blob *blobs, int num_blobs)
 
bool correspondence_search_find_one_pose (struct correspondence_search *cs, const struct t_constellation_search_model *model, enum correspondence_search_flags search_flags, struct xrt_pose *inout_pose, const struct xrt_vec3 *pos_error_thresh, const struct xrt_vec3 *rot_error_thresh, const struct xrt_vec3 *gravity_vector, float gravity_tolerance_rad, struct pose_metrics *out_score)
 Does a brute-force search for a device's pose.
 

Detailed Description

Ab-initio blob<->LED correspondence search.

Author
Jan Schmidt jan@c.nosp@m.entr.nosp@m.icula.nosp@m.r.co.nosp@m.m
Beyley Cardellio ep1cm.nosp@m.1n10.nosp@m.n123@.nosp@m.gmai.nosp@m.l.com

Macro Definition Documentation

◆ ANCHOR_LED_MAX_DISTANCE_M_SQ

#define ANCHOR_LED_MAX_DISTANCE_M_SQ   (0.025 * 0.025)

Lambdatwist can sometimes have spurious failures, the anchor LED must be within 2.5mm to be accepted.

Enumeration Type Documentation

◆ correspondence_search_flags

Enumerator
CS_FLAG_SHALLOW_SEARCH 

Do quick search @ depth 1-2 neighbour depth.

CS_FLAG_DEEP_SEARCH 

do deeper searches @ up to MAX_LED_SEARCH_DEPTH/MAX_BLOB_SEARCH_DEPTH

CS_FLAG_STOP_FOR_STRONG_MATCH 

Stop searching if a strong match is found, otherwise search all and return best match.

CS_FLAG_MATCH_ALL_BLOBS 

Allow matching against all blobs, not just unlabelled ones or for the current device.

CS_FLAG_HAVE_POSE_PRIOR 

If the input obj_cam_pose contains a valid prior.

CS_FLAG_MATCH_GRAVITY 

Use the provided gravity vector to check pose verticality. Depends on CS_FLAG_HAVE_POSE_PRIOR.

Function Documentation

◆ correspondence_search_find_one_pose()

bool correspondence_search_find_one_pose ( struct correspondence_search *  cs,
const struct t_constellation_search_model *  model,
enum correspondence_search_flags  search_flags,
struct xrt_pose *  inout_pose,
const struct xrt_vec3 *  pos_error_thresh,
const struct xrt_vec3 *  rot_error_thresh,
const struct xrt_vec3 *  gravity_vector,
float  gravity_tolerance_rad,
struct pose_metrics *  out_score 
)

Does a brute-force search for a device's pose.

Note
The pose and score parameters are only written on success.

References CS_FLAG_DEEP_SEARCH, CS_FLAG_HAVE_POSE_PRIOR, CS_FLAG_MATCH_GRAVITY, CS_FLAG_SHALLOW_SEARCH, xrt_quat::math_quat_decompose_swing_twist(), os_monotonic_get_ns(), and POSE_MATCH_GOOD.