mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-30 00:33:41 +08:00
Repair turn fixtures and StarPort layout validation
This commit is contained in:
@@ -59,6 +59,7 @@ def _controller(cp, surface=None, *, original_constructor_context=False):
|
||||
# Replace before the first update. The production constructor always uses None.
|
||||
controller.starpilot_extension.policy = Ioniq6TorquePolicy(controller, cp.as_reader(), surface=surface, turn_assist=True)
|
||||
if original_constructor_context:
|
||||
controller.turn_assist_maneuver = True
|
||||
controller.hkg_canfd_torque = False
|
||||
# These frozen vectors invoke the original constructor directly. Dom
|
||||
# controlsd replaces this curve with the saved/default flat gain each tick;
|
||||
|
||||
@@ -40,6 +40,9 @@ def probe(output, reference_method=None):
|
||||
from openpilot.starpilot.lateral.tests.test_lane_centering import model
|
||||
from openpilot.starpilot.lateral.lane_change_preferences import LiveLaneChangePolicy
|
||||
from openpilot.starpilot.lateral.lane_change_smoothing import LaneChangeSmoother
|
||||
from openpilot.starpilot.lateral.model_turn_assist import ModelTurnAssist
|
||||
from openpilot.starpilot.lateral.turn_initiation_preferences import TurnInitiationPreference
|
||||
from openpilot.starpilot.lateral.turn_unlock import TurnUnlock
|
||||
from opendbc.car.car_helpers import interfaces
|
||||
from opendbc.car.toyota.values import CAR
|
||||
from opendbc.car.vehicle_model import VehicleModel
|
||||
@@ -73,6 +76,9 @@ def probe(output, reference_method=None):
|
||||
control.lane_change_preferences = LiveLaneChangePolicy(control.params, now_ns=1_000_000_000)
|
||||
control.lane_change_policy = control.lane_change_preferences.applied
|
||||
control.lane_change_smoother = LaneChangeSmoother()
|
||||
control.model_turn_assist = ModelTurnAssist()
|
||||
control.turn_unlock = TurnUnlock()
|
||||
control.turn_initiation_preferences = TurnInitiationPreference(control.params)
|
||||
control.torque_host = None # Explicit feature-off state for the manually constructed Controls fixture.
|
||||
control.torque_learning_allowed = False
|
||||
control.longitudinal_inputs.gm_start_enabled = False
|
||||
|
||||
@@ -79,7 +79,7 @@ def layout_metadata_for_viewport(viewport):
|
||||
widgets.pop(JETLINK_WIDGET) # Big-screen only for now
|
||||
profile['widgetOrder'] = [key for key in profile['widgetOrder'] if key != JETLINK_WIDGET]
|
||||
for widget in widgets.values():
|
||||
for field in ('bounds', 'anchorShift', 'expandable'):
|
||||
for field in ('bounds', 'anchorShift', 'expandable', 'rotateToggle'):
|
||||
widget.pop(field, None)
|
||||
widgets['current_speed']['default']['x'] += (width - 1860) / 2
|
||||
widgets[MODE_WIDGET]['default']['x'] += (width - 1860) / 2
|
||||
|
||||
@@ -420,11 +420,14 @@ class TestProjectionLayout(unittest.TestCase):
|
||||
source = ProjectionLayoutSource(Path(directory) / 'layouts/document.json')
|
||||
source.prepare()
|
||||
raw = json.dumps(default_layout(SCREEN)).encode()
|
||||
args = {'key': 'projection', 'max_bytes': 16384, 'raw': raw, 'expected': None, 'temp_prefix': '.aa-test-'}
|
||||
self.assertFalse(commit_exact(source, authorized=lambda: False, **args).committed)
|
||||
result = commit_exact(source, authorized=lambda: True, **args)
|
||||
def commit(authorized):
|
||||
return commit_exact(source, key='projection', max_bytes=16384, raw=raw, expected=None,
|
||||
authorized=lambda: authorized, temp_prefix='.aa-test-')
|
||||
|
||||
self.assertFalse(commit(False).committed)
|
||||
result = commit(True)
|
||||
self.assertTrue(result.committed and result.verified)
|
||||
self.assertFalse(commit_exact(source, authorized=lambda: True, **args).committed)
|
||||
self.assertFalse(commit(True).committed)
|
||||
|
||||
def test_starport_widgets_are_added_to_older_layouts(self):
|
||||
document = default_layout(SCREEN)
|
||||
|
||||
@@ -37,7 +37,7 @@ class FeatureSnapshotReadTests(unittest.TestCase):
|
||||
return self.owner.snapshot(page, parked=False, system_long=False, lateral_context=False, metric=False)
|
||||
|
||||
def test_normal_and_developer_pages_read_only_their_sources_once_per_assembly(self):
|
||||
for page, expected in (('torque', {'LaneChangePreferences'}), ('torque/developer', {'TorqueOverrideDocument'})):
|
||||
for page, expected in (('torque', {'AutomaticTurnInitiation'}), ('torque/developer', {'TorqueOverrideDocument'})):
|
||||
with self.subTest(page=page):
|
||||
self.params.reads.clear()
|
||||
first = self.snapshot(page)
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "6a691f7c91be03fa5c2570a9a8b10427232de07e8199762f757859292ba3a2c0", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "8ccaba1ab0f9c1daec467049a028f7893257dd6ec1b2f6ad763c9eb5e895fafd", "schema_version": 1}
|
||||
|
||||
Reference in New Issue
Block a user