Files
StarPilot/openpilot/starpilot/car/hyundai/button_migration.py
T
firestar5683 2b1152adf7 Hyundai
Integrate vehicle-specific steering, longitudinal control, startup, and handoff policies, including Ioniq, EV9, GV70, and non-SCC configurations. Preserve the corresponding native safety and CAN routing contracts.

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: Intelli <contact@intelli.software>
2026-10-14 20:02:39 -05:00

18 lines
612 B
Python

"""One-time Sonata Hybrid wheel assignment migration."""
import os
from opendbc.car.hyundai.values import CAR
MIGRATION_KEY = 'SonataHybridLKASButtonControlMigrated'
def migrate_lkas_default(cp, params):
if (getattr(cp, 'brand', None) != 'hyundai' or
getattr(cp, 'carFingerprint', None) != CAR.HYUNDAI_SONATA_HYBRID or params.get_bool(MIGRATION_KEY)):
return False
if params.get('LKASButtonControl') is None and not os.path.lexists(params.get_param_path('LKASButtonControl')):
params.put('LKASButtonControl', 9, block=True)
params.put_bool(MIGRATION_KEY, True, block=True)
return True