From 65aa62b642621a0b6d34242d858382d38ea27535 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 3 Oct 2023 23:24:15 -0700 Subject: [PATCH] oh wait it does --- board/safety/safety_ford.h | 1 + tests/safety/test_ford.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/board/safety/safety_ford.h b/board/safety/safety_ford.h index 013bad3b09..d9b18fff51 100644 --- a/board/safety/safety_ford.h +++ b/board/safety/safety_ford.h @@ -166,6 +166,7 @@ const LongitudinalLimits FORD_LONG_LIMITS = { .max_accel = 5641, // 1.9999 m/s^s .min_accel = 4231, // -3.4991 m/s^2 .inactive_accel = 5128, // -0.0008 m/s^2 + .zero_accel = 5128, // -0.0008 m/s^2 // TODO: why do tests pass without zero_accel set // gas cmd limits diff --git a/tests/safety/test_ford.py b/tests/safety/test_ford.py index 7d2a128f53..49491475f8 100755 --- a/tests/safety/test_ford.py +++ b/tests/safety/test_ford.py @@ -384,7 +384,7 @@ def setUp(self): self.safety.init_tests() -class TestFordLongitudinalSafetyBase(TestFordSafetyBase): +class TestFordLongitudinalSafetyBase(TestFordSafetyBase, common.LongitudinalAccelSafetyTest): FWD_BLACKLISTED_ADDRS = {2: [MSG_ACCDATA, MSG_ACCDATA_3, MSG_Lane_Assist_Data1, MSG_LateralMotionControl, MSG_LateralMotionControl2, MSG_IPMA_Data]} @@ -428,6 +428,9 @@ def test_gas_safety_check(self): should_tx = (controls_allowed and self.MIN_GAS <= gas <= self.MAX_GAS) or gas == self.INACTIVE_GAS self.assertEqual(should_tx, self._tx(self._acc_command_msg(gas, self.INACTIVE_ACCEL))) + def _accel_msg(self, accel: float): + return self._acc_command_msg(self.INACTIVE_GAS, accel) + def test_brake_safety_check(self): for controls_allowed in (True, False): self.safety.set_controls_allowed(controls_allowed)