From 3ec004d48237e3b6f42add3376209bcb19db92eb Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Fri, 1 Mar 2024 13:32:31 -0500 Subject: [PATCH] Body: move to car specs (#31666) * specs * override * fixes 1 * fix 3 * fixes 4 * fixes * fixes * fixc * fix number 723124 * that too * fixes * aa * do body real quick too * body too old-commit-hash: a5ee1638b8d4f7dde23b9160e26d715cd1420202 --- selfdrive/car/body/interface.py | 4 ---- selfdrive/car/body/values.py | 3 ++- selfdrive/car/tests/test_platform_configs.py | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/selfdrive/car/body/interface.py b/selfdrive/car/body/interface.py index 12a2d5f304..4d72d2f604 100644 --- a/selfdrive/car/body/interface.py +++ b/selfdrive/car/body/interface.py @@ -14,14 +14,10 @@ class CarInterface(CarInterfaceBase): ret.minSteerSpeed = -math.inf ret.maxLateralAccel = math.inf # TODO: set to a reasonable value - ret.steerRatio = 0.5 ret.steerLimitTimer = 1.0 ret.steerActuatorDelay = 0. - ret.mass = 9 - ret.wheelbase = 0.406 ret.wheelSpeedFactor = SPEED_FROM_RPM - ret.centerToFront = ret.wheelbase * 0.44 ret.radarUnavailable = True ret.openpilotLongitudinalControl = True diff --git a/selfdrive/car/body/values.py b/selfdrive/car/body/values.py index 441905f28b..d0dd36e15f 100644 --- a/selfdrive/car/body/values.py +++ b/selfdrive/car/body/values.py @@ -1,5 +1,5 @@ from cereal import car -from openpilot.selfdrive.car import PlatformConfig, Platforms, dbc_dict +from openpilot.selfdrive.car import CarSpecs, PlatformConfig, Platforms, dbc_dict from openpilot.selfdrive.car.docs_definitions import CarInfo from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries @@ -24,6 +24,7 @@ class CAR(Platforms): "COMMA BODY", CarInfo("comma body", package="All"), dbc_dict('comma_body', None), + specs=CarSpecs(mass=9, wheelbase=0.406, steerRatio=0.5, centerToFrontRatio=0.44) ) diff --git a/selfdrive/car/tests/test_platform_configs.py b/selfdrive/car/tests/test_platform_configs.py index 931780963f..cca752705b 100755 --- a/selfdrive/car/tests/test_platform_configs.py +++ b/selfdrive/car/tests/test_platform_configs.py @@ -16,8 +16,7 @@ class TestPlatformConfigs(unittest.TestCase): self.assertIn("pt", platform.config.dbc_dict) self.assertTrue(len(platform.config.platform_str) > 0) - # enable when all cars have specs - #self.assertIsNotNone(platform.config.specs) + self.assertIsNotNone(platform.config.specs) if __name__ == "__main__":