Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleActionState will no longer wait forever for a missing ActionServer #41

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions smach_ros/src/smach_ros/simple_action_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ def _wait_for_server(self):
"""Internal method for waiting for the action server
This is run in a separate thread and allows construction of this state
to not block the construction of other states.
"""
while self._status == SimpleActionState.WAITING_FOR_SERVER and not rospy.is_shutdown():
"""
timeout_time = rospy.get_rostime() + self._server_wait_timeout
while self._status == SimpleActionState.WAITING_FOR_SERVER and not rospy.is_shutdown() and not rospy.get_rostime() >= timeout_time:
try:
if self._action_client.wait_for_server(rospy.Duration(1.0)):#self._server_wait_timeout):
self._status = SimpleActionState.INACTIVE
Expand Down