controlsd: suppress freq-only cascade; modeld: variable rate w/ republish cache
Some checks failed
prebuilt / build prebuilt (push) Has been cancelled
badges / create badges (push) Has been cancelled

- commIssue now fires only on real comms failure (not_alive or CAN RX
  timeout), not on self-declared valid=False cascades from MSGQ-conflate +
  slow-polling freq_ok artifacts. Car drives fine through these and the
  banner was false-positive.
- Add 5-cycle hysteresis (50ms) on commIssue / posenetInvalid /
  locationdTemporaryError / paramsdTemporaryError.
- Cascade-aware suppression: skip posenet/locationd/paramsd temporary
  errors when the only problem is freq_only_cascade (all alive, just
  freq/valid tripped).
- Remove debug _dbg_dump_alert_triggers helper and EVENTS/EVENT_NAME
  imports.
- Re-enable variable-rate modeld (4/10fps idle, 20fps when lat_active /
  lane_changing / calibrating) with republish caching so consumers get
  constant publish rate.
- Split lat_requested (modeld signal) from lat_engaged (actuator gate).
  Momentary steerFaultTemporary no longer drops modeld rate, preventing
  stale-prediction feedback loop on MDPS recovery. CC.latActive still
  respects the fault.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-17 21:11:52 -05:00
parent e86eafde15
commit ba4176ffd0
2 changed files with 67 additions and 111 deletions

View File

@@ -246,19 +246,19 @@ def main(demo=False):
sm.update(0)
# CLEARPILOT: reverted to two modes only — constant 20fps while moving, standby at
# standstill. Variable-rate (4/10fps) caused downstream freq/valid cascades that
# broke paramsd's angleOffset learner, calibrationd, and locationd's filter init.
# Keep the signals plumbed through frogpilotCarControl for when we re-enable.
# CLEARPILOT: variable framerate — 4/10fps when not engaged, 20fps when engaged
# (or lane changing / calibrating). Downstream services get a constant publish rate
# via the republish-caching below — only the GPU inference is skipped, so no
# freq_ok cascade in consumers.
fpcc = sm['frogpilotCarControl']
lat_active = fpcc.latRequested # noqa: F841
lane_changing = fpcc.noLatLaneChange # noqa: F841
lat_active = fpcc.latRequested
lane_changing = fpcc.noLatLaneChange
standstill = sm['carState'].standstill
calibrating = sm['liveCalibration'].calStatus != log.LiveCalibrationData.Status.calibrated # noqa: F841
full_rate = True # always 20fps when not standstill
calibrating = sm['liveCalibration'].calStatus != log.LiveCalibrationData.Status.calibrated
full_rate = lat_active or lane_changing or calibrating
# Standby transitions: standstill → 0fps (parked), otherwise → 20fps
should_standby = standstill
# Standby transitions (standstill only, when not at full rate)
should_standby = standstill and not full_rate
if should_standby and not model_standby:
params_memory.put_bool("ModelStandby", True)
model_standby = True