mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-20 20:32:06 +08:00
Chrysler: never drop control bit on older models (#25159)
* Chrysler: never drop control bit on older models * update refs
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 RAM_CARS, CarControllerParams
|
||||
from selfdrive.car.chrysler.values import CAR, RAM_CARS, CarControllerParams
|
||||
|
||||
|
||||
class CarController:
|
||||
@@ -20,11 +20,22 @@ class CarController:
|
||||
self.packer = CANPacker(dbc_name)
|
||||
self.params = CarControllerParams(CP)
|
||||
|
||||
def update(self, CC, CS, low_speed_alert):
|
||||
def update(self, CC, CS):
|
||||
can_sends = []
|
||||
|
||||
# TODO: can we make this more sane? why is it different for all the cars?
|
||||
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):
|
||||
if CS.out.vEgo < (self.CP.minSteerSpeed - 3.0):
|
||||
lkas_control_bit = False
|
||||
elif self.CP.carFingerprint in RAM_CARS:
|
||||
if CS.out.vEgo < (self.CP.minSteerSpeed - 0.5):
|
||||
lkas_control_bit = False
|
||||
|
||||
# EPS faults if LKAS re-enables too quickly
|
||||
lkas_control_bit = not low_speed_alert and (self.frame - self.last_lkas_falling_edge > 200)
|
||||
lkas_control_bit = lkas_control_bit and (self.frame - self.last_lkas_falling_edge > 200)
|
||||
lkas_active = CC.latActive and self.lkas_control_bit_prev
|
||||
|
||||
# *** control msgs ***
|
||||
|
||||
@@ -93,4 +93,4 @@ class CarInterface(CarInterfaceBase):
|
||||
return ret
|
||||
|
||||
def apply(self, c):
|
||||
return self.CC.update(c, self.CS, self.low_speed_alert)
|
||||
return self.CC.update(c, self.CS)
|
||||
|
||||
@@ -1 +1 @@
|
||||
7fbe776f271ed2d45abe989736133a5cfa0ec826
|
||||
fa52fa6c6703269e23610b1c6aba8a56b911fbbb
|
||||
Reference in New Issue
Block a user