From 80d8d3a2d2de5ffa046f375a46a1ddf06ba6fbad Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sat, 11 May 2024 00:08:31 -0700 Subject: [PATCH] move stateless, common car events to car interface --- selfdrive/car/interfaces.py | 4 ++++ selfdrive/controls/controlsd.py | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index b6a626edec..a8a6f0b238 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -282,6 +282,10 @@ class CarInterfaceBase(ABC): events.add(EventName.accFaulted) if cs_out.steeringPressed: events.add(EventName.steerOverride) + if cs_out.brakePressed and cs_out.standstill: + events.add(EventName.preEnableStandstill) + if cs_out.gasPressed: + events.add(EventName.gasPressedOverride) # Handle button presses for b in cs_out.buttonEvents: diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index d36c969f60..370a3e1e95 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -211,12 +211,6 @@ class Controls: (CS.regenBraking and (not self.CS_prev.regenBraking or not CS.standstill)): self.events.add(EventName.pedalPressed) - if CS.brakePressed and CS.standstill: - self.events.add(EventName.preEnableStandstill) - - if CS.gasPressed: - self.events.add(EventName.gasPressedOverride) - if not self.CP.notCar: self.events.add_from_msg(self.sm['driverMonitoringState'].events)