Repository navigation
Handle stock AEB and active steering avoidance by disengaging ope… - #406
Merged
Merged
Conversation
navipilot
commented
Jun 20, 2026
Contributor
- Detect stock AEB (DAS_aebEvent) and trigger PERMANENT alert + safety layer
blocking longitudinal commands
- Detect stock steering control (DAS_steeringControlType != NONE) and block
lateral commands at the panda safety layer, unconditionally respecting
DAS emergency evasive steering
- Both mechanisms act as a hardware-level safety firewall
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Tesla port’s safety handling by detecting and reacting to stock safety interventions (notably AEB and stock steering control) to prevent openpilot actuation from conflicting with OEM behavior. It also adds Tesla-specific platform/config updates (FSD 14 flagging, Model X docs/flagging) and introduces new vehicle-bus features (3-finger press -> ExperimentalMode toggle and blinker MITM via DAS_bodyControls).
Changes:
- Add panda safety “firewall” behaviors for Tesla: block openpilot longitudinal during stock AEB, block lateral during stock steering control, and block TX during Summon/Autopark.
- Add Tesla FSD 14 support via FW-based flagging and safety param propagation (including flipped steering control type handling).
- Add vehicle-bus integrations: 3-finger infotainment press mapped to LKAS button events and a DAS_bodyControls-based blinker MITM path.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| selfdrive/car/car_specific.py | Adds Tesla-only ExperimentalMode toggle triggered via LKAS button events. |
| opendbc_repo/opendbc/safety/safety/safety_tesla.h | Implements stock AEB / stock steering conflict detection, Summon blocking, FSD14 control-type flipping, and allows TX of DAS_bodyControls. |
| opendbc_repo/opendbc/car/tesla/values.py | Adds Tesla Model X docs entry, new Tesla flags (FSD_14, vehicle bus/body controls), and FW list for FSD 14 detection. |
| opendbc_repo/opendbc/car/tesla/teslacan.py | Adds FSD14-aware steering control type selection; adds longitudinal setSpeed/jerk ramping; adds DAS_bodyControls message crafting for blinkers. |
| opendbc_repo/opendbc/car/tesla/interface.py | Detects FSD14 by EPS FW, sets safetyParam/flags, and detects presence of vehicle bus / body controls via fingerprint. |
| opendbc_repo/opendbc/car/tesla/fingerprints.py | Extends known EPS FW versions and adds Tesla Model X EPS FW versions. |
| opendbc_repo/opendbc/car/tesla/carstate.py | Adds Summon state tracking, broader DAS cancel detection -> cancel button event, FSD14 suspicion logic, body controls raw capture, and 3-finger press -> LKAS button event generation. |
| opendbc_repo/opendbc/car/tesla/carcontroller.py | Uses DAS cancel state, adds optional blinker MITM transmission on vehicle bus aligned to stock DAS_bodyControls counter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
91
to
95
| if (bus == 2) { | ||
| if (tesla_longitudinal && (addr == 0x2b9)) { | ||
| // "AEB_ACTIVE" | ||
| tesla_stock_aeb = (GET_BYTE(to_push, 2) & 0x03U) == 1U; | ||
| } |
Comment on lines
+286
to
+288
| // we used to assume Summon on startup; instead we tolerate a short | ||
| // window without TX (DI_state comes at 10 Hz). Panda safety will | ||
| // reject TX until the first DI_state message clears tesla_summon. |
Comment on lines
268
to
273
| static const CanMsg TESLA_M3_Y_TX_MSGS[] = { | ||
| {0x488, 0, 4}, // DAS_steeringControl | ||
| {0x2b9, 0, 8}, // DAS_control | ||
| {0x27D, 0, 3}, // APS_eacMonitor | ||
| {0x3E9, 1, 8}, // DAS_bodyControls (blinker on vehicle bus) | ||
| }; |
Comment on lines
+114
to
+117
| # FSD disengages on strong user override (handsOnLevel >= 3) or high angle rate faults (fast override, high speed) | ||
| eac_error_code = self.can_define.dv["EPAS3S_sysStatus"]["EPAS3S_eacErrorCode"].get(int(epas_status["EPAS3S_eacErrorCode"]), None) | ||
| self.steering_disengage = self.hands_on_level >= 3 or (eac_status == "EAC_INHIBITED" and | ||
| eac_error_code == "EAC_ERROR_HIGH_ANGLE_RATE_SAFETY") |
ajouatom
pushed a commit
that referenced
this pull request
Jun 20, 2026
…lot (#406) - Detect stock AEB (DAS_aebEvent) and trigger PERMANENT alert + safety layer blocking longitudinal commands - Detect stock steering control (DAS_steeringControlType != NONE) and block lateral commands at the panda safety layer, unconditionally respecting DAS emergency evasive steering - Both mechanisms act as a hardware-level safety firewall
ajouatom
pushed a commit
that referenced
this pull request
Jun 20, 2026
…lot (#406) - Detect stock AEB (DAS_aebEvent) and trigger PERMANENT alert + safety layer blocking longitudinal commands - Detect stock steering control (DAS_steeringControlType != NONE) and block lateral commands at the panda safety layer, unconditionally respecting DAS emergency evasive steering - Both mechanisms act as a hardware-level safety firewall
happymaj11r
pushed a commit
that referenced
this pull request
Jun 20, 2026
…lot (#406) - Detect stock AEB (DAS_aebEvent) and trigger PERMANENT alert + safety layer blocking longitudinal commands - Detect stock steering control (DAS_steeringControlType != NONE) and block lateral commands at the panda safety layer, unconditionally respecting DAS emergency evasive steering - Both mechanisms act as a hardware-level safety firewall (cherry picked from commit 9126487)
happymaj11r
pushed a commit
to happymaj11r/openpilot
that referenced
this pull request
Jun 20, 2026
…lot (ajouatom#406) - Detect stock AEB (DAS_aebEvent) and trigger PERMANENT alert + safety layer blocking longitudinal commands - Detect stock steering control (DAS_steeringControlType != NONE) and block lateral commands at the panda safety layer, unconditionally respecting DAS emergency evasive steering - Both mechanisms act as a hardware-level safety firewall (cherry picked from commit 9126487)
happymaj11r
pushed a commit
to happymaj11r/openpilot
that referenced
this pull request
Jun 25, 2026
…lot (ajouatom#406) - Detect stock AEB (DAS_aebEvent) and trigger PERMANENT alert + safety layer blocking longitudinal commands - Detect stock steering control (DAS_steeringControlType != NONE) and block lateral commands at the panda safety layer, unconditionally respecting DAS emergency evasive steering - Both mechanisms act as a hardware-level safety firewall (cherry picked from commit e0409b6)
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.