Skip to content

Commit

Permalink
clean up car specific a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Oct 2, 2024
1 parent e3f67a6 commit aad8f9b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions selfdrive/car/car_specific.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,10 @@ def update(self, CS: CarStateBase, CS_prev: car.CarState, CC_prev: car.CarContro
elif self.CP.carName == 'nissan':
events = self.create_common_events(CS.out, CS_prev, extra_gears=[GearShifter.brake])

if CS.lkas_enabled: # type: ignore[attr-defined]
events.add(EventName.invalidLkasSetting)

elif self.CP.carName == 'mazda':
events = self.create_common_events(CS.out, CS_prev)

if CS.lkas_disabled: # type: ignore[attr-defined]
events.add(EventName.lkasDisabled)
elif CS.low_speed_alert: # type: ignore[attr-defined]
if not CS.out.invalidLkasSetting and CS.low_speed_alert: # type: ignore[attr-defined]
events.add(EventName.belowSteerSpeed)

elif self.CP.carName == 'chrysler':
Expand Down Expand Up @@ -211,6 +206,8 @@ def create_common_events(self, CS: structs.CarState, CS_prev: car.CarState, extr
events.add(EventName.gasPressedOverride)
if CS.vehicleSensorsInvalid:
events.add(EventName.vehicleSensorsInvalid)
if CS.invalidLkasSetting:
events.add(EventName.invalidLkasSetting)

# Handle button presses
for b in CS.buttonEvents:
Expand Down

0 comments on commit aad8f9b

Please sign in to comment.