Skip to content

mazda: read invalidLkasSetting from camera intervention bits - #13

Open
mzdnick wants to merge 1 commit into
zoompilot:developfrom
mzdnick:mazda-lkas-setting-alert
Open

mzdnick wants to merge 1 commit into
zoompilot:developfrom
mzdnick:mazda-lkas-setting-alert

Conversation

@mzdnick

@mzdnick mzdnick commented Sep 13, 2026

Copy link
Copy Markdown

Problem

  • Lane keep off in the vehicle settings silently disables steering: the EPS echoes the request and applies none of it, no block, no fault.
  • The old LANE_LINES == 0 check (CarState: add invalidLkasSetting commaai/opendbc#1325, "TODO: is this needed?") read zero in sustained stretches at road speed while steering was 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; either bit clear raises invalidLkasSetting, keeping the existing alert and no-entry gate.
  • Arrival is latched once and held values are read, no freshness window: an unsent CAM_SETTINGS decodes as zeros and must not read as off.

Validation

  • affected: the setting-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 zeroes no longer flag; a car that never sends CAM_SETTINGS reads valid. Both pinned by test.
  • mazda tests: 546 pass; new tests pin the mapping, hold-through-silence, mixed bits, and the LANE_LINES regression.
  • device test: toggling the lane assist setting shows the alert and clears it on re-enable; the dash LKAS button does not alert.

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 me.

@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 7 times, most recently from 71d2f21 to ad695ec Compare September 16, 2026 04:01
@mzdnick mzdnick changed the title mazda: read invalidLkasSetting from the camera's intervention bits mazda: read invalidLkasSetting from camera intervention bits Sep 16, 2026
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: CAM_SETTINGS.LKAS_INERVENTION_ON1 and ILKAS_NTERVENTION_ON2
clear together when the lane assist is off; read that in CarState
and raise invalidLkasSetting, replacing the LANE_LINES term. Latch
that the camera sent CAM_SETTINGS once, so a car that never sends
it cannot read as off, and the state holds through the message's
silent cycles.

Validation: mazda car suite 546 passed; ruff clean.
@mzdnick
mzdnick force-pushed the mazda-lkas-setting-alert branch from ad695ec to b58fbc1 Compare September 17, 2026 23:42
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