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

A routine to automatically refine latency offsets of LED blink times using constellation samples. More...

Include dependency graph for t_led_sync_refinement.h:

Go to the source code of this file.

Data Structures

struct  t_led_sync_refinement_options
 Options for the LED sync refinement. More...
 
struct  t_led_sync_sample
 A sample read out from the driver, to pass to the device in question. More...
 
struct  t_led_sync_refinement
 

Macros

#define T_LED_SYNC_DEFAULT_RESYNC_TIME   (time_duration_ns)(U_TIME_1S_IN_NS * 5LL)
 10 seconds after last visually seen sample to resync
 

Enumerations

enum  t_led_sync_refinement_flags { T_LED_SYNC_REFINEMENT_FLAGS_NONE = 0 , T_LED_SYNC_REFINEMENT_FLAGS_BLINK_DURATION = 1 << 0 }
 Flags to control the behavior of the LED sync refinement routine. More...
 
enum  t_led_sync_phase {
  T_LED_SYNC_SEARCH_PHASE_INIT = 0 , T_LED_SYNC_SEARCH_PHASE_FIND_INITIAL_OFFSET = 1 , T_LED_SYNC_SEARCH_PHASE_FIND_RIGHT_EDGE = 2 , T_LED_SYNC_SEARCH_PHASE_FIND_LEFT_EDGE = 3 ,
  T_LED_SYNC_SEARCH_PHASE_REFINE_BLINK_DURATION = 4 , T_LED_SYNC_SEARCH_PHASE_MAINTAIN_OFFSET = 5
}
 

Functions

int t_led_sync_refinement_init (struct t_led_sync_refinement *refinement, const struct t_led_sync_refinement_options *options)
 
void t_led_sync_refinement_destroy (struct t_led_sync_refinement *refinement)
 
void t_led_sync_push_timing_event (struct t_led_sync_refinement *refinement, const struct t_timing_event_camera_exposure_start *event)
 
void t_led_sync_push_constellation_sample (struct t_led_sync_refinement *refinement, const struct t_constellation_tracker_sample *sample)
 
bool t_led_sync_get_sample (struct t_led_sync_refinement *refinement, struct t_led_sync_sample *out_sample)
 
void t_led_sync_mark_latest_sample_applied (struct t_led_sync_refinement *refinement, timepoint_ns apply_time_ns)
 
void t_led_sync_update_minimum_blink_time (struct t_led_sync_refinement *refinement, time_duration_ns new_minimum_ns)
 

Detailed Description

A routine to automatically refine latency offsets of LED blink times using constellation samples.

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

Macro Definition Documentation

◆ T_LED_SYNC_DEFAULT_RESYNC_TIME

#define T_LED_SYNC_DEFAULT_RESYNC_TIME   (time_duration_ns)(U_TIME_1S_IN_NS * 5LL)

10 seconds after last visually seen sample to resync

Enumeration Type Documentation

◆ t_led_sync_phase

Enumerator
T_LED_SYNC_SEARCH_PHASE_INIT 

The initial phase, where we haven't made any adjustments yet.

T_LED_SYNC_SEARCH_PHASE_FIND_INITIAL_OFFSET 

Trying to find some offset that gets us in sync at all.

T_LED_SYNC_SEARCH_PHASE_FIND_RIGHT_EDGE 

Trying to align the rising edge of the LED blinks with the falling edge of the camera exposure.

T_LED_SYNC_SEARCH_PHASE_FIND_LEFT_EDGE 

Trying to align the falling edge of the LED blinks with the rising edge of the camera exposure.

T_LED_SYNC_SEARCH_PHASE_REFINE_BLINK_DURATION 

We've found an offset, now we can optimize the blink duration to something that keeps it tracking.

T_LED_SYNC_SEARCH_PHASE_MAINTAIN_OFFSET 

We've found an offset and optimized the center of the LED blink to the center of the exposure.

◆ t_led_sync_refinement_flags

Flags to control the behavior of the LED sync refinement routine.

Enumerator
T_LED_SYNC_REFINEMENT_FLAGS_BLINK_DURATION 

Whether to try to optimize the blink duration after finding an offset, to lessen power usage.