Skip to content

Handle stock AEB and active steering avoidance by disengaging ope… - #406

Merged
ajouatom merged 1 commit into
ajouatom:c3-wipfrom
navipilot:c3-wip
Jun 20, 2026
Merged

ajouatom merged 1 commit into
ajouatom:c3-wipfrom
navipilot:c3-wip

Conversation

@navipilot

Copy link
Copy Markdown
Contributor
Handle stock AEB and active steering avoidance by disengaging openpilot                                                                  
                                                                                                                                         
- 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      

                                                                                                                                             
    - 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
Copilot AI review requested due to automatic review settings June 20, 2026 10:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
Comment thread selfdrive/car/car_specific.py
@ajouatom
ajouatom merged commit e0409b6 into ajouatom:c3-wip Jun 20, 2026
4 of 15 checks passed
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)
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.

3 participants