Skip to content

tesla_preap: chime pedal cruise on enableLongControl edges - #27

Closed
daggerhashjack wants to merge 3 commits into
nap-devfrom
cursor/pedal-chime-long-control-c99e
Closed

daggerhashjack wants to merge 3 commits into
nap-devfrom
cursor/pedal-chime-long-control-c99e

Conversation

@daggerhashjack

Copy link
Copy Markdown

Description

Pedal engage/disengage chimes were keyed off update_pedal_cruise_session, which stays true while cruiseEnabled after the first authority accept. Brake or first-pull drops enableLongControl and keeps cruise, so the session never went 1→0 and pedalCruiseDisabled never fired. Re-engaging long while cruise was already on never went 0→1 either.

5570441 correctly stopped chiming gas override (authority drop / pedal-up). The session latch was too wide.

This binds pedalCruiseEnabled / pedalCruiseDisabled to enableLongControl edges:

  • Double-pull long-on (enableLongControl 0→1) → engage chime
  • Brake or first-pull to lat-only (enableLongControl 1→0, cruise stays) → disengage chime
  • Gas override / pedal-up: enableLongControl stays true → no extra chime (OVERRIDE prompt unchanged)
  • Full cancel then re-engage still chimes

Companion opendbc PR publishes CarState.enableLongControl (FSM flag, not interceptor authority).

Verification

Unit tests in selfdrive/selfdrived/tests/test_preap_regen.py:

  • brake/single-pull → lat-only fires disengage
  • double-pull long-on fires engage
  • pedal override does not use pedal-up as engage
  • full off then on still works

Files / events

  • selfdrive/selfdrived/preap_regen.py — pedal_long_chime replaces update_pedal_cruise_session
  • selfdrive/selfdrived/selfdrived.py — fires existing pedalCruiseEnabled / pedalCruiseDisabled
  • opendbc_repo bump — CarState.enableLongControl
  • Events unchanged: pedalCruiseEnabled, pedalCruiseDisabled

No DAS spoof. No naponsp-dev / Sunny EPAS. No AGNOS / 0.11.1 merge.

Open in Web Open in Cursor 

cursoragent and others added 3 commits August 29, 2026 02:07
Session-based chimes stayed armed while cruiseEnabled, so brake and
first-pull to lat-only never played pedalCruiseDisabled, and re-engaging
long never played pedalCruiseEnabled. Bind those events to the FSM
long-control flag. Gas override still does not chime on pedal-up.

Co-authored-by: Daggerhashimoto <daggerhashjack@users.noreply.github.com>
Point at the CarState field plus the drive/doors fixture so
check_can_engage does not clear the FSM flag before publish.

Co-authored-by: Daggerhashimoto <daggerhashjack@users.noreply.github.com>
The NAP fixture policy is an attested hash. Adding a CarState field
broke every fixture_tool unit test. Chimes read the live FSM flag;
old fixtures defaulting to false is fine.

Co-authored-by: Daggerhashimoto <daggerhashjack@users.noreply.github.com>
@daggerhashjack
daggerhashjack marked this pull request as ready for review August 29, 2026 02:24
@daggerhashjack
daggerhashjack requested a review from SloPOS as a code owner August 29, 2026 02:24
@daggerhashjack

Copy link
Copy Markdown
Author

Already on nap-dev via the session latch (PR #26). Closing.

@daggerhashjack
daggerhashjack deleted the cursor/pedal-chime-long-control-c99e branch August 29, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants