From 87e9bfd06b93c9a022f2ad658ba359be06af5554 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 10 Oct 2026 07:59:39 +0200 Subject: [PATCH] ThrustAllocator tests: a full turn against a full reverse keeps its whole yaw (error-bound-unpinned) The turn leaves a forward error of 2, the top of TA-R2's error box; a bound of 1 or 1.5 gives yaw back. Commit builds: yes (tests/Aetheria.Shared.Tests not yet run on this commit; the full run is the closing job). Co-Authored-By: Claude Opus 5.5 --- .../ThrustAllocatorTests.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/ThrustAllocatorTests.cs b/tests/Aetheria.Shared.Tests/ThrustAllocatorTests.cs index 1f956eafb..c75bc5620 100644 --- a/tests/Aetheria.Shared.Tests/ThrustAllocatorTests.cs +++ b/tests/Aetheria.Shared.Tests/ThrustAllocatorTests.cs @@ -325,4 +325,24 @@ public class ThrustAllocatorTests var extreme = Extremes(forward, 1).plus; Assert.True(reached > .1f * extreme, $"{reached} of {extreme}"); } + + [Fact] + public void AFullTurnAgainstAFullReverseKeepsItsWholeYaw() + { + // The only clockwise actuator also pushes forward and the only reverse actuator turns the other way. Delivering + // a full turn against a full reverse leaves a forward error of 2, the top of TA-R2's error box: an error bound + // below 2 would take yaw back to pay for it, and turn-authority-full says the turn is whole. + foreach (var (columns, x, y) in new[] + { + (new[] { Col(0, 50, 100), Col(0, -50, -100) }, 0f, -1f), + (new[] { Col(50, 0, 100), Col(-50, 0, -100) }, -1f, 0f), + (new[] { Col(0, -50, 100), Col(0, 50, -100) }, 0f, 1f), + (new[] { Col(-50, 0, 100), Col(50, 0, -100) }, 1f, 0f), + }) + { + var yaw = Net(columns, Solve(columns, x, y, 1)).z; + var extreme = Extremes(columns, 2).plus; + Assert.True(MathF.Abs(yaw - extreme) <= 1e-4f * extreme, $"move ({x},{y}): yaw {yaw / Deg} of {extreme / Deg}"); + } + } }