From 47922cb425aa50b482eae6cb8aa3902f27978172 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 4 Sep 2025 16:28:20 -0700 Subject: [PATCH] check that standstill matches speed --- selfdrive/car/tests/test_models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 8996ad6460..9ad9e727b5 100644 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -192,6 +192,7 @@ class TestCarModelBase(unittest.TestCase): can_invalid_cnt = 0 CC = structs.CarControl().as_reader() + checks = defaultdict(int) for i, msg in enumerate(self.can_msgs): CS = self.CI.update(msg) self.CI.apply(CC, msg[0]) @@ -200,8 +201,13 @@ class TestCarModelBase(unittest.TestCase): if i > 250: can_invalid_cnt += not CS.canValid + checks['standstill'] += CS.standstill != (CS.vEgoRaw == 0.0) + self.assertEqual(can_invalid_cnt, 0) + failed_checks = {k: v for k, v in checks.items() if v > 0} + self.assertFalse(len(failed_checks), f"car interface checks failed: {failed_checks}") + def test_radar_interface(self): RI = self.CarInterface.RadarInterface(self.CP) assert RI