|
Monado OpenXR Runtime
|
A routine to automatically refine latency offsets of LED blink times using constellation samples. More...
#include "util/u_time.h"#include "util/u_logging.h"#include "os/os_threading.h"#include "tracking/t_tracking.h"#include "tracking/t_time_sync.h"#include "tracking/t_constellation.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_pssense_data |
| struct | t_led_sync_sample |
| A sample read out from the driver, to pass to the device in question. More... | |
| struct | t_led_sync_seen_led |
| struct | t_led_sync_frame |
| One camera's view of the selected LEDs in one frame, brightness is the blob's greysum, 0 if it wasn't seen. More... | |
| struct | t_led_sync_period_estimate |
| Frame period measured over a long run of frames, so it's steady enough to base the LED cycle on. More... | |
| struct | t_led_sync_delta_sync |
| Clock sync from BROAD on: the LED cycle, the clock model kept on it, and BG's offset servo and skew fit. More... | |
| struct | t_led_sync_refinement |
Macros | |
| #define | T_LED_SYNC_DEFAULT_RESYNC_TIME (time_duration_ns)(U_TIME_1S_IN_NS * 5LL) |
| 5 seconds after last visually seen sample to resync | |
| #define | T_LED_SYNC_SELECTED_LEDS 2 |
| #define | T_LED_SYNC_SEEN_LEDS_ACCUMULATION_BUFFER_SIZE 5 |
| How many elements are in the seen LEDs ring buffer. | |
| #define | T_LED_SYNC_GRAY_CODE_SIZE_BITS 11 |
| The amount of bits in the full gray code we're decoding. | |
| #define | T_LED_SYNC_BRIGHTNESS_CURVE_NUM_SAMPLES 20 |
| 20 frames per sample | |
| #define | T_LED_SYNC_SEEN_LED_BUFFER_INDEX(sequence_id) ((sequence_id) % T_LED_SYNC_SEEN_LEDS_ACCUMULATION_BUFFER_SIZE) |
| #define | T_LED_SYNC_GRAY_CODE_BUFFER_INDEX(camera_index, sequence_id, led_idx) |
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_push_host_device_clock_offset (struct t_led_sync_refinement *refinement, time_duration_ns clock_offset_ns) |
| Pushes a clock offset to the refinement routine, this is the offset from the host to the device. | |
A routine to automatically refine latency offsets of LED blink times using constellation samples.
| #define T_LED_SYNC_BRIGHTNESS_CURVE_NUM_SAMPLES 20 |
20 frames per sample
| #define T_LED_SYNC_DEFAULT_RESYNC_TIME (time_duration_ns)(U_TIME_1S_IN_NS * 5LL) |
5 seconds after last visually seen sample to resync
| #define T_LED_SYNC_GRAY_CODE_BUFFER_INDEX | ( | camera_index, | |
| sequence_id, | |||
| led_idx | |||
| ) |
| #define T_LED_SYNC_GRAY_CODE_SIZE_BITS 11 |
The amount of bits in the full gray code we're decoding.
| #define T_LED_SYNC_SEEN_LEDS_ACCUMULATION_BUFFER_SIZE 5 |
How many elements are in the seen LEDs ring buffer.
| enum t_led_sync_phase |
Flags to control the behavior of the LED sync refinement routine.
| void t_led_sync_push_host_device_clock_offset | ( | struct t_led_sync_refinement * | refinement, |
| time_duration_ns | clock_offset_ns | ||
| ) |
Pushes a clock offset to the refinement routine, this is the offset from the host to the device.
To convert a timestamp from host -> device domain, you would do: device_timestamp = host_timestamp + clock_offset_ns
References t_led_sync_refinement::driver_host_device_clock_offset_ns, and t_led_sync_refinement::initialized.