From 4868493c0495afa644eaa15712549e7e59bc0761 Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Tue, 5 Sep 2023 10:34:57 -0700 Subject: [PATCH 1/2] dt param --- messaging/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/messaging/__init__.py b/messaging/__init__.py index b671a3ef7..6125e3b39 100644 --- a/messaging/__init__.py +++ b/messaging/__init__.py @@ -287,8 +287,7 @@ def send(self, s: str, dat: Union[bytes, capnp.lib.capnp._DynamicStructBuilder]) dat = dat.to_bytes() self.sock[s].send(dat) - def wait_for_readers_to_update(self, s: str, timeout: int) -> bool: - dt = 0.05 + def wait_for_readers_to_update(self, s: str, timeout: int, dt=0.05) -> bool: for _ in range(int(timeout*(1./dt))): if self.sock[s].all_readers_updated(): return True From 44aabfc3d15f6aaa3380a4409b1411ae670c9d44 Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Tue, 5 Sep 2023 10:48:13 -0700 Subject: [PATCH 2/2] same as the others --- messaging/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messaging/__init__.py b/messaging/__init__.py index 6125e3b39..fd9a48772 100644 --- a/messaging/__init__.py +++ b/messaging/__init__.py @@ -287,7 +287,7 @@ def send(self, s: str, dat: Union[bytes, capnp.lib.capnp._DynamicStructBuilder]) dat = dat.to_bytes() self.sock[s].send(dat) - def wait_for_readers_to_update(self, s: str, timeout: int, dt=0.05) -> bool: + def wait_for_readers_to_update(self, s: str, timeout: int, dt: float = 0.05) -> bool: for _ in range(int(timeout*(1./dt))): if self.sock[s].all_readers_updated(): return True