diff --git a/board/safety/safety_ford.h b/board/safety/safety_ford.h index 013bad3b0..d9b18fff5 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 7d2a128f5..49491475f 100755 --- a/tests/safety/test_ford.py +++ b/tests/safety/test_ford.py @@ -384,7 +384,7 @@ class TestFordCANFDStockSafety(TestFordSafetyBase): 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 @@ class TestFordLongitudinalSafetyBase(TestFordSafetyBase): 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)