mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 05:53:41 +08:00
Keep the V60 out of the shared CMA/V40 test fixtures
This commit is contained in:
@@ -16,8 +16,9 @@ CMA = ['VOLVO_XC40_RECHARGE', 'VOLVO_S60_RECHARGE', 'POLESTAR_2']
|
||||
EXPECTED = {'VOLVO_V40': (2, 1610, 2.647, 14.7, .2),
|
||||
'VOLVO_XC40_RECHARGE': (0, 2170, 2.702, 15.8, .3),
|
||||
'VOLVO_S60_RECHARGE': (1, 2020, 2.872, 16.2, .3),
|
||||
'POLESTAR_2': (5, 2123, 2.735, 15.8, .3),
|
||||
'VOLVO_V60': (8, 1750, 2.776, 15.0, .2)}
|
||||
'POLESTAR_2': (5, 2123, 2.735, 15.8, .3)}
|
||||
# The V60 (EUCD) only shares the params and fingerprint checks; the shared runtime fixtures model CMA/V40 frames
|
||||
PARAMS = {**EXPECTED, 'VOLVO_V60': (8, 1750, 2.776, 15.0, .2)}
|
||||
|
||||
|
||||
def interface(identity, alpha=False, release=False):
|
||||
@@ -64,14 +65,14 @@ def sources(identity, cruise=True, *, frame=0):
|
||||
return checked
|
||||
|
||||
|
||||
@pytest.mark.parametrize('identity', EXPECTED)
|
||||
@pytest.mark.parametrize('identity', PARAMS)
|
||||
@pytest.mark.parametrize('alpha', [False, True])
|
||||
@pytest.mark.parametrize('release', [False, True])
|
||||
def test_all_final_params_and_angle_factory(identity, alpha, release):
|
||||
from openpilot.selfdrive.controls.lib.lateral_controller_factory import create_lateral_controller
|
||||
from openpilot.selfdrive.controls.lib.latcontrol_angle import LatControlAngle
|
||||
cp, ci = interface(identity, alpha, release)
|
||||
param, mass, wheelbase, ratio, delay = EXPECTED[identity]
|
||||
param, mass, wheelbase, ratio, delay = PARAMS[identity]
|
||||
assert cp.mass == mass + STD_CARGO_KG
|
||||
# These declared CarParams fields are Float32; compare exact wire values.
|
||||
expected_geometry = struct.unpack('<3f', struct.pack('<3f', wheelbase, ratio, delay))
|
||||
@@ -85,7 +86,7 @@ def test_all_final_params_and_angle_factory(identity, alpha, release):
|
||||
assert isinstance(create_lateral_controller(cp, ci, .01, mode='stock'), LatControlAngle)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('identity', EXPECTED)
|
||||
@pytest.mark.parametrize('identity', PARAMS)
|
||||
def test_all_dom_captures_identify_through_real_eliminator(identity):
|
||||
for capture in FINGERPRINTS[CAR(identity)]:
|
||||
cars = all_legacy_fingerprint_cars()
|
||||
|
||||
Reference in New Issue
Block a user