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
dipla_ipc.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 dipla_ipc.h
19 * @brief Private local worker messages; not a flight-controller wire protocol.
20 * @details Unix SOCK_SEQPACKET preserves one fixed-size message per request/reply.
21 * Both endpoints are native Sensoraia processes from the same build.
22 * @note Integer widths and layout assertions define this local ABI. It is not
23 * a replacement for USHER UART framing or a cross-version network service. */
24#ifndef SENSORAIA_DIPLA_IPC_H
25#define SENSORAIA_DIPLA_IPC_H
26#include "dipla_contract.h"
27#define DIPLA_IPC_VERSION 1U /**< Reject incompatible packet layouts before interpreting payload. */
28#define DIPLA_IPC_START 1U /**< Request a chunk; retain an active belief, reset after STOP. No reply packet. */
29#define DIPLA_IPC_STOP 2U /**< Invalidate the matching session; no reply packet. */
30#define DIPLA_IPC_SHOT 3U /**< Submit a pose and retrieve one pinned point using dipla_reply. */
31#define DIPLA_IPC_PLAN 4U /**< Submit a pose and retrieve one immutable dipla_plan_reply. */
32#define DIPLA_IPC_CREDIT_SHOT 5U /**< SHOT with a separate assimilation acknowledgement before the next new observation. */
33#define DIPLA_IPC_POINT 6U /**< Retrieve a retained point without admitting another observation. */
34#define DIPLA_IPC_ASSIMILATED_METRIC (-1) /**< Invalid local completion credit after assimilation or rejection, never a camera point. */
35#define DIPLA_CAMERA_ID 5U /**< Non-image sensor identity, distinct from waypoint indices. */
36#define DIPLA_CAMERA_MASK 0x10U /**< Existing eight-slot camera selection bit for camera five. */
37#define DIPLA_POINT_MAX_AGE_MS 5000U /**< Assimilated observation lease, not retained-route creation age. */
38#define DIPLA_CYCLE_TIMEOUT_MS 1500U /**< Broken one-point cycles restart rather than mixing snapshots. */
39/** @brief Pose/control request; session and observation number have separate lifetimes.
40 * @details The first accepted pose after START from stopped anchors local
41 * (50,50). Active START preserves that survey frame; STOP ends it. */
43 /** @var dipla_request::version
44 * @brief Layout version; reject before interpreting the remaining packet. */
45 /** @var dipla_request::operation
46 * @brief START, STOP, SHOT or complete PLAN operation. */
47 /** @var dipla_request::session
48 * @brief Nonzero chunk token; STOP, not active START, ends survey belief. */
49 uint32_t version, operation, session, number; /**< Positive observation identifier for SHOT/PLAN; unused for control packets. */
50 /** @var dipla_request::lat
51 * @brief Reported latitude in degrees times 1e7. */
52 /** @var dipla_request::lon
53 * @brief Reported longitude in degrees times 1e7. */
54 /** @var dipla_request::alt_mm
55 * @brief Owner-supplied FC altitude in millimetres; echoed by the legacy point reply. */
56 int32_t lat, lon, alt_mm, agl_q8; /**< Actual reported AGL in metres times 256, not an MSL ground elevation. */
57};
58/** @brief Legacy one-point retrieval from a generation pinned across eight slots. */
60 /** @var dipla_reply::version
61 * @brief Reply layout version, checked before accepting any result. */
62 /** @var dipla_reply::session
63 * @brief Exact session echo; prevents accepting a previous sortie's completion. */
64 /** @var dipla_reply::number
65 * @brief Exact observation echo; a retry must not consume another slot. */
66 uint32_t version, session, number, valid; /**< Computational validity, never sensor confidence or field accuracy. */
67 /** @var dipla_reply::lat
68 * @brief Proposed geographic latitude in degrees times 1e7. */
69 /** @var dipla_reply::lon
70 * @brief Proposed geographic longitude in degrees times 1e7. */
71 /** @var dipla_reply::alt_mm
72 * @brief Unchanged owner-supplied FC altitude in millimetres, not predicted model Z. */
73 /** @var dipla_reply::agl_mm
74 * @brief Configured physical flight height in millimetres; default 2000. */
75 int32_t lat, lon, alt_mm, agl_mm, metric; /**< Packed (generation<<3)|slot, with internal slot 0..7 mapping to P1..P8. */
76};
77/** @brief Complete immutable route reply on the local worker socket, not the FC bus.
78 * @details All points belong to one generation. Count eight and valid one are
79 * required together; incomplete/unready replies cannot authorize publication.
80 * Fixed height prevents model-predicted Z from becoming an altitude command. */
82 /** @var dipla_plan_reply::version
83 * @brief Complete-plan layout version. */
84 /** @var dipla_plan_reply::session
85 * @brief Exact session echo, independent of route generation. */
86 /** @var dipla_plan_reply::number
87 * @brief Exact request echo; route data may originate from an earlier admitted pose. */
88 /** @var dipla_plan_reply::valid
89 * @brief One only for an entire fresh, bounded route; zero authorizes no points. */
90 /** @var dipla_plan_reply::generation
91 * @brief Monotonically increasing completed-route identity within this session. */
92 /** @var dipla_plan_reply::age_ms
93 * @brief Milliseconds since the latest assimilated active-chunk pose was received. */
94 uint32_t version, session, number, valid, generation, age_ms, count; /**< Eight only when the complete route is valid. */
95 /** @brief Canonical model-field point; (50000,50000) is the captured anchor.
96 * @details XY retains the 100-unit domain multiplied by 1000, independently
97 * of physical field size. Geographic point replies apply scale and rotation;
98 * complete-plan consumers must apply that same configured transform. */
100 /** @var dipla_plan_reply::dipla_plan_point::east_mm
101 * @brief Flight-padded model X times 1000; default bounds 4000..96000. */
102 /** @var dipla_plan_reply::dipla_plan_point::north_mm
103 * @brief Flight-padded model Y times 1000; default bounds 4000..96000. */
104 int32_t east_mm, north_mm, height_mm; /**< Configured physical height in millimetres; predicted Z is never forwarded. */
105 } points[DIPLA_WAYPOINT_COUNT]; /**< Slot zero maps to P1; a copied bank is never changed mid-reply. */
106};
107#ifdef __cplusplus
108static_assert(sizeof(dipla_request) == 32 && sizeof(dipla_reply) == 36 && sizeof(dipla_plan_reply) == 124,
109 "Diplacam local IPC layout changed");
110#else
111_Static_assert(sizeof(struct dipla_request) == 32 && sizeof(struct dipla_reply) == 36 &&
112 sizeof(struct dipla_plan_reply) == 124, "Diplacam local IPC layout changed");
113#endif
114#endif
Fixed model geometry and C/C++ local transport units, not runtime settings.
#define DIPLA_WAYPOINT_COUNT
Canonical model-field point; (50000,50000) is the captured anchor.
Definition dipla_ipc.h:99
int32_t east_mm
Flight-padded model X times 1000; default bounds 4000..96000.
Definition dipla_ipc.h:104
int32_t north_mm
Flight-padded model Y times 1000; default bounds 4000..96000.
Definition dipla_ipc.h:104
Complete immutable route reply on the local worker socket, not the FC bus.
Definition dipla_ipc.h:81
uint32_t generation
Monotonically increasing completed-route identity within this session.
Definition dipla_ipc.h:94
struct dipla_plan_reply::dipla_plan_point points[DIPLA_WAYPOINT_COUNT]
uint32_t version
Complete-plan layout version.
Definition dipla_ipc.h:94
uint32_t valid
One only for an entire fresh, bounded route; zero authorizes no points.
Definition dipla_ipc.h:94
uint32_t session
Exact session echo, independent of route generation.
Definition dipla_ipc.h:94
uint32_t age_ms
Milliseconds since the latest assimilated active-chunk pose was received.
Definition dipla_ipc.h:94
uint32_t count
Definition dipla_ipc.h:94
uint32_t number
Exact request echo; route data may originate from an earlier admitted pose.
Definition dipla_ipc.h:94
Legacy one-point retrieval from a generation pinned across eight slots.
Definition dipla_ipc.h:59
uint32_t number
Exact observation echo; a retry must not consume another slot.
Definition dipla_ipc.h:66
uint32_t valid
Definition dipla_ipc.h:66
int32_t agl_mm
Configured physical flight height in millimetres; default 2000.
Definition dipla_ipc.h:75
int32_t lon
Proposed geographic longitude in degrees times 1e7.
Definition dipla_ipc.h:75
int32_t lat
Proposed geographic latitude in degrees times 1e7.
Definition dipla_ipc.h:75
int32_t alt_mm
Unchanged owner-supplied FC altitude in millimetres, not predicted model Z.
Definition dipla_ipc.h:75
int32_t metric
Definition dipla_ipc.h:75
uint32_t session
Exact session echo; prevents accepting a previous sortie's completion.
Definition dipla_ipc.h:66
uint32_t version
Reply layout version, checked before accepting any result.
Definition dipla_ipc.h:66
Pose/control request; session and observation number have separate lifetimes.
Definition dipla_ipc.h:42
uint32_t operation
START, STOP, SHOT or complete PLAN operation.
Definition dipla_ipc.h:49
int32_t alt_mm
Owner-supplied FC altitude in millimetres; echoed by the legacy point reply.
Definition dipla_ipc.h:56
uint32_t number
Definition dipla_ipc.h:49
uint32_t session
Nonzero chunk token; STOP, not active START, ends survey belief.
Definition dipla_ipc.h:49
int32_t agl_q8
Definition dipla_ipc.h:56
uint32_t version
Layout version; reject before interpreting the remaining packet.
Definition dipla_ipc.h:49
int32_t lat
Reported latitude in degrees times 1e7.
Definition dipla_ipc.h:56
int32_t lon
Reported longitude in degrees times 1e7.
Definition dipla_ipc.h:56