Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
capture_timing.h File Reference

Sensor observation times, aligned poses, and optional frame-arrival evidence. More...

#include <stdbool.h>
#include <stdint.h>
#include "usher_protocol.h"
Include dependency graph for capture_timing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  capture_observation
struct  capture_timing
 Shared observation evidence with optional LWIR request/frame-delivery timing. More...

Enumerations

enum  capture_time_kind {
  CAPTURE_TIME_UNKNOWN , CAPTURE_TIME_SENSOR_EXPOSURE , CAPTURE_TIME_CALIBRATED_EXPOSURE , CAPTURE_TIME_SHUTTER_WINDOW ,
  CAPTURE_TIME_FRAME_ARRIVAL , CAPTURE_TIME_AUDIO_WINDOW
}

Functions

static bool capture_observation_valid (const struct capture_observation *observation)
 Check that an observation supplies a usable time interval.
static bool capture_observation_exposure (const struct capture_observation *observation)
 Distinguish exposure evidence from other valid observation times.
static bool capture_observation_latency (struct capture_observation *observation, uint64_t arrival_us, uint64_t minimum_us, uint64_t maximum_us)
 Bound exposure time using calibrated frame delivery latency.
static const char * capture_time_name (enum capture_time_kind kind)
 Get the text label used when recording observation timing.
static bool capture_timing_valid (const struct capture_timing *timing)
 Check whether timing evidence is internally consistent and recent.

Detailed Description

Sensor observation times, aligned poses, and optional frame-arrival evidence.

Timing is deliberately represented with monotonic clocks only; wall-clock adjustments must never turn an otherwise valid capture into a negative duration.

Definition in file capture_timing.h.

Enumeration Type Documentation

◆ capture_time_kind

Enumerator
CAPTURE_TIME_UNKNOWN 
CAPTURE_TIME_SENSOR_EXPOSURE 
CAPTURE_TIME_CALIBRATED_EXPOSURE 
CAPTURE_TIME_SHUTTER_WINDOW 
CAPTURE_TIME_FRAME_ARRIVAL 
CAPTURE_TIME_AUDIO_WINDOW 

Definition at line 32 of file capture_timing.h.

Function Documentation

◆ capture_observation_exposure()

bool capture_observation_exposure ( const struct capture_observation * observation)
inlinestatic

Distinguish exposure evidence from other valid observation times.

Parameters
observationNullable observation to classify.
Returns
True for a valid sensor, calibrated, or shutter-window interval.

Downstream projection must not substitute frame delivery or audio timing for exposure, even if those intervals are structurally valid.

Definition at line 78 of file capture_timing.h.

◆ capture_observation_latency()

bool capture_observation_latency ( struct capture_observation * observation,
uint64_t arrival_us,
uint64_t minimum_us,
uint64_t maximum_us )
inlinestatic

Bound exposure time using calibrated frame delivery latency.

Parameters
[in,out]observationRecord to update; existing pose validity is cleared.
arrival_usFrame arrival in local monotonic microseconds.
minimum_usShortest calibrated exposure-to-arrival delay, in microseconds.
maximum_usLongest calibrated exposure-to-arrival delay, in microseconds.
Returns
True if the interval was written; false leaves the record unchanged.

The longest delay gives the earliest plausible exposure. Reject bounds that would underflow or reach time zero, and require a fresh pose alignment after changing the interval.

Definition at line 96 of file capture_timing.h.

◆ capture_observation_valid()

bool capture_observation_valid ( const struct capture_observation * observation)
inlinestatic

Check that an observation supplies a usable time interval.

Parameters
observationNullable observation to check.
Returns
True for a known timing kind with an ordered, nonzero-start interval spanning no more than 20 seconds.

Check endpoint order before subtracting unsigned timestamps. This validates the interval only, not its pose, sequence, or frame association.

Definition at line 63 of file capture_timing.h.

◆ capture_time_name()

const char * capture_time_name ( enum capture_time_kind kind)
inlinestatic

Get the text label used when recording observation timing.

Parameters
kindSource of the timing evidence.
Returns
Borrowed static string, or unavailable for an unrecognized kind.

Labels retain the distinction between an exposure estimate and frame delivery so that downstream log readers do not conflate the two.

Definition at line 115 of file capture_timing.h.

◆ capture_timing_valid()

bool capture_timing_valid ( const struct capture_timing * timing)
inlinestatic

Check whether timing evidence is internally consistent and recent.

Parameters
timingEvidence to inspect.
Returns
True for a plausible request/arrival pair, false otherwise.

The 20-second bound detects stale parser state without rejecting normal warmup/USB recovery behavior. Callback and polling modes have intentionally distinct sequence invariants, reflected in the final conditional.

Definition at line 155 of file capture_timing.h.