Bounded geometric decisions without pixel decoding or camera dependencies. More...

Go to the source code of this file.
Data Structures | |
| struct | coverage_bounds |
| Validated inclusive grid bounds and polygon winding for half-plane tests. More... | |
Functions | |
| static void | rotate (double vector[3], double roll_deg, double pitch_deg, double yaw_deg) |
| Apply Rz*Ry*Rx in place, matching the mount/body order used by PANGEA. | |
| bool | coverage_project (const struct coverage_camera *camera, const struct coverage_pose *pose, double origin_latitude_deg, double origin_longitude_deg, struct coverage_footprint *footprint) |
| Project delivered-image corners onto a local flat ground plane. | |
| bool | coverage_project_pixel (const struct coverage_camera *camera, const struct coverage_pose *pose, double column, double row, struct coverage_point *offset) |
| Project an image pixel onto the same ground plane as the coverage footprint. | |
| bool | coverage_init (struct coverage_state *state, double east, double north, double cell_m) |
| Clear the ledger and set its fixed spatial domain. | |
| static bool | bounds (const struct coverage_state *state, const struct coverage_candidate *candidate, struct coverage_bounds *box) |
| Reject unusable polygons before converting coordinates or scanning cells. | |
| static bool | contains_cell (const struct coverage_state *state, const struct coverage_candidate *candidate, const struct coverage_bounds *box, int column, int row) |
| Require the whole cell, not merely its centre, inside every polygon edge. | |
| static double | gain_after (const struct coverage_state *state, const struct coverage_candidate *candidate, const struct coverage_candidate *previous) |
| Score a second view against a hypothetical first, without committing either. | |
| double | coverage_gain (const struct coverage_state *state, const struct coverage_candidate *candidate) |
| Score additional detail in conservatively contained cells without mutation. | |
| bool | coverage_commit (struct coverage_state *state, const struct coverage_candidate *candidate) |
| Credit a successfully saved observation, retaining the best detail per cell. | |
| int | coverage_choose (const struct coverage_state *state, const struct coverage_candidate *candidates, size_t count, uint64_t now_us, uint64_t service_us) |
| Choose the first observation of the best feasible one- or two-shot plan. | |
| bool | coverage_wholly_saved (const struct coverage_state *state, const struct coverage_candidate *candidate) |
| Check whether skipping this observation is geometrically conservative. | |
| double | coverage_overlap (const struct coverage_state *state, const struct coverage_candidate *first, const struct coverage_candidate *second) |
| Estimate conservative overlap for deciding whether a delay is acceptable. | |
Detailed Description
Bounded geometric decisions without pixel decoding or camera dependencies.
Two different margins are intentional: shrink footprints when granting credit, but expand them before deciding a new photograph is redundant. Using the same test for both would turn uncertainty into falsely claimed coverage.
Definition in file coverage_scheduler.c.
Function Documentation
◆ bounds()
|
static |
Reject unusable polygons before converting coordinates or scanning cells.
Convexity and work limits belong here so every scoring/credit path shares the same conservative definition of a computable footprint.
Definition at line 120 of file coverage_scheduler.c.
◆ contains_cell()
|
static |
Require the whole cell, not merely its centre, inside every polygon edge.
Definition at line 156 of file coverage_scheduler.c.
◆ coverage_choose()
| int coverage_choose | ( | const struct coverage_state * | state, |
| const struct coverage_candidate * | candidates, | ||
| size_t | count, | ||
| uint64_t | now_us, | ||
| uint64_t | service_us ) |
Choose the first observation of the best feasible one- or two-shot plan.
- Parameters
-
state Committed coverage, left unchanged. candidates At most COVERAGE_CANDIDATES opportunities. count Number of opportunities. now_us Earliest permissible start, monotonic microseconds. service_us Positive serialized acquisition interval used between choices.
- Returns
- First candidate index, or -1 when no positive feasible gain is known.
Union scoring avoids double-counting repeated ground in the second view. Ties favor an earlier start, then greater first-shot gain. The caller still enforces overlap, uncertainty and delay limits; this is not a global flight planner.
Definition at line 218 of file coverage_scheduler.c.
◆ coverage_commit()
| bool coverage_commit | ( | struct coverage_state * | state, |
| const struct coverage_candidate * | candidate ) |
Credit a successfully saved observation, retaining the best detail per cell.
- Parameters
-
[in,out] state Initialized committed ledger. candidate Saved image footprint with trusted pose and detail score.
- Returns
- True for a valid bounded update, even if no cells improve; false for unknown geometry.
- Precondition
- The caller has verified publication. Never call this for a mere capture request.
Definition at line 204 of file coverage_scheduler.c.
◆ coverage_gain()
| double coverage_gain | ( | const struct coverage_state * | state, |
| const struct coverage_candidate * | candidate ) |
Score additional detail in conservatively contained cells without mutation.
- Parameters
-
state Initialized committed ledger. candidate Observation to evaluate.
- Returns
- Quality-weighted square metres, zero for no credited gain, or -1 for unknown geometry. Zero alone is not permission to skip; use coverage_wholly_saved().
Definition at line 199 of file coverage_scheduler.c.
◆ coverage_init()
| bool coverage_init | ( | struct coverage_state * | state, |
| double | east, | ||
| double | north, | ||
| double | cell_m ) |
Clear the ledger and set its fixed spatial domain.
- Parameters
-
[out] state Caller-owned ledger; allocate off small embedded thread stacks. east Lower grid edge in local east metres. north Lower grid edge in local north metres. cell_m Cell edge in metres, within 0.25..100.
- Returns
- True on initialization; false leaves state unchanged.
Definition at line 105 of file coverage_scheduler.c.
◆ coverage_overlap()
| double coverage_overlap | ( | const struct coverage_state * | state, |
| const struct coverage_candidate * | first, | ||
| const struct coverage_candidate * | second ) |
Estimate conservative overlap for deciding whether a delay is acceptable.
- Parameters
-
state Grid geometry used to discretize the comparison; saved values are not read. first Candidate whose bounding-cell count is the denominator. second Same-camera footprint to overlap with.
- Returns
- Conservative fraction in 0..1, or -1 if the comparison is unknown.
- Note
- This is asymmetric and deliberately stricter than exact polygon overlap.
Definition at line 269 of file coverage_scheduler.c.
◆ coverage_project()
| bool coverage_project | ( | const struct coverage_camera * | camera, |
| const struct coverage_pose * | pose, | ||
| double | origin_latitude_deg, | ||
| double | origin_longitude_deg, | ||
| struct coverage_footprint * | footprint ) |
Project delivered-image corners onto a local flat ground plane.
- Parameters
-
camera Measured intrinsics and camera-to-body mount. pose Observation pose with AGL and uncertainty. origin_latitude_deg Local projection reference latitude, degrees. origin_longitude_deg Local projection reference longitude, degrees. [out] footprint Result, written only on success.
- Returns
- False for invalid, near-horizon or excessively distant geometry.
- Warning
- A plausible footprint does not establish terrain visibility, focus or exposure synchronization. Zero mount means image-up forward and optical-axis down.
Definition at line 46 of file coverage_scheduler.c.
◆ coverage_project_pixel()
| bool coverage_project_pixel | ( | const struct coverage_camera * | camera, |
| const struct coverage_pose * | pose, | ||
| double | column, | ||
| double | row, | ||
| struct coverage_point * | offset ) |
Project an image pixel onto the same ground plane as the coverage footprint.
- Parameters
-
camera Delivered-image calibration and mount. pose Observation attitude and camera-to-ground height. column Pixel column within the delivered image. row Pixel row within the delivered image. [out] offset Metres east/north relative to the observation position.
- Returns
- False for invalid pixels or geometry, leaving offset unchanged.
Reuses whole-footprint qualification and the existing mount/body rotation order.
Definition at line 88 of file coverage_scheduler.c.
◆ coverage_wholly_saved()
| bool coverage_wholly_saved | ( | const struct coverage_state * | state, |
| const struct coverage_candidate * | candidate ) |
Check whether skipping this observation is geometrically conservative.
- Parameters
-
state Initialized committed ledger. candidate Proposed observation.
- Returns
- True only when the uncertainty-expanded bounding region already has at least the requested detail. Outside the grid or work budget, return false.
Definition at line 252 of file coverage_scheduler.c.
◆ gain_after()
|
static |
Score a second view against a hypothetical first, without committing either.
The overlay is local to this calculation. A predicted image must never leak into the saved ledger, even if it scores well or is next in the queue.
Definition at line 179 of file coverage_scheduler.c.
◆ rotate()
|
static |
Apply Rz*Ry*Rx in place, matching the mount/body order used by PANGEA.
Definition at line 34 of file coverage_scheduler.c.