Gait: FIX replicant trn regression -- gate master-perf turn-stop exit to masters
Today's authentic trn dispatcher folded the master-perf turn-STOP exit into leg/body case 4. But the master perf (FUN_004a9b5c) runs on MasterInstance mechs, NOT replicants -- and a replicant derives turnDemand from the noisy REPLICATED yaw rate (mech4.cpp:1968), which dips into the +-0.05 deadband between dead-reckon updates. So the exit kicked the peer out of trn every few frames -> the peer 'rotated as a statue' + jerky (user-reported regression from yesterday). Gate both turn-stop exits to GetInstance() != ReplicantInstance; the replicant advances the trn clip from its replicated turn signal exactly as before the exit was added. Also BT_REPL_TRN probe (mech4.cpp) logs the replicant yawRate/turnDemand/legState. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
530bbeb959
commit
992aedece8
@@ -693,8 +693,17 @@ Scalar
|
|||||||
distance = 0.0f;
|
distance = 0.0f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (mppr == 0
|
// MASTER ONLY (regression fix): the master-perf turn-stop exit is master-perf
|
||||||
|| (mppr->turnDemand <= 0.05f && mppr->turnDemand >= -0.05f))
|
// logic (FUN_004a9b5c runs on MasterInstance mechs, NOT replicants). A replicant
|
||||||
|
// derives turnDemand from the REPLICATED yaw rate (mech4.cpp:1968) -- a noisy
|
||||||
|
// proxy that dips into the deadband between dead-reckon updates; running this
|
||||||
|
// exit on it kicked the peer out of trn every few frames -> the peer "rotated as
|
||||||
|
// a statue" + jerky (user-reported). Gate to masters; a replicant leaves trn via
|
||||||
|
// the speed exits + its own turnDemand-driven re-entry, exactly as it did before
|
||||||
|
// this exit was added.
|
||||||
|
if (GetInstance() != ReplicantInstance
|
||||||
|
&& (mppr == 0
|
||||||
|
|| (mppr->turnDemand <= 0.05f && mppr->turnDemand >= -0.05f)))
|
||||||
{
|
{
|
||||||
legStateAlarm.SetLevel(0); // turn stopped -> Standing (master-perf exit)
|
legStateAlarm.SetLevel(0); // turn stopped -> Standing (master-perf exit)
|
||||||
ForceUpdate(8);
|
ForceUpdate(8);
|
||||||
@@ -932,8 +941,9 @@ Scalar
|
|||||||
distance = 0.0f;
|
distance = 0.0f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (bm == 0
|
if (GetInstance() != ReplicantInstance // MASTER only (see leg twin)
|
||||||
|| (bm->turnDemand <= 0.05f && bm->turnDemand >= -0.05f))
|
&& (bm == 0
|
||||||
|
|| (bm->turnDemand <= 0.05f && bm->turnDemand >= -0.05f)))
|
||||||
{
|
{
|
||||||
bodyStateAlarm.SetLevel(0); // turn stopped (leg-symmetric)
|
bodyStateAlarm.SetLevel(0); // turn stopped (leg-symmetric)
|
||||||
ForceUpdate(8);
|
ForceUpdate(8);
|
||||||
|
|||||||
@@ -1988,6 +1988,19 @@ void
|
|||||||
legCycleSpeed = 0.0f;
|
legCycleSpeed = 0.0f;
|
||||||
(void)AdvanceLegAnimation(dt); // joints only; travel = DeadReckon
|
(void)AdvanceLegAnimation(dt); // joints only; travel = DeadReckon
|
||||||
|
|
||||||
|
if (getenv("BT_REPL_TRN"))
|
||||||
|
{
|
||||||
|
static float s_rt = 0.0f; s_rt += dt;
|
||||||
|
if (s_rt >= 0.15f)
|
||||||
|
{
|
||||||
|
s_rt = 0.0f;
|
||||||
|
DEBUG_STREAM << "[repltrn] yawRate=" << yawRate
|
||||||
|
<< " turnDemand=" << replMppr->turnDemand
|
||||||
|
<< " legState=" << (int)legStateAlarm.GetLevel()
|
||||||
|
<< " spd=" << replMppr->speedDemand << "\n" << std::flush;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// REPLICANT BEAMS (task #51): the emitters carry live replicated
|
// REPLICANT BEAMS (task #51): the emitters carry live replicated
|
||||||
// discharge state (Emitter::ReadUpdateRecord); draw them with the
|
// discharge state (Emitter::ReadUpdateRecord); draw them with the
|
||||||
// same per-weapon walk the master uses.
|
// same per-weapon walk the master uses.
|
||||||
|
|||||||
Reference in New Issue
Block a user