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
loom_return.c File Reference

Constant-storage return geometry with explicit simulation-only fallback. More...

#include "loom_return.h"
#include <math.h>
#include <string.h>
#include "../../src/bounded_ini.h"
Include dependency graph for loom_return.c:

Go to the source code of this file.

Functions

bool loom_return_config_valid (const struct loom_return_config *config)
 Validate finite limits and their cross-field relationships.
void loom_return_defaults (struct loom_return_config *config)
 Conservative return-policy defaults, not aircraft flight settings.
void loom_return_options_init (struct loom_return_options *options)
 Initialize return limits with feature-only semantics by default.
bool loom_return_options_valid (const struct loom_return_options *options)
 Check that optional destination coordinates are either both present or both omitted.
bool loom_return_setting (void *context, const char *key, const char *value)
 Parse one LOOM-owned settings field, rejecting duplicates and unknown keys.
bool loom_return_vector_attitude (enum loom_return_frame frame, double first, double second, double roll_deg, double pitch_deg, double yaw_deg, double max_tilt_deg, struct loom_return_point *direction)
 Convert a declared two-component vector to earth-frame east/north with attitude gating.
void loom_return_simulated_vector (uint64_t seed, struct loom_return_point position, double yaw_deg, float vector[3])
 Generate a slightly noisy body-frame simulated homing vector seeded by neural feature output.
bool loom_return_vector (enum loom_return_frame frame, double first, double second, double yaw_deg, struct loom_return_point *direction)
 Convert a level declared two-component vector to earth-frame east/north.
bool loom_return_direction (const struct loom_return_config *config, struct loom_return_point position, struct loom_return_point direction, double confidence, struct loom_return_point *target)
 Convert an earth-frame direction into a HOME-bounded target.
bool loom_return_update (struct loom_return_state *state, const struct loom_return_config *config, uint32_t sequence, struct loom_return_point candidate, struct loom_return_point *target)
 Admit a fresh bounded target and limit its movement.
bool loom_return_simulate (struct loom_return_state *state, const struct loom_return_config *config, uint32_t sequence, struct loom_return_point *target)
 Produce small mean-reverting target fluctuations for explicit PC simulation.

Detailed Description

Constant-storage return geometry with explicit simulation-only fallback.

Definition in file loom_return.c.

Function Documentation

◆ loom_return_config_valid()

bool loom_return_config_valid ( const struct loom_return_config * config)

Validate finite limits and their cross-field relationships.

Definition at line 26 of file loom_return.c.

◆ loom_return_defaults()

void loom_return_defaults ( struct loom_return_config * config)

Conservative return-policy defaults, not aircraft flight settings.

Parameters
configWritable destination.

Definition at line 35 of file loom_return.c.

◆ loom_return_direction()

bool loom_return_direction ( const struct loom_return_config * config,
struct loom_return_point position,
struct loom_return_point direction,
double confidence,
struct loom_return_point * target )

Convert an earth-frame direction into a HOME-bounded target.

Parameters
configValid policy limits.
positionVehicle east/north relative to HOME, metres.
directionEarth-frame east/north components; magnitude is not distance.
confidenceFinite model confidence in 0..1.
targetWritten only for an accepted, nonzero direction toward HOME.
Returns
False for invalid, away-facing or inconsistent geometry.

Definition at line 138 of file loom_return.c.

◆ loom_return_options_init()

void loom_return_options_init ( struct loom_return_options * options)

Initialize return limits with feature-only semantics by default.

Definition at line 40 of file loom_return.c.

◆ loom_return_options_valid()

bool loom_return_options_valid ( const struct loom_return_options * options)

Check that optional destination coordinates are either both present or both omitted.

Definition at line 47 of file loom_return.c.

◆ loom_return_setting()

bool loom_return_setting ( void * context,
const char * key,
const char * value )

Parse one LOOM-owned settings field, rejecting duplicates and unknown keys.

Definition at line 55 of file loom_return.c.

◆ loom_return_simulate()

bool loom_return_simulate ( struct loom_return_state * state,
const struct loom_return_config * config,
uint32_t sequence,
struct loom_return_point * target )

Produce small mean-reverting target fluctuations for explicit PC simulation.

Parameters
stateCaller state; random seed zero selects a deterministic seed.
configValid policy limits.
sequenceStrictly increasing observation number.
targetSimulated point, never represented as a neural observation.
Returns
True only for a fresh bounded update.

Definition at line 191 of file loom_return.c.

◆ loom_return_simulated_vector()

void loom_return_simulated_vector ( uint64_t seed,
struct loom_return_point position,
double yaw_deg,
float vector[3] )

Generate a slightly noisy body-frame simulated homing vector seeded by neural feature output.

Definition at line 109 of file loom_return.c.

◆ loom_return_update()

bool loom_return_update ( struct loom_return_state * state,
const struct loom_return_config * config,
uint32_t sequence,
struct loom_return_point candidate,
struct loom_return_point * target )

Admit a fresh bounded target and limit its movement.

Parameters
stateExclusive caller state; not shared between sorties.
configValid policy limits.
sequenceStrictly increasing positive observation number.
candidateProposed point within the HOME radius.
targetSmoothed accepted point, unchanged on rejection.
Returns
True only when the state advances. Transport owners must commit a copied state only after their waypoint transaction succeeds.

Definition at line 171 of file loom_return.c.

◆ loom_return_vector()

bool loom_return_vector ( enum loom_return_frame frame,
double first,
double second,
double yaw_deg,
struct loom_return_point * direction )

Convert a level declared two-component vector to earth-frame east/north.

Parameters
frameDeclared model coordinate system.
firstNorth or forward component.
secondEast or right component.
yaw_degAircraft heading, clockwise from north, degrees.
directionWritten only for finite supported coordinates.

Definition at line 132 of file loom_return.c.

◆ loom_return_vector_attitude()

bool loom_return_vector_attitude ( enum loom_return_frame frame,
double first,
double second,
double roll_deg,
double pitch_deg,
double yaw_deg,
double max_tilt_deg,
struct loom_return_point * direction )

Convert a declared two-component vector to earth-frame east/north with attitude gating.

Parameters
frameDeclared model coordinate system.
firstNorth or forward component.
secondEast or right component.
roll_degAircraft roll, right wing down positive, degrees.
pitch_degAircraft pitch, nose up positive, degrees.
yaw_degAircraft magnetometer heading, clockwise from north, degrees.
max_tilt_degMaximum allowed absolute roll or pitch in degrees.
directionWritten only for finite supported coordinates within tilt limits.

Definition at line 86 of file loom_return.c.