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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-10 07:59:39 +02:00
commit 87e9bfd06b

View file

@ -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}");
}
}
}