Skip to content

Commit

Permalink
Fix lane change detection when ALT_LAMPS are used.
Browse files Browse the repository at this point in the history
This is needed for the Kia Caravan '25.
  • Loading branch information
ccdunder committed Dec 19, 2024
1 parent 8614cb8 commit 00f2641
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions opendbc/car/hyundai/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,11 @@ def update_canfd(self, can_parsers) -> structs.CarState:
ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > self.params.STEER_THRESHOLD, 5)
ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0

# TODO: alt signal usage may be described by cp.vl['BLINKERS']['USE_ALT_LAMP']
left_blinker_sig, right_blinker_sig = "LEFT_LAMP", "RIGHT_LAMP"
if self.CP.carFingerprint == CAR.HYUNDAI_KONA_EV_2ND_GEN:
left_blinker_sig, right_blinker_sig = "LEFT_LAMP_ALT", "RIGHT_LAMP_ALT"
left_blinker_sig, right_blinker_sig = (
("LEFT_LAMP_ALT", "RIGHT_LAMP_ALT")
if cp.vl['BLINKERS']['USE_ALT_LAMP']
else ("LEFT_LAMP", "RIGHT_LAMP")
)
ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][left_blinker_sig],
cp.vl["BLINKERS"][right_blinker_sig])
if self.CP.enableBsm:
Expand Down

0 comments on commit 00f2641

Please sign in to comment.