diff --git a/panda b/panda index bb2aea1ac6..d031d6e283 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit bb2aea1ac6bd9ab198ec5192268a6ea6eec6bbe5 +Subproject commit d031d6e283e2887cb3360c068a3925f9b58b2b12 diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 4368619926..17044c432d 100755 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -15,7 +15,6 @@ from selfdrive.car.car_helpers import interfaces from selfdrive.car.gm.values import CAR as GM from selfdrive.car.honda.values import CAR as HONDA, HONDA_BOSCH from selfdrive.car.hyundai.values import CAR as HYUNDAI -from selfdrive.car.toyota.values import CAR as TOYOTA from selfdrive.car.tests.routes import non_tested_cars, routes, TestRoute from selfdrive.test.openpilotci import get_url from tools.lib.logreader import LogReader @@ -244,10 +243,6 @@ class TestCarModel(unittest.TestCase): CS_prev = CS - # TODO: add flag to toyota safety - if self.CP.carFingerprint == TOYOTA.SIENNA and checks['brakePressed'] < 25: - checks['brakePressed'] = 0 - failed_checks = {k: v for k, v in checks.items() if v > 0} self.assertFalse(len(failed_checks), f"panda safety doesn't agree with openpilot: {failed_checks}") diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index c20110b8b5..b3d0aefa84 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 from cereal import car from common.conversions import Conversions as CV +from panda import Panda from selfdrive.car.toyota.tunes import LatTunes, LongTunes, set_long_tune, set_lat_tune from selfdrive.car.toyota.values import Ecu, CAR, ToyotaFlags, TSS2_CAR, NO_DSU_CAR, MIN_ACC_SPEED, EPS_SCALE, EV_HYBRID_CAR, CarControllerParams from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config @@ -22,6 +23,9 @@ class CarInterface(CarInterfaceBase): ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.toyota)] ret.safetyConfigs[0].safetyParam = EPS_SCALE[candidate] + if candidate in (CAR.RAV4, CAR.PRIUS_V, CAR.COROLLA, CAR.LEXUS_ESH, CAR.LEXUS_CTH): + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_TOYOTA_ALT_BRAKE + ret.steerActuatorDelay = 0.12 # Default delay, Prius has larger delay ret.steerLimitTimer = 0.4 ret.stoppingControl = False # Toyota starts braking more when it thinks you want to stop diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 4d773a2bf9..f0a493c3c2 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -999b5f3bfe249b40758dc62601a6e4118dad82ae \ No newline at end of file +8d369bed132b691e1c000a726ab253ce7cbf8e09 \ No newline at end of file diff --git a/selfdrive/test/process_replay/test_processes.py b/selfdrive/test/process_replay/test_processes.py index 060866efa3..4682bf509e 100755 --- a/selfdrive/test/process_replay/test_processes.py +++ b/selfdrive/test/process_replay/test_processes.py @@ -34,7 +34,7 @@ segments = [ ("BODY", "bd6a637565e91581|2022-04-04--22-05-08--0"), ("HYUNDAI", "fakedata|2022-01-20--17-49-04--0"), ("TOYOTA", "fakedata|2022-04-13--18-53-16--0"), - ("TOYOTA2", "fakedata|2022-04-13--18-59-09--0"), + ("TOYOTA2", "fakedata|2022-04-26--22-58-12--0"), ("TOYOTA3", "fakedata|2022-04-13--19-09-53--0"), ("HONDA", "fakedata|2022-01-20--17-56-40--0"), ("HONDA2", "fakedata|2022-04-13--19-23-30--0"),