MP: FIX phantom walk-in-place -- master sends a pose record on came-to-rest (task #50)

The linear pose send-gate watched only POSITION drift + the 2s heartbeat.
When a mech stops, its localOrigin is pinned and the master's own dead-reckon
projection re-bases to it each frame, so error->0 and NO pose record fires --
leaving the peer holding the last WALKING velocity (updateVelocity). The
replicant then dead-reckons + animates a phantom walk-in-place until the 2s
heartbeat (stretched to ~30s when the master window is OS-throttled to ~8fps
while backgrounded during solo two-window testing).

Add the symmetric linear 'came-to-rest' trigger -- the exact analog of the
angular (live yaw-rate==0 && replicated yaw-rate!=0) resync trigger already
present in the type-4 gate: fire a pose record the frame the live horizontal
speed collapses while the last-SENT speed was still non-zero, so the replicant
receives velocity=0 immediately instead of waiting for the heartbeat.

Diagnosis established via BT_WIRE tx0/rx0 probes: records deliver 1:1
(239 tx =~ 240 rx), velocities match -- NOT a replication stall; the master
simply never transmitted the stop. Also confirmed the dominant choppiness is
OS window-throttling (master 8fps backgrounded vs observer 63fps), a
two-windows-on-one-box test artifact absent on real pod hardware.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-14 11:30:18 -05:00
co-authored by Claude Opus 4.8
parent 2aba89f962
commit 94647dd378
2 changed files with 33 additions and 0 deletions
+7
View File
@@ -1810,6 +1810,13 @@ void
updateVelocity.angularMotion = savedAngV; // FUN_00408440
poseSyncLatch = 1; // @0x77c -- arm the dead-reckon re-base
if (getenv("BT_WIRE"))
DEBUG_STREAM << "[rx0] ent=" << GetEntityID()
<< " uvLin=(" << updateVelocity.linearMotion.x << ","
<< updateVelocity.linearMotion.z << ")"
<< " uPos=(" << updateOrigin.linearPosition.x << ","
<< updateOrigin.linearPosition.z << ")\n" << std::flush;
if (bodyAnimationState == 2 || bodyAnimationState == 3) // @0x728
{
projectedVelocity.linearMotion = ZeroVector; // FUN_0040a7f4(0x298, zeroMotion)