From f2f3e77066618984472cd1c6850e4d9e60592de9 Mon Sep 17 00:00:00 2001 From: "justin.schaare" Date: Wed, 22 May 2024 10:52:40 +0900 Subject: [PATCH 1/2] add default timeout of 10 for CancelSlaves command --- python/mujinplanningclient/planningclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/mujinplanningclient/planningclient.py b/python/mujinplanningclient/planningclient.py index dcdbc17..3f56ae0 100644 --- a/python/mujinplanningclient/planningclient.py +++ b/python/mujinplanningclient/planningclient.py @@ -366,7 +366,7 @@ def TerminateSlaves(self, slaverequestids, timeout=None, fireandforget=None, che """ return self.SendConfig({'command':'TerminateSlaves', 'slaverequestids':slaverequestids}, timeout=timeout, fireandforget=fireandforget, checkpreempt=checkpreempt) - def CancelSlaves(self, slaverequestids, timeout=None, fireandforget=None, checkpreempt=True): + def CancelSlaves(self, slaverequestids, timeout=10, fireandforget=None, checkpreempt=True): """cancel the current commands on the slaves with specific slaverequestids """ return self.SendConfig({'command':'cancel', 'slaverequestids':slaverequestids}, timeout=timeout, fireandforget=fireandforget, checkpreempt=checkpreempt) From 3fff010375c139304c2bc4b5b7823d9af8563e08 Mon Sep 17 00:00:00 2001 From: "justin.schaare" Date: Wed, 22 May 2024 11:24:32 +0900 Subject: [PATCH 2/2] update docstrings --- python/mujinplanningclient/planningclient.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/python/mujinplanningclient/planningclient.py b/python/mujinplanningclient/planningclient.py index 3f56ae0..9e1a814 100644 --- a/python/mujinplanningclient/planningclient.py +++ b/python/mujinplanningclient/planningclient.py @@ -362,12 +362,24 @@ def SendConfig(self, command, slaverequestid=None, timeout=None, fireandforget=N return response['output'] def TerminateSlaves(self, slaverequestids, timeout=None, fireandforget=None, checkpreempt=True): - """terminate slaves with specific slaverequestids + """ Terminate slaves with specific slaverequestids + + Args: + slaverequestids (list[str]): list of slaverequestid corresponding to slaves to be terminated + timeout (float, optional): Time in seconds after which the command is assumed to have failed. + fireandforget (bool, optional): Whether we should return immediately after sending the command. If True, return value is None. + checkpreempt (bool, optional): If a preempt function should be checked during execution. """ return self.SendConfig({'command':'TerminateSlaves', 'slaverequestids':slaverequestids}, timeout=timeout, fireandforget=fireandforget, checkpreempt=checkpreempt) def CancelSlaves(self, slaverequestids, timeout=10, fireandforget=None, checkpreempt=True): - """cancel the current commands on the slaves with specific slaverequestids + """ Cancel the current commands on the slaves with specific slaverequestids + + Args: + slaverequestids (list[str]): list of slaverequestid corresponding to slaves to be cancelled + timeout (float, optional): Time in seconds after which the command is assumed to have failed. + fireandforget (bool, optional): Whether we should return immediately after sending the command. If True, return value is None. + checkpreempt (bool, optional): If a preempt function should be checked during execution. """ return self.SendConfig({'command':'cancel', 'slaverequestids':slaverequestids}, timeout=timeout, fireandforget=fireandforget, checkpreempt=checkpreempt)