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_worker.hpp
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/**
19 * @file dipla_worker.hpp
20 * @brief Public entry point for Diplacam's bounded local IPC worker.
21 * @details The worker receives fixed-size requests over a connected Unix
22 * socket, keeps a bounded ordered observation FIFO, and returns immutable route
23 * snapshots or pinned legacy point slots. Transport details and synchronization state remain private to the
24 * implementation.
25 */
26#pragma once
27#include "dipla_planner.hpp"
28#include <string>
29namespace dipla {
30/**
31 * @brief Serve a Diplacam session over an already-connected IPC descriptor.
32 * @details Starts one planning thread and services requests on the calling
33 * thread. One GP owner consumes each accepted observation once. Queue overflow
34 * fails closed. START during an active survey requests a new retained chunk;
35 * its first accepted pose anchors field centre (50,50). Active START retains
36 * that frame and belief; STOP followed by START resets both. Complete-route replies copy one
37 * generation; legacy retrieval pins a route across eight points. The caller retains descriptor ownership and
38 * should close it after this returns.
39 * Reply backpressure fails the connection instead of blocking request handling.
40 * @param descriptor Connected socket descriptor; ownership remains with caller.
41 * @param config Worker INI containing field, cadence and planning-pose age settings.
42 * @param default_model Default model path supplied by the executable settings/CLI.
43 * @param default_metadata Default metadata path supplied by the executable settings/CLI.
44 * @param cmaes Select the explicit comparison-only planner; false uses diffusion.
45 * @param comparison Bounded CMA-ES options used only when `cmaes` is true.
46 * @param network_options Descriptor and bounded ONNX execution policy, ignored in comparison mode.
47 * @param experiment Startup GP, synthetic sensor, seed and flight-margin policy.
48 * @return Zero after orderly transport and worker shutdown; nonzero on failure.
49 * @throws std::exception For invalid configuration or unrecoverable setup errors.
50 * @note Computational validity is not route execution or field accuracy. This
51 * worker neither publishes GCS moves nor changes navigation blocks.
52 */
53int serve(int descriptor, const std::string& config, const std::string& default_model,
54 const std::string& default_metadata, bool cmaes = false,
55 const CmaesOptions& comparison = {}, const NetworkOptions& network_options = {},
56 const ExperimentOptions& experiment = {});
57}
int descriptor
Definition chdk_pipe.c:142
Public planning, synthetic-survey, and comparison APIs for Diplacam.
int serve(int descriptor, const std::string &config_path, const std::string &model, const std::string &metadata, bool cmaes, const CmaesOptions &comparison, const NetworkOptions &network_options, const ExperimentOptions &experiment)
Serve a Diplacam session over an already-connected IPC descriptor.
Bounded parameters for the comparison-only CMA-ES planner.
Startup-only synthetic experiment settings shared by both planners.
Model identity and execution limits for a diffusion network.