Always On Lateral

Co-Authored-By: Jacob Pfeifer <jacob@pfeifer.dev>
This commit is contained in:
James
2025-12-01 12:00:00 -07:00
parent aa47ad829f
commit c8ba3e3b9e
49 changed files with 372 additions and 22 deletions
+1 -1
View File
@@ -552,7 +552,7 @@ class SelfdriveD:
CS = self.data_sample()
self.update_events(CS)
if not self.CP.passive and self.initialized:
self.enabled, self.active = self.state_machine.update(self.events, self.frogpilot_events)
self.enabled, self.active = self.state_machine.update(self.events, self.frogpilot_events, self.sm['frogpilotCarState'].alwaysOnLateralEnabled)
self.update_alerts(CS)
self.publish_selfdriveState(CS)
+2 -2
View File
@@ -16,7 +16,7 @@ class StateMachine:
self.state = State.disabled
self.soft_disable_timer = 0
def update(self, events: Events, frogpilot_events: Events):
def update(self, events: Events, frogpilot_events: Events, alwaysOnLateralEnabled: bool):
# decrement the soft disable timer at every step, as it's reset on
# entrance in SOFT_DISABLING state
self.soft_disable_timer = max(0, self.soft_disable_timer - 1)
@@ -94,7 +94,7 @@ class StateMachine:
# Check if openpilot is engaged and actuators are enabled
enabled = self.state in ENABLED_STATES
active = self.state in ACTIVE_STATES
if active:
if active or alwaysOnLateralEnabled:
self.current_alert_types.append(ET.WARNING)
return enabled, active