Glass lever: port the pod-build GAIT DETENT to the PadRIO throttle slew
Human re-test on the fresh build: zero-stop OK, but the lever could PARK inside
the walk/run hysteresis band (walkStrideLength@0x534 .. reverseSpeedMax@0x538)
where the gait SM has no stable state -- walk<->run hunt, EngineShiftFwd/Rev
retriggering ("mixed walk/run mode + repeated acceleration sample"). The
pod-build keyboard lever already snaps out of the band to the NEARER edge at
key-rest (mech4.cpp GAIT DETENT); the PadRIO slew channel lacked it.
Faithful port, not an invention: mech4.cpp publishes the band in lever units
every driven frame (gBTGaitDetentLo/Hi seam, same guards + the same +0.002
engage margin); L4PADRIO Poll() applies the identical nearer-edge snap to the
Throttle channel when the slew rests (no slew key held, no pad slew axis
deflected). Sweeping through the band while held stays continuous (the
authentic moving lever, one authentic shift).
Verified (DEV.EGG glass, graduated parks each ~0.10 of the sweep,
BT_GAIT_TRACE+BT_MPPR_TRACE): band [0.358026,0.50388) = demand 22.02-30.87;
in-band parks snap both directions (0.4137->lo, 0.465126->hi); no at-rest
sample in the band; exactly ONE walk->run clip (state 10) up and ONE run->walk
(state 14) down across the whole sweep; zero-stop unaffected; pod build
rebuilt + BT_AUTODRIVE smoke clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
1535e3e48d
commit
6ad1e074cc
@@ -654,6 +654,19 @@ static int gBTPinkyKey = 0; // key '4' = the pod's 4th fire butto
|
||||
int gBTModeCycle = 0; // 'M' edge: cycle the control mode (mapper consumes)
|
||||
int gBTDisplayCycle = 0; // 'N' edge: cycle the secondary schematic (Gitea #6, mapper consumes)
|
||||
int gBTPresetCycle[3] = {0,0,0}; // J/K/L edges: cycle an upper-MFD preset page (Gitea #9, L4 mapper consumes)
|
||||
//
|
||||
// GAIT-DETENT seam (glass, 2026-07-20): the walk/run dead band in LEVER units
|
||||
// (throttlePosition 0..1), published every driven frame by the player mech so
|
||||
// the PadRIO throttle-slew channel can apply the SAME at-rest snap-out-of-band
|
||||
// the pod-build keyboard lever has (the "GAIT DETENT" accommodation below) --
|
||||
// without it a glass lever parked between the walk cap (walkStrideLength
|
||||
// @0x534) and the run engage speed (reverseSpeedMax @0x538) hunts walk<->run
|
||||
// forever, retriggering the EngineShiftFwd/Rev samples (the user's "mixed
|
||||
// walk/run mode + repeated acceleration sample"). hi <= lo means "no band"
|
||||
// (mech not yet known / degenerate caps). L4PADRIO.cpp consumes.
|
||||
//
|
||||
float gBTGaitDetentLo = 0.0f;
|
||||
float gBTGaitDetentHi = 0.0f;
|
||||
int gBTLookBehind = 0; // 'V' held: the pod's rear-view button (task #68)
|
||||
float gBTTwistAxis = 0.0f; // Q/E torso-twist deflection (assisted-mode stick X)
|
||||
float gBTElevAxis = 0.0f; // R/F torso-elevation (pitch aim, stick Y)
|
||||
@@ -3037,6 +3050,29 @@ void
|
||||
}
|
||||
}
|
||||
}
|
||||
// GAIT-DETENT seam publish (glass, 2026-07-20): export the SAME band
|
||||
// (same guards, same +0.002 engage margin as above) in lever units
|
||||
// every driven frame, so the PadRIO throttle-slew channel -- which
|
||||
// replaces this bridge's sLever on glass builds -- can apply the
|
||||
// identical at-rest snap. Published unconditionally (not just at
|
||||
// key-rest): the REST decision belongs to the lever's owner, which
|
||||
// on glass is PadRIO's key/pad-held state, not gBTDrive.keyFwd/Back.
|
||||
{
|
||||
extern float gBTGaitDetentLo, gBTGaitDetentHi;
|
||||
gBTGaitDetentLo = 0.0f;
|
||||
gBTGaitDetentHi = 0.0f;
|
||||
if (walkStrideLength > 0.0f
|
||||
&& reverseSpeedMax > walkStrideLength
|
||||
&& reverseStrideLength >= reverseSpeedMax)
|
||||
{
|
||||
const float max_demand = reverseStrideLength * forwardThrottleScale;
|
||||
if (max_demand > 0.0f)
|
||||
{
|
||||
gBTGaitDetentLo = walkStrideLength / max_demand;
|
||||
gBTGaitDetentHi = reverseSpeedMax / max_demand + 0.002f;
|
||||
}
|
||||
}
|
||||
}
|
||||
// the configured rate (CONTROLS.MAP `axis Throttle rate n`) IS the
|
||||
// sweep speed; kLeverRate above stays as the documented default
|
||||
float sweep = gBTInput.leverRate * dt;
|
||||
|
||||
Reference in New Issue
Block a user