Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
Loading...
Searching...
No Matches
pronav_guidance.hpp
1/****************************************************************************
2 *
3 * Copyright 2026 Auterion. All rights reserved.
4 *
5 ****************************************************************************/
6
7#pragma once
8
9#include <Eigen/Eigen>
10#include <algorithm>
11#include <cmath>
12
13namespace auterion {
14
15// ─── Guidance math primitives (pure functions) ────────────────────────────────
16//
17// These are building blocks for composing user-defined guidance strategies.
18// They are intentionally small and orthogonal — each does exactly one thing.
19// The strategy developer decides how and when to call them.
20//
21// No phase logic, no state machine, no assumptions about drone behaviour
22// are encoded here. Hold, Midcourse, Terminal and any other concepts are
23// defined entirely by the user in their own application.
24
35inline Eigen::Vector3d proNav(double nav_gain, const Eigen::Vector3d& velocity,
36 const Eigen::Vector3d& los, const Eigen::Vector3d& los_rate,
37 double min_velocity = 15.0) {
38 const double v = std::max(velocity.norm(), min_velocity);
39 return -nav_gain * v * (los.normalized().cross(los_rate));
40}
41
51inline double altitudeHold(const Eigen::Vector3d& velocity, double gain = 4.0) {
52 return -velocity.z() * gain;
53}
54
55} // namespace auterion