Skip to content

Commit

Permalink
Ford: detect missing LKAS from EPS configuration (commaai#31821)
Browse files Browse the repository at this point in the history
* debug: disable FW cache

* Ford: detect missing TJA/LCA config and disable LKAS

* set dashcamOnly

* revert

* clean up

* clean up

* some CAN FD do not have 0x01 block for PSCM

* bump cereal (fork)

* remove confusing comment

* add flags/event

* remove duplicate from events

* copy can be next pr

* dashcamOnly if no config comes back either (this shouldn't happen)

* flipped

* can do this

* Revert "can do this"

This reverts commit c3d311b.

* Revert "flipped"

This reverts commit 75c01fb.

* Revert "dashcamOnly if no config comes back either (this shouldn't happen)"

This reverts commit f82624a.

---------

Co-authored-by: Shane Smiskol <[email protected]>
old-commit-hash: 9f327ae
  • Loading branch information
incognitojam and sshane authored May 22, 2024
1 parent 64c4445 commit 513f571
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions selfdrive/car/ford/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):

if ret.flags & FordFlags.CANFD:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_FORD_CANFD
else:
# Lock out if the car does not have needed lateral and longitudinal control APIs.
# Note that we also check CAN for adaptive cruise, but no known signal for LCA exists
pscm_config = next((fw for fw in car_fw if fw.ecu == Ecu.eps and b'\x22\xDE\x01' in fw.request), None)
if pscm_config:
if len(pscm_config.response) != 24:
ret.dashcamOnly = True
else:
config_tja = pscm_config.response[7] # Traffic Jam Assist
config_lca = pscm_config.response[8] # Lane Centering Assist
if config_tja != 0xFF or config_lca != 0xFF:
ret.dashcamOnly = True

# Auto Transmission: 0x732 ECU or Gear_Shift_by_Wire_FD1
found_ecus = [fw.ecu for fw in car_fw]
Expand Down

0 comments on commit 513f571

Please sign in to comment.