mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-19 03:42:05 +08:00
Chrysler: fix LKAS fault for 2017 Pacifica (#26711)
* gate on FW * fix * reverse docs * fix * Revert "fix" This reverts commit a0f2558fba0adc59c70eb92ffb8bd815bf033979. Revert "reverse docs" This reverts commit 9a46c517dfa7182f2f30501de801e35f7e1004c4. Revert "fix" This reverts commit 7b4d4bd3d2c2216890ea1877d52fdfbd9cec3ed7. Revert "gate on FW" This reverts commit 296826e71323e63f8e57b8988e573cef33149022. * use a flag * fix * draft * clean up * clean up * more clear * comment * remove
This commit is contained in:
@@ -2,7 +2,7 @@ from opendbc.can.packer import CANPacker
|
||||
from common.realtime import DT_CTRL
|
||||
from selfdrive.car import apply_toyota_steer_torque_limits
|
||||
from selfdrive.car.chrysler.chryslercan import create_lkas_hud, create_lkas_command, create_cruise_buttons
|
||||
from selfdrive.car.chrysler.values import CAR, RAM_CARS, CarControllerParams
|
||||
from selfdrive.car.chrysler.values import RAM_CARS, CarControllerParams, ChryslerFlags
|
||||
|
||||
|
||||
class CarController:
|
||||
@@ -51,7 +51,7 @@ class CarController:
|
||||
lkas_control_bit = self.lkas_control_bit_prev
|
||||
if CS.out.vEgo > self.CP.minSteerSpeed:
|
||||
lkas_control_bit = True
|
||||
elif self.CP.carFingerprint in (CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020, CAR.JEEP_CHEROKEE_2019):
|
||||
elif self.CP.flags & ChryslerFlags.HIGHER_MIN_STEERING_SPEED:
|
||||
if CS.out.vEgo < (self.CP.minSteerSpeed - 3.0):
|
||||
lkas_control_bit = False
|
||||
elif self.CP.carFingerprint in RAM_CARS:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from cereal import car
|
||||
from panda import Panda
|
||||
from selfdrive.car import STD_CARGO_KG, get_safety_config
|
||||
from selfdrive.car.chrysler.values import CAR, DBC, RAM_HD, RAM_DT
|
||||
from selfdrive.car.chrysler.values import CAR, DBC, RAM_HD, RAM_DT, RAM_CARS, ChryslerFlags
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
|
||||
|
||||
@@ -24,9 +24,12 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_CHRYSLER_RAM_DT
|
||||
|
||||
ret.minSteerSpeed = 3.8 # m/s
|
||||
if candidate in (CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020, CAR.JEEP_CHEROKEE_2019):
|
||||
# TODO: allow 2019 cars to steer down to 13 m/s if already engaged.
|
||||
ret.minSteerSpeed = 17.5 # m/s 17 on the way up, 13 on the way down once engaged.
|
||||
if candidate not in RAM_CARS:
|
||||
# Newer FW versions standard on the following platforms, or flashed by a dealer onto older platforms have a higher minimum steering speed.
|
||||
new_eps_platform = candidate in (CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020, CAR.JEEP_CHEROKEE_2019)
|
||||
new_eps_firmware = any(fw.ecu == 'eps' and fw.fwVersion[:4] >= b"6841" for fw in car_fw)
|
||||
if new_eps_platform or new_eps_firmware:
|
||||
ret.flags |= ChryslerFlags.HIGHER_MIN_STEERING_SPEED.value
|
||||
|
||||
# Chrysler
|
||||
if candidate in (CAR.PACIFICA_2017_HYBRID, CAR.PACIFICA_2018, CAR.PACIFICA_2018_HYBRID, CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020):
|
||||
@@ -55,10 +58,9 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.mass = 2493. + STD_CARGO_KG
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
ret.minSteerSpeed = 14.5
|
||||
if car_fw is not None:
|
||||
for fw in car_fw:
|
||||
if fw.ecu == 'eps' and fw.fwVersion[:8] in (b"68312176", b"68273275"):
|
||||
ret.minSteerSpeed = 0.
|
||||
for fw in car_fw:
|
||||
if fw.ecu == 'eps' and fw.fwVersion.startswith((b"68312176", b"68273275")):
|
||||
ret.minSteerSpeed = 0.
|
||||
|
||||
elif candidate == CAR.RAM_HD:
|
||||
ret.steerActuatorDelay = 0.2
|
||||
@@ -71,6 +73,10 @@ class CarInterface(CarInterfaceBase):
|
||||
else:
|
||||
raise ValueError(f"Unsupported car: {candidate}")
|
||||
|
||||
if ret.flags & ChryslerFlags.HIGHER_MIN_STEERING_SPEED:
|
||||
# TODO: allow these cars to steer down to 13 m/s if already engaged.
|
||||
ret.minSteerSpeed = 17.5 # m/s 17 on the way up, 13 on the way down once engaged.
|
||||
|
||||
ret.centerToFront = ret.wheelbase * 0.44
|
||||
ret.enableBsm = 720 in fingerprint[0]
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from enum import IntFlag
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from typing import Dict, List, Optional, Union
|
||||
@@ -11,6 +12,10 @@ from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, p16
|
||||
Ecu = car.CarParams.Ecu
|
||||
|
||||
|
||||
class ChryslerFlags(IntFlag):
|
||||
HIGHER_MIN_STEERING_SPEED = 1
|
||||
|
||||
|
||||
class CAR:
|
||||
# Chrysler
|
||||
PACIFICA_2017_HYBRID = "CHRYSLER PACIFICA HYBRID 2017"
|
||||
|
||||
Reference in New Issue
Block a user