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

Metrics for constellation tracking poses. More...

Include dependency graph for pose_metrics.h:

Go to the source code of this file.

Data Structures

struct  pose_rect
 
struct  pose_metrics
 
struct  pose_metrics_visible_led_info
 
struct  pose_metrics_blob_match_info
 

Macros

#define MAX_OBJECT_LEDS   64
 
#define WORST_REPROJECTION_ERROR   10.0
 
#define CLOSEST_ACCEPTABLE_POSE_M   0.05
 Device origin poses closer than this are probably invalid solves.
 
#define FARTHEST_ACCEPTABLE_POSE_M   15.0
 Poses farther away than this are definitely invalid solves.
 
#define POSE_SET_FLAGS(score, f)   ((score)->match_flags |= (f))
 
#define POSE_CLEAR_FLAGS(score, f)   ((score)->match_flags &= ~(f))
 
#define POSE_HAS_FLAGS(score, f)   (((score)->match_flags & (f)) == (f))
 
#define POSE_CLEAR_VALID(score)   POSE_CLEAR_FLAGS(score, POSE_MATCH_GOOD | POSE_MATCH_STRONG)
 

Enumerations

enum  pose_match_flags {
  POSE_MATCH_GOOD = 1 << 0 , POSE_MATCH_STRONG = 1 << 1 , POSE_MATCH_POSITION = 1 << 2 , POSE_MATCH_ORIENT = 1 << 3 ,
  POSE_HAD_PRIOR = 1 << 4 , POSE_MATCH_LED_IDS = 1 << 5 , POSE_MATCH_DEGENERATE = 1 << 6
}
 

Functions

static XRT_MAYBE_UNUSED bool pose_rect_has_area (struct pose_rect *rect)
 
void pose_metrics_match_pose_to_blobs (const struct xrt_pose *pose, struct t_blob *blobs, int num_blobs, struct t_constellation_tracker_led_model *led_model, t_constellation_device_id_t device_id, struct camera_model *calib, struct pose_metrics_blob_match_info *match_info)
 
void pose_metrics_evaluate_pose (struct pose_metrics *score, const struct xrt_pose *pose, struct t_blob *blobs, int num_blobs, struct t_constellation_tracker_led_model *leds_model, t_constellation_device_id_t device_id, struct camera_model *calib, struct pose_rect *out_bounds)
 
void pose_metrics_evaluate_pose_with_prior (struct pose_metrics *score, const struct xrt_pose *pose, bool prior_must_match, const struct xrt_pose *pose_prior, const struct xrt_vec3 *pos_error_thresh, const struct xrt_vec3 *rot_error_thresh, struct t_blob *blobs, int num_blobs, struct t_constellation_tracker_led_model *led_model, t_constellation_device_id_t device_id, struct camera_model *calib, struct pose_rect *out_bounds)
 
bool pose_metrics_score_is_better_pose (struct pose_metrics *old_score, struct pose_metrics *new_score)
 Compares whether new_score is a better pose than old_score.
 

Detailed Description

Metrics for constellation tracking poses.

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

◆ CLOSEST_ACCEPTABLE_POSE_M

#define CLOSEST_ACCEPTABLE_POSE_M   0.05

Device origin poses closer than this are probably invalid solves.

◆ FARTHEST_ACCEPTABLE_POSE_M

#define FARTHEST_ACCEPTABLE_POSE_M   15.0

Poses farther away than this are definitely invalid solves.

Enumeration Type Documentation

◆ pose_match_flags

Enumerator
POSE_MATCH_GOOD 

A reasonable pose match - most LEDs matched to within a few pixels error.

POSE_MATCH_STRONG 

A strong pose match is a match with very low error.

POSE_MATCH_POSITION 

The position of the pose matched the prior well.

POSE_MATCH_ORIENT 

The orientation of the pose matched the prior well.

POSE_HAD_PRIOR 

If a pose prior was supplied when calculating the score, then rot/trans_error are set.

POSE_MATCH_LED_IDS 

The LED IDs on the blobs all matched the LEDs we thought (or were unassigned)

POSE_MATCH_DEGENERATE 

Set when the pose cannot explain the device entirely on it's own.

One case is when too few blobs matched for the reprojection error to say anything about the fit, a P3P solve or fewer. Such a solve reproduces its own points by construction, so its error is near zero whether or not the pose is right.

Another case this may be triggered is when the amount of blobs is too low for the LED model in question to be confident about a slow solve. See t_constellation_tracker_led_model_match_parameters.

Function Documentation

◆ pose_metrics_score_is_better_pose()

bool pose_metrics_score_is_better_pose ( struct pose_metrics *  old_score,
struct pose_metrics *  new_score 
)

Compares whether new_score is a better pose than old_score.

Parameters
old_scoreThe old score to compare against.
new_scoreThe new score to compare against the old score.
Returns
true if the new score is a better pose than the old score, false otherwise.

References pose_metrics::orient_error, POSE_HAD_PRIOR, POSE_MATCH_DEGENERATE, POSE_MATCH_GOOD, and POSE_MATCH_STRONG.