Skip to content

Commit

Permalink
oh wait it does
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Oct 4, 2023
1 parent 8065c64 commit 65aa62b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions board/safety/safety_ford.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/safety/test_ford.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 65aa62b

Please sign in to comment.