ford ALP: cap the applied lane-centering correction at 0.0015 - #181
Open
ghbarker wants to merge 4 commits into
Open
ford ALP: cap the applied lane-centering correction at 0.0015#181ghbarker wants to merge 4 commits into
ghbarker wants to merge 4 commits into
Conversation
…rams) and cap applied correction at 0.0015
The three reference guards (narrow-lane floor, laneline std, NaN params) stay. The 0.0015 post-gain ceiling moves to a follow-up PR so the ceiling value can be chosen from on-road testing; tests revert to the uncapped 0.004 ceiling.
narrow-lane floor, laneline std, NaN params, and a pin on the fallback-bias semantics (constant push by design). All five fail without the guards.
Post-gain ceiling on the trim, strictly inside the deviation clip's budget (CURVATURE_ERROR = 0.002) and under _STALL_GAP_MIN (0.004): the trim alone can never continuously bind the deviation clip (which also discards autocal evidence frames) or feed the stall-blip detector a fake stall. Matters most in the model-position fallback, where the bias error never closes by construction, so a large offset at full gain would otherwise sit at the raw 0.004 ceiling permanently on center-stripe-only roads. Value rationale: above the reference implementation's effective ceiling (0.004 raw clip x 0.30 fixed gain = 0.0012), below the 0.002 clip budget. The specific constant is a proposal -- sized for safety margin, open to retuning from on-road testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Split out from #179 per review. Adds a post-gain ceiling of 0.0015 on the applied lane-centering correction, strictly inside the deviation clip's budget (CURVATURE_ERROR = 0.002) and under _STALL_GAP_MIN (0.004) — so the trim alone can never continuously bind the deviation clip (which also discards autocal evidence frames) or feed the stall-blip detector a fake stall. This matters most in the model-position fallback, where the bias error never closes by construction, so a large offset at full gain otherwise sits at the raw 0.004 ceiling permanently on center-stripe-only roads.
Value rationale: above StarPilot's effective ceiling (0.004 raw clip × 0.30 fixed gain = 0.0012), below the 0.002 clip budget. At the default strength of 0.3 this cap never engages (0.004 × 0.3 = 0.0012 < 0.0015) — it only bites at gain ≥ ~0.4, so it can't interfere with default-setting testing. The constant is a proposal: raise it freely while tuning (anything ≥ 0.004 makes it a no-op).
Stacked on #179 — merge that first and this diff shrinks to two module lines plus six test assertions.
Verification
Unit tests only — not road-tested (car is down). Existing suite updated for the capped ceiling; 25/25 pass.