mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-29 01:23:58 +08:00
Restore Toyota camera pedal configurations
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Dom pedal protocol for the qualified Corolla/RAV4 TSS2 camera-longitudinal owners."""
|
||||
"""Dom pedal protocol for the qualified TSS2 camera-longitudinal owners."""
|
||||
import numpy as np
|
||||
from opendbc.can import CANParser
|
||||
from opendbc.car.toyota.toyotacan import toyota_checksum
|
||||
@@ -7,7 +7,22 @@ from opendbc.car.toyota.values import CAR, ToyotaFlags, MIN_ACC_SPEED, PEDAL_TRA
|
||||
|
||||
LONG_WORD = 0x2049
|
||||
STOCK_WORD = 0x2249
|
||||
CAMERA_PEDAL_CARS = frozenset((CAR.TOYOTA_COROLLA_TSS2, CAR.TOYOTA_RAV4_TSS2))
|
||||
CAMERA_PEDAL_CARS = frozenset((
|
||||
CAR.TOYOTA_ALPHARD_TSS2,
|
||||
CAR.TOYOTA_AVALON_TSS2,
|
||||
CAR.TOYOTA_CAMRY_TSS2,
|
||||
CAR.TOYOTA_COROLLA_TSS2,
|
||||
CAR.TOYOTA_HIGHLANDER_TSS2,
|
||||
CAR.TOYOTA_PRIUS_TSS2,
|
||||
CAR.TOYOTA_RAV4_TSS2,
|
||||
CAR.TOYOTA_MIRAI,
|
||||
CAR.LEXUS_ES_TSS2,
|
||||
CAR.LEXUS_NX_TSS2,
|
||||
CAR.LEXUS_LC_TSS2,
|
||||
CAR.LEXUS_RX_TSS2,
|
||||
CAR.LEXUS_IS_TSS2,
|
||||
CAR.LEXUS_RC_TSS2,
|
||||
))
|
||||
|
||||
|
||||
def checksum(data):
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import pytest
|
||||
from opendbc.car import gen_empty_fingerprint
|
||||
from opendbc.car.toyota.interface import CarInterface
|
||||
from opendbc.car.toyota.values import ToyotaFlags
|
||||
from openpilot.starpilot.car.toyota.tests.test_camera_pedal_extension_callers import NEW_MODELS
|
||||
from openpilot.starpilot.car.toyota.tests.test_pedal_caller_native import firmware
|
||||
from openpilot.starpilot.car.toyota.aol import qualified
|
||||
|
||||
|
||||
@pytest.mark.parametrize('candidate', NEW_MODELS)
|
||||
def test_pedal_admission_changes_only_hardware_flags_and_native_owner(candidate):
|
||||
fp = gen_empty_fingerprint()
|
||||
fw = firmware(candidate)
|
||||
baseline = CarInterface.get_params(candidate, fp, fw, False, False, False)
|
||||
fp[0][0x201] = 6
|
||||
cp = CarInterface.get_params(candidate, fp, fw, False, False, False)
|
||||
expected = baseline.to_dict()
|
||||
expected['flags'] |= int(ToyotaFlags.GAS_INTERCEPTOR)
|
||||
expected['safetyConfigs'][0]['safetyParam'] = 0x2049
|
||||
assert cp.to_dict() == expected
|
||||
assert qualified(cp)
|
||||
@@ -0,0 +1,28 @@
|
||||
"""Actual caller/native pedal qualification for added camera-longitudinal models."""
|
||||
import pytest
|
||||
from opendbc.car.toyota.values import CAR
|
||||
from openpilot.starpilot.car.toyota.tests import test_pedal_caller_native as helpers
|
||||
|
||||
source_matched_native = helpers.source_matched_native
|
||||
daemon_gc_scope = helpers.daemon_gc_scope
|
||||
|
||||
NEW_MODELS = (
|
||||
CAR.TOYOTA_ALPHARD_TSS2,
|
||||
CAR.TOYOTA_AVALON_TSS2,
|
||||
CAR.TOYOTA_CAMRY_TSS2,
|
||||
CAR.TOYOTA_HIGHLANDER_TSS2,
|
||||
CAR.TOYOTA_PRIUS_TSS2,
|
||||
CAR.TOYOTA_MIRAI,
|
||||
CAR.LEXUS_ES_TSS2,
|
||||
CAR.LEXUS_NX_TSS2,
|
||||
CAR.LEXUS_LC_TSS2,
|
||||
CAR.LEXUS_RX_TSS2,
|
||||
CAR.LEXUS_IS_TSS2,
|
||||
CAR.LEXUS_RC_TSS2,
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize('candidate', NEW_MODELS)
|
||||
@pytest.mark.parametrize('stock', [False, True])
|
||||
@pytest.mark.parametrize('scenario', ['physical', 'main_dropout'])
|
||||
def test_added_camera_pedal_actual_callers(candidate, stock, scenario):
|
||||
helpers.run_case(stock, scenario, candidate=candidate)
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "6f439146d603280b53e80ff75795615c7bde92ea18b3d1d9872c232d45fcf2ce", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "ebc12f616a72e4a946b56c2f83176afb0581750a0b8add23f9074badfa7fce43", "schema_version": 1}
|
||||
|
||||
Reference in New Issue
Block a user