Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrysler: never drop control bit on older models #25159

Merged
merged 2 commits into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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