mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 03:45:55 +08:00
Explain saved GM settings that pause FLM
This commit is contained in:
@@ -71,8 +71,10 @@ def configuration_data(cp, ci, controller, params, *, manual_status):
|
||||
if document is not None:
|
||||
profile = parse_document(document).get(str(cp.carFingerprint))
|
||||
if profile is not None:
|
||||
if profile.flm is not None or profile.geometry is not None and profile.geometry.learning == 'force_off':
|
||||
raise ValueError('Manual or explicitly disabled tuning selected')
|
||||
if profile.flm is not None:
|
||||
raise ValueError('saved_gm_flm_profile_blocks_learning')
|
||||
if profile.geometry is not None and profile.geometry.learning == 'force_off':
|
||||
raise ValueError('saved_gm_force_off_blocks_learning')
|
||||
if profile.manual_coordinates is not None:
|
||||
from openpilot.starpilot.flm.manual_coordinates import selected_manual
|
||||
selected_manual(cp, params)
|
||||
|
||||
@@ -180,6 +180,39 @@ class TestDiagnosticState(unittest.TestCase):
|
||||
self.assertEqual(result['learning_diagnostics']['status'], 'not_recorded')
|
||||
self.assertEqual(list(path_for_params(self.params).parent.iterdir()), before)
|
||||
|
||||
def test_volt_download_distinguishes_a_legacy_flm_profile_from_an_explicit_learning_override(self):
|
||||
from opendbc.car.gm.interface import CarInterface
|
||||
from opendbc.car.gm.values import CAR
|
||||
from openpilot.starpilot.flm.offroad_runtime import configuration_data
|
||||
from openpilot.starpilot.flm.torque_surface import GmFlmBinding
|
||||
from openpilot.starpilot.lateral.controller_selection import read_selection
|
||||
from openpilot.starpilot.lateral.torque_settings import DOCUMENT_KEY, FieldChoice, GeometryProfile, PlatformProfile, serialize_document
|
||||
|
||||
cp = CarInterface.get_non_essential_params(CAR.CHEVROLET_VOLT_ASCM)
|
||||
tune = cp.lateralTuning.torque
|
||||
basis = (float(tune.latAccelFactor), float(tune.latAccelOffset), float(tune.friction))
|
||||
self.params.put_bool('OpenpilotEnabledToggle', True, block=True)
|
||||
mode = str(read_selection(self.params, cp).mode)
|
||||
descriptor = SimpleNamespace(domain='torque', controller_mode=mode)
|
||||
cases = (
|
||||
(PlatformProfile(basis, FieldChoice(), FieldChoice(), flm=GmFlmBinding(mode, 'volt', basis)),
|
||||
'saved_gm_flm_profile_blocks_learning', 'legacy GM FLM profile'),
|
||||
(PlatformProfile(basis, FieldChoice(), FieldChoice(),
|
||||
geometry=GeometryProfile((float(cp.steerRatio), float(cp.steerActuatorDelay) + .2), learning='force_off')),
|
||||
'saved_gm_force_off_blocks_learning', 'explicitly turns off learning'),
|
||||
)
|
||||
for profile, reason, explanation in cases:
|
||||
with self.subTest(reason=reason):
|
||||
raw = serialize_document({str(cp.carFingerprint): profile})
|
||||
self.params.put(DOCUMENT_KEY, json.loads(raw), block=True)
|
||||
before = self.params.get(DOCUMENT_KEY)
|
||||
with patch('openpilot.starpilot.flm.runtime_adapter_registry.selected_descriptor', return_value=descriptor):
|
||||
with self.assertRaisesRegex(ValueError, '^' + reason + '$'):
|
||||
configuration_data(cp, None, None, self.params, manual_status='not_configured')
|
||||
result = self.exported({'current': {'reason': reason}})
|
||||
self.assertIn(explanation, result['current']['explanation'])
|
||||
self.assertEqual(self.params.get(DOCUMENT_KEY), before)
|
||||
|
||||
def test_malformed_nested_diagnostic_data_does_not_enter_the_download(self):
|
||||
journal = DiagnosticState(self.params)
|
||||
journal.observe({'status': 'collecting', 'reason': 'recording_for_offroad_analysis'})
|
||||
|
||||
@@ -41,6 +41,10 @@ def _explanation(reason):
|
||||
'Known vehicle and no manual coordinates required': 'This older build rejected its vehicle/settings identity before route analysis. In the parked ' +
|
||||
'analysis path, missing or invalid recorded vehicle identity causes this refusal; it does not establish route corruption.',
|
||||
'Valid manual coordinate settings required': 'Saved manual steering settings require review; existing choices were preserved.',
|
||||
'saved_gm_flm_profile_blocks_learning': 'Auto Learn is paused because this vehicle has a saved legacy GM FLM profile.',
|
||||
'saved_gm_force_off_blocks_learning': 'A saved GM steering setting explicitly turns off learning for this vehicle.',
|
||||
'Manual or explicitly disabled tuning selected':
|
||||
'This older report did not distinguish a legacy GM FLM profile from a saved GM setting that turns learning off.',
|
||||
'Manual coordinate settings require review: context_changed':
|
||||
'The saved steering settings do not match the vehicle configuration or controller for this recording.',
|
||||
'partial_drive_provisional_only': 'Intact portions were analyzed. This partial recording can provide suggestions, not automatic changes.',
|
||||
|
||||
@@ -235,6 +235,8 @@ const REASONS = {
|
||||
more_independent_eligible_tracking_required: "The drive was analyzed. More complete independent steering windows are needed before saving a tune.",
|
||||
bounded_trial_configured_for_next_drive: "Auto Learn saved your steering adjustments for the next drive.",
|
||||
recorded_steering_window_inputs_unavailable: "The recording is missing inputs needed to verify its recommendations. The saved tune was kept.",
|
||||
saved_gm_flm_profile_blocks_learning: "Auto Learn is paused because this vehicle has an older saved FLM profile.",
|
||||
saved_gm_force_off_blocks_learning: "A saved GM steering setting turns off Auto Learn for this vehicle.",
|
||||
controller_collection_required: "Waiting for active steering before collecting samples.",
|
||||
fresh_physical_residual_window_required: "Checking the car's current steering response.",
|
||||
qualified_tracking_episodes_required: "Collecting complete, comparable steering windows.",
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "474648a233663a752410d44bdf42167e9e3a2aa18f24e029c8e9705195bedf54", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "f0877026db319f56f23cb5f1b89dd5707aa2e816a03b33aeb0ed0b2907bae2a7", "schema_version": 1}
|
||||
|
||||
Reference in New Issue
Block a user