mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-26 00:12:05 +08:00
Toyota: resolve controls mismatch due to interceptor thresholds (#23710)
* remove gas interceptor exception * panda * bump submodules * bump panda * forgot carstate change * revert * add test route * bump * update refs for CS.gas * bump submodules to master
This commit is contained in:
+1
-1
Submodule opendbc updated: 9f3902657d...e19ba095c3
+1
-1
Submodule panda updated: c925407461...a1d97f9a0b
@@ -209,6 +209,7 @@ routes = [
|
||||
# Segments that test specific issues
|
||||
# Controls mismatch due to interceptor threshold
|
||||
TestRoute("cfb32f0fb91b173b|2022-04-06--14-54-45", HONDA.CIVIC, segment=21),
|
||||
TestRoute("5a8762b91fc70467|2022-04-14--21-26-20", TOYOTA.RAV4, segment=2),
|
||||
# Controls mismatch due to standstill threshold
|
||||
TestRoute("bec2dcfde6a64235|2022-04-08--14-21-32", HONDA.CRV_HYBRID, segment=22),
|
||||
]
|
||||
|
||||
@@ -209,13 +209,7 @@ class TestCarModel(unittest.TestCase):
|
||||
|
||||
# TODO: check rest of panda's carstate (steering, ACC main on, etc.)
|
||||
|
||||
# TODO: make the interceptor thresholds in openpilot and panda match, then remove this exception
|
||||
gas_pressed = CS.gasPressed
|
||||
if self.CP.enableGasInterceptor and gas_pressed and not self.safety.get_gas_pressed_prev():
|
||||
# panda intentionally has a higher threshold
|
||||
if self.CP.carName == "toyota" and 15 < CS.gas < 15*1.5:
|
||||
gas_pressed = False
|
||||
checks['gasPressed'] += gas_pressed != self.safety.get_gas_pressed_prev()
|
||||
checks['gasPressed'] += CS.gasPressed != self.safety.get_gas_pressed_prev()
|
||||
|
||||
# TODO: remove this exception once this mismatch is resolved
|
||||
brake_pressed = CS.brakePressed
|
||||
@@ -257,5 +251,6 @@ class TestCarModel(unittest.TestCase):
|
||||
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}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -36,8 +36,8 @@ class CarState(CarStateBase):
|
||||
ret.brakePressed = cp.vl["BRAKE_MODULE"]["BRAKE_PRESSED"] != 0
|
||||
ret.brakeHoldActive = cp.vl["ESP_CONTROL"]["BRAKE_HOLD_ACTIVE"] == 1
|
||||
if self.CP.enableGasInterceptor:
|
||||
ret.gas = (cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) / 2.
|
||||
ret.gasPressed = ret.gas > 15
|
||||
ret.gas = (cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) // 2
|
||||
ret.gasPressed = ret.gas > 805
|
||||
else:
|
||||
# TODO: find a new, common signal
|
||||
msg = "GAS_PEDAL_HYBRID" if (self.CP.flags & ToyotaFlags.HYBRID) else "GAS_PEDAL"
|
||||
|
||||
@@ -1 +1 @@
|
||||
a959650f3dac9aaa4d9438f3126f5c34d35b3c62
|
||||
84bf66d9917e102f581279892d32a04c35fb4d87
|
||||
Reference in New Issue
Block a user