mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-08 05:23:41 +08:00
80fbb4f6db
Register vehicle controls, planner modes, UI actions and Galaxy services after their providers exist. Wire the shared runtime entrypoints and cover their combined behavior. Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Daniel Koepping <elkoled@gmail.com> Co-authored-by: Danny <dannyirwin31@yahoo.com> Co-authored-by: DimitriChrysafis <Dimitri.chrysafis@gmail.com> Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com> Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com> Co-authored-by: Kacper Rączy <gfw.kra@gmail.com> Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu> Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com> Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com> Co-authored-by: stef <19478336+stefpi@users.noreply.github.com> Co-authored-by: whoisdomi <dcantu83@gmail.com> Co-authored-by: Intelli <contact@intelli.software> Co-authored-by: haraschax <6804392+haraschax@users.noreply.github.com> Co-authored-by: prabhaavp <prabhaav@msu.edu>
31 lines
1.2 KiB
Python
31 lines
1.2 KiB
Python
from types import SimpleNamespace as NS
|
|
|
|
import pytest
|
|
|
|
from openpilot.starpilot.aol.runtime import decide_axes
|
|
from openpilot.starpilot.aol.tests.test_ioniq_availability import car_state
|
|
|
|
|
|
@pytest.mark.parametrize('speed', [-0.002, 0.0, 0.002])
|
|
@pytest.mark.parametrize('threshold', [0.0, 1.0])
|
|
@pytest.mark.parametrize('grant', [False, True])
|
|
def test_zero_disables_speed_pause_without_granting_native_or_longitudinal(speed, threshold, grant):
|
|
state = car_state()
|
|
state.vEgo, state.brakePressed, state.standstill = speed, True, False
|
|
result = decide_axes(
|
|
standard_lateral=False,
|
|
standard_longitudinal=False,
|
|
intent=NS(allowedLatch=True, pauseLateral=False, pauseLongitudinal=True),
|
|
native=NS(requestedLateral=True, lateralAllowed=grant, requestedLongitudinal=False, longitudinalAllowed=False),
|
|
car_state=state,
|
|
initialized=True,
|
|
model_ready=True,
|
|
no_entry=False,
|
|
immediate_disable=False,
|
|
dm_lockout=False,
|
|
pause_brake_mps=threshold,
|
|
)
|
|
assert result.desired_lateral == (threshold == 0.0)
|
|
assert result.lateral_active == (threshold == 0.0 and grant)
|
|
assert not result.desired_longitudinal and not result.longitudinal_active
|