Skip to content

mazda: read invalidLkasSetting from the camera's intervention bits - #13

Open
mzdnick wants to merge 2 commits into
zoompilot:developfrom
mzdnick:mazda-lkas-setting-alert
Open

mzdnick wants to merge 2 commits into
zoompilot:developfrom
mzdnick:mazda-lkas-setting-alert

Conversation

@mzdnick

@mzdnick mzdnick commented Sep 13, 2026

Copy link
Copy Markdown

Problem

  • With lane keep switched off in the vehicle settings, the EPS echoes the steering request and applies none of it: no block, no fault. Nothing on the bus named the setting.
  • LANE_LINES == 0 (CarState: add invalidLkasSetting commaai/opendbc#1325, left with a "TODO: is this needed?") is not needed. It reads zero in sustained stretches at road speed while steering is delivered. An unmarked road is not an invalid setting.

Fix

  • CAM_SETTINGS (0x485) carries the setting: both intervention bits are set while lane keep is on and clear when it is off. Either bit clear raises invalidLkasSetting, keeping the existing alert and no-entry gate.
  • Arrival is latched once and the parser's held values are read, no freshness window: the flag stays steady between arrivals and a car that never sends the message never reads as off. NaN default, outside canValid.

Validation

  • affected: the menu-off capture holds both bits clear for the whole drive; the flag stays steady through silent cycles.
  • affected: setting-on corpus, 3 cars, 95 min, 53k frames: both bits set on 100% of frames, including button-off drives.
  • control: LANE_LINES-only zero stretches no longer flag; pinned by test.
  • control: a car that never sends CAM_SETTINGS reads valid; pinned by test.
  • mazda tests: 546 Mazda tests pass; new tests pin the mapping, hold-through-silence, mixed bits, and the LANE_LINES regression.
  • device test: validated feature works as intended; toggling Mazda lane assist setting displays an alert that clears immediately when re-enabled. LKAS toggle on dash unaffected, no alert with LKAS disabled.

AI Usage

Disclaimer: GLM-5.3 by Z.ai was used to help develop, debug, and document this
submission. All changes were reviewed and validated by a human.

@mzdnick
mzdnick force-pushed the mazda-lkas-setting-alert branch 2 times, most recently from 3bdde9e to e2b3255 Compare September 13, 2026 23:36
@mzdnick
mzdnick marked this pull request as ready for review September 14, 2026 05:48
@mzdnick
mzdnick force-pushed the mazda-lkas-setting-alert branch 3 times, most recently from dc8c945 to f7986ef Compare September 14, 2026 10:20
@mzdnick mzdnick changed the title mazda: raise invalidLkasSetting while LKAS_EFFECTIVE stays zero under request mazda: read invalidLkasSetting from the camera's intervention bits Sep 14, 2026
@mzdnick
mzdnick force-pushed the mazda-lkas-setting-alert branch 5 times, most recently from 8afc4b6 to e5eba71 Compare September 15, 2026 15:53
Issue: a settings-menu or camera state can leave the EPS taking our
steer request and applying none of it, with no block or fault.
Fix: detect the silent zero-delivery in CarState and raise
invalidLkasSetting; gate the detection on the steer-to-zero EPS;
drop the LANE_LINES term it superseded.

Superseded by the next commit, which reads the camera's own
intervention bits instead.

Validation: 552 tests on this tree; delivery measured on routes
(LKAS_EFFECTIVE tracks the request when healthy).
CAM_SETTINGS.LKAS_INERVENTION_ON1 and ILKAS_NTERVENTION_ON2 clear together when the lane assist is off
@mzdnick
mzdnick force-pushed the mazda-lkas-setting-alert branch from e5eba71 to 71d2f21 Compare September 15, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant