Skip to content

Commit

Permalink
Chrysler: never drop control bit on older models (#25159)
Browse files Browse the repository at this point in the history
* Chrysler: never drop control bit on older models

* update refs
  • Loading branch information
adeebshihadeh authored Jul 13, 2022
1 parent 18f2a50 commit d571991
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
17 changes: 14 additions & 3 deletions selfdrive/car/chrysler/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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:
Expand All @@ -20,11 +20,22 @@ def __init__(self, dbc_name, CP, VM):
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 ***
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/chrysler/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ def _update(self, c):
return ret

def apply(self, c):
return self.CC.update(c, self.CS, self.low_speed_alert)
return self.CC.update(c, self.CS)
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/ref_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7fbe776f271ed2d45abe989736133a5cfa0ec826
fa52fa6c6703269e23610b1c6aba8a56b911fbbb

0 comments on commit d571991

Please sign in to comment.