Qualify route gain and observe native gate context through ordinary input

This commit is contained in:
2026-09-19 19:44:22 +02:00
parent ec1071595d
commit 53eaf3894d
72 changed files with 71413 additions and 36 deletions
@@ -2,6 +2,20 @@
class ERR_AircraftRouteRules
{
static bool Length(float distance) { return distance >= 18 && distance <= 20.05; }
// Candidate route-only gain. Desired speed and cyclic magnitude remain bounded
// exactly as in the short-translation controller; landing keeps its old gain.
static vector Demand(vector target, vector position, vector velocity)
{
vector error = target - position; error[1] = 0;
vector desired = error * 0.25;
float speed = desired.Length();
if (speed > 0.5) desired = desired * (0.5 / speed);
velocity[1] = 0;
vector demand = (desired - velocity) * 0.10;
float magnitude = demand.Length();
if (magnitude > 0.03) demand = demand * (0.03 / magnitude);
return demand;
}
static vector Nearest(vector start, vector end, vector point)
{
vector leg = end - start; leg[1] = 0;