From 78bb03345e0038bc3b7251bf3f3ea7b5f9c00bec Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 1 Apr 2022 20:03:20 -0700 Subject: [PATCH] better support non-car robots (#24106) * better support non-car robots * bump cereal * update refs old-commit-hash: e40c36f22ba93200a5fc83211005b28fca3fa728 --- cereal | 2 +- selfdrive/car/body/interface.py | 1 + selfdrive/car/docs_definitions.py | 5 +++-- selfdrive/test/process_replay/ref_commit | 2 +- selfdrive/test/process_replay/test_processes.py | 3 +-- selfdrive/ui/qt/home.cc | 4 ++-- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cereal b/cereal index c7c22aacfc..f05953e72a 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit c7c22aacfc126d562d1dba7ecb890c1ff3e6039b +Subproject commit f05953e72ae8eddc87605136e8c1d9d778455c59 diff --git a/selfdrive/car/body/interface.py b/selfdrive/car/body/interface.py index 325cb366d9..54639b40c6 100644 --- a/selfdrive/car/body/interface.py +++ b/selfdrive/car/body/interface.py @@ -9,6 +9,7 @@ class CarInterface(CarInterfaceBase): ret = CarInterfaceBase.get_std_params(candidate, fingerprint) + ret.notCar = True ret.carName = "body" ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.body)] diff --git a/selfdrive/car/docs_definitions.py b/selfdrive/car/docs_definitions.py index 8de7b1d26b..f6e7353483 100644 --- a/selfdrive/car/docs_definitions.py +++ b/selfdrive/car/docs_definitions.py @@ -76,8 +76,9 @@ class CarInfo: Column.MAINTAINED: CP.carFingerprint not in non_tested_cars, } - if self.name == "comma body": - self.row[Column.LONGITUDINAL] = True + if CP.notCar: + for col in StarColumns: + self.row[col] = True self.all_footnotes = all_footnotes for column in StarColumns: diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index b75b3d2f21..37d852ba96 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -7ede67c2798fbe675c078e4d90192efc7e8a3901 \ No newline at end of file +34c6b9b9a97a448138fa86ff6269d37f68aacb58 \ No newline at end of file diff --git a/selfdrive/test/process_replay/test_processes.py b/selfdrive/test/process_replay/test_processes.py index 0387952e2d..a8352ef26b 100755 --- a/selfdrive/test/process_replay/test_processes.py +++ b/selfdrive/test/process_replay/test_processes.py @@ -70,8 +70,7 @@ def test_process(cfg, lr, cmp_log_fn, ignore_fields=None, ignore_msgs=None): if cfg.proc_name == "controlsd": for msg in log_msgs: if msg.which() == "carParams": - # body doesn't enable - if msg.carParams.carName == "body": + if msg.carParams.notCar: break if msg.which() == "controlsState": if msg.controlsState.active: diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index 1a10eca445..d2d8c77f48 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -50,8 +50,8 @@ void HomeWindow::showSidebar(bool show) { void HomeWindow::updateState(const UIState &s) { const SubMaster &sm = *(s.sm); - // switch to the body UI - if (onroad->isVisible() && sm["carParams"].getCarParams().getCarName() == "body") { + // switch to the generic robot UI + if (onroad->isVisible() && sm["carParams"].getCarParams().getNotCar()) { slayout->setCurrentWidget(body); } }