From 59ade6c2f62d824e974b1495d396a586f35038f0 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 28 Jul 2020 18:37:16 -0700 Subject: [PATCH] can't directly access sockets anymore old-commit-hash: 6acda96a163ad77f2f0b283712ac79b3d3d90d54 --- cereal | 2 +- selfdrive/controls/controlsd.py | 4 +++- selfdrive/test/process_replay/camera_replay.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cereal b/cereal index 29099e87a..32300930f 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 29099e87a1372694fb81b426faaa57e832bbe87a +Subproject commit 32300930f65425bbba136461446149af8f8b42d9 diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 4c11c5e05..fa9def223 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -61,7 +61,9 @@ class Controls: self.can_sock = messaging.sub_sock('can', timeout=can_timeout) # wait for one health and one CAN packet - hw_type = messaging.recv_one(self.sm.sock['health']).health.hwType + while not sm.updated['health']: + sm.update() + hw_type = sm['health'].hwType has_relay = hw_type in [HwType.blackPanda, HwType.uno, HwType.dos] print("Waiting for CAN messages...") messaging.get_one_can(self.can_sock) diff --git a/selfdrive/test/process_replay/camera_replay.py b/selfdrive/test/process_replay/camera_replay.py index 501f8f611..f2cc4a546 100755 --- a/selfdrive/test/process_replay/camera_replay.py +++ b/selfdrive/test/process_replay/camera_replay.py @@ -27,7 +27,7 @@ def camera_replay(lr, fr): spinner = Spinner() pm = messaging.PubMaster(['frame', 'liveCalibration']) - sm = messaging.SubMaster(['model']) + model_sock = messaging.sub_sock("model", conflate=False) # TODO: add dmonitoringmodeld print("preparing procs") @@ -56,7 +56,7 @@ def camera_replay(lr, fr): frame_idx += 1 pm.send(msg.which(), f) - log_msgs.append(messaging.recv_one(sm.sock['model'])) + log_msgs.append(messaging.recv_one(model_sock)) spinner.update("modeld replay %d/%d" % (frame_idx, fr.frame_count))