Files
StarPilot/openpilot/starpilot/car/ford/longitudinal_preferences.py
T
alan-polk 8da0c9d916 Ford: remove the interim BluePilot port; AOL on the stock profiles
StarPilot's angle-only bluepilot_lateral adaptation and the BluePilot-derived curvature strategies (Mach-E,
classic, Explorer, generic CAN FD, new-port curvature, manual-turn latch, curvature preview, pinion
measurement) are removed, with their extended safety profiles 16/32/64 and the interim angle word 128. Ford
lateral is upstream's stock curvature path until the BluePilot lateral library is mounted.

StarPilot's own Ford features stay, re-keyed from the extended words to the stock ones:
- AOL: classic 32 -> 0, Mach-E 18 and the CAN FD trucks 66 -> 2 (+1 with openpilot long); the CAN FD
  retained-display rules apply to word 2. Edge/Mondeo/Transit and the manual bit (256) are unchanged.
- release CAN FD long: word 3 (was 19/67); 19 and 67 are now retired and denied.
- stock cruise switch, CAN FD camera-lead radar handling, hands-free cluster: keyed on the Ford family.
- classic stock ACC (0) keeps the no-ACCDATA TX list the extended classic profile had.

Bits 9-14 of the Ford param are reserved for the BluePilot lateral library's startup bits
(safety/modes/ford_param.h); AOL and pandad mask them out of the profile word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:49:32 -05:00

27 lines
1.2 KiB
Python

"""Exact Ford release opt-in before parser/controller construction."""
from opendbc.car.ford.aol import qualified, aol_safety_config
from openpilot.starpilot.saved_source import read_saved
def prepare_release_long(cp, params, *, is_release, enabled):
if not is_release or not enabled or cp.brand != 'ford':
return cp
try:
if (cp.alternativeExperience != 0 or not qualified(cp) or not cp.alphaLongitudinalAvailable or
cp.openpilotLongitudinalControl or read_saved(params, 'AlphaLongitudinalEnabled', 8) != (b'1', True) or
read_saved(params, 'SafeMode', 8) not in ((None, True), (b'0', True))):
return cp
candidate = cp.as_reader().as_builder()
aol_safety_config(candidate).safetyParam |= 1
candidate.openpilotLongitudinalControl = True
return candidate if qualified(candidate) else cp
except (AttributeError, OSError, TypeError, ValueError, OverflowError, IndexError):
return cp
def release_long_available(cp):
try:
return bool(cp is not None and cp.brand == 'ford' and cp.alphaLongitudinalAvailable and qualified(cp))
except (AttributeError, TypeError, ValueError, OverflowError, IndexError):
return False