Skip to content

Commit be8b027

Browse files
committed
new: customizable server timeout
1 parent 7eb38d6 commit be8b027

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

skiros2_std_skills/skiros2_std_skills/action_client_primitive.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ class PrimitiveActionClient(PrimitiveBase):
2424
feedback_timeout_sec defines a timeout in seconds for not reciving action
2525
feedback in a timely manner. Could be used to detect if the action server
2626
has gone down or experiences issues. Default is no timeout.
27+
28+
wait_for_server_timeout defines the amount of time to wait for the action server to be alive.
29+
Defaults to 1 second.
2730
"""
2831
build_client_onstart = True
2932
feedback_timeout_sec = None # set to second if you want reliability
33+
wait_for_server_timeout = 1.0
3034

3135
def __init__(self):
3236
super().__init__()
@@ -59,7 +63,7 @@ def onStart(self):
5963
if self.client is None:
6064
return self.startError("Action client returned by buildClient() is None.", -105)
6165

62-
if not self.client.wait_for_server(0.5):
66+
if not self.client.wait_for_server(self.wait_for_server_timeout):
6367
return self.startError("Action server is not available: {}".format(self.client), -101)
6468

6569
self._goal_handle = None

0 commit comments

Comments
 (0)