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
spotter_targets.h
Go to the documentation of this file.
1/*
2 * Copyright 2026 OpenUAS
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/** @file spotter_targets.h
19 * @brief Five ranked geographic targets, independent of navigation and camera transport. */
20#ifndef SENSORAIA_SPOTTER_TARGETS_H
21#define SENSORAIA_SPOTTER_TARGETS_H
22
23#include <stdbool.h>
24#include <stdint.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#define SPOTTER_TARGET_COUNT 5U
31
32/** @brief Geographic observation in the shared USHER point units. */
34 int32_t latitude, longitude; /**< Degrees times 1e7. */
35 int32_t altitude_mm; /**< Ellipsoid altitude in millimetres. */
36 uint16_t score; /**< Detector confidence in 0..1000. */
37 bool valid; /**< False means no observation has assigned this slot. */
38};
39
40/** @brief Caller-owned fixed storage; slot indices stay stable while scores improve. */
44
45/** @brief Forget all prior assignments without manufacturing target coordinates.
46 * @param targets Writable store, or NULL to do nothing. */
47void spotter_targets_reset(struct spotter_targets *targets);
48
49/** @brief Admit a target only after its owner's coordinate application succeeds.
50 * @param targets Exclusive target store.
51 * @param observation Immutable valid geographic observation.
52 * @param apply Optional coordinate transaction; false leaves the selected slot unchanged.
53 * @param context Borrowed callback state.
54 * @return Assigned zero-based slot, or minus one for invalid/nonimproving/rejected observations.
55 * @details Empty slots fill first; once full, only a strictly better score replaces the lowest.
56 * Reobserving exactly the same position improves its existing slot instead of consuming another. */
57int spotter_targets_offer(struct spotter_targets *targets, const struct spotter_target *observation,
58 bool (*apply)(void *, unsigned, const struct spotter_target *), void *context);
59
60#ifdef __cplusplus
61}
62#endif
63
64#endif
void spotter_targets_reset(struct spotter_targets *targets)
Forget all prior assignments without manufacturing target coordinates.
#define SPOTTER_TARGET_COUNT
int spotter_targets_offer(struct spotter_targets *targets, const struct spotter_target *observation, bool(*apply)(void *, unsigned, const struct spotter_target *), void *context)
Admit a target only after its owner's coordinate application succeeds.
Geographic observation in the shared USHER point units.
Caller-owned fixed storage; slot indices stay stable while scores improve.
struct spotter_target slots[SPOTTER_TARGET_COUNT]