Keep unarmed startup steering restrictions from displaying takeover warnings

This commit is contained in:
firestar5683
2026-10-29 15:49:53 -05:00
parent 85997f719f
commit 2800e5b452
3 changed files with 39 additions and 2 deletions
+1 -1
View File
@@ -2135,7 +2135,7 @@ class SelfdriveD:
if ET.WARNING not in self.state_machine.current_alert_types:
self.state_machine.current_alert_types.append(ET.WARNING)
if (getattr(self, 'aol_fault_reason', 'none') == 'availabilityPause' and
(self.CP.brand != 'ford' or self.enabled or intent is not None and intent.allowedLatch) and
(self.enabled or intent is not None and intent.allowedLatch) and
ET.WARNING not in self.state_machine.current_alert_types):
self.state_machine.current_alert_types.append(ET.WARNING)
axis_published = bool(not REPLAY and self.aol_replay and self.axis_transport_required)
@@ -0,0 +1,37 @@
from contextlib import ExitStack
import pytest
from openpilot.cereal import log
from openpilot.common.prefix import OpenpilotPrefix
from openpilot.starpilot.aol.tests import test_ioniq_availability as fixture
from opendbc.car import structs
from opendbc.car.hyundai.values import CAR
@pytest.mark.parametrize('profile', [False, CAR.HYUNDAI_IONIQ_5_PE, CAR.KIA_EV9], ids=['ioniq6', 'ioniq5pe', 'ev9'])
def test_unarmed_parked_temporary_eps_keeps_fault_without_warning(profile):
case = fixture.IoniqAvailabilityTests(methodName='runTest')
with ExitStack() as cleanup:
cleanup.callback(case.doCleanups)
cleanup.enter_context(OpenpilotPrefix())
sd, _, step, _, _ = case._ioniq_availability_callers(full_op=False, initially_armed=False, stock_angle=profile)
parked = fixture.car_state()
parked.gearShifter = structs.CarState.GearShifter.park
parked.vEgo = parked.vEgoRaw = 0.
parked.standstill = parked.steerFaultTemporary = True
for tick in range(2, 32):
axis, state, command = step(tick, observed_state=parked, native_request_lat=False,
native_request_long=False, allowed=False)
assert sd.CS_prev.steerFaultTemporary
assert log.OnroadEvent.EventName.steerTempUnavailableSilent in sd.events.names
assert not axis.lateralActive and not axis.longitudinalActive
assert not command.latActive and not command.longActive and not command.enabled
assert state.alertType != 'steerTempUnavailableSilent/warning', 'UNARMED_PARKED_EPS_WARNING'
parked.steerFaultTemporary = False
for tick in range(32, 45):
_, state, command = step(tick, observed_state=parked, native_request_lat=False,
native_request_long=False, allowed=False)
assert log.OnroadEvent.EventName.steerTempUnavailableSilent not in sd.events.names
assert not command.latActive and not command.longActive
assert state.alertType != 'steerTempUnavailableSilent/warning'
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "c3e01d80eff2b69cad37bab0e35e0ee5cef040205d73aae08752c4838b04a9ae", "schema_version": 1}
{"protected_inventory_sha256": "49f8fb7f0c1b26ca19559566538c2c94d1c5e270d8163e5e2356de0a4621cea3", "schema_version": 1}