diff --git a/smach_ros/smach_ros/simple_action_state.py b/smach_ros/smach_ros/simple_action_state.py index 9c6b212..b0accf9 100644 --- a/smach_ros/smach_ros/simple_action_state.py +++ b/smach_ros/smach_ros/simple_action_state.py @@ -354,6 +354,8 @@ def execute(self, ud): # Activate the state before sending the goal self._activate_time = self.node.get_clock().now() self._status = ActionState.ACTIVE + self._goal_result = None + self._goal_status = None with self._done_cond: # Dispatch goal via non-blocking call to action server @@ -368,7 +370,9 @@ def execute(self, ud): self._execution_timer_thread.start() # Wait for action to finish - self._done_cond.wait() + while self._goal_result is None: + rclpy.spin_once(self.node) + time.sleep(0.01) # Call user result callback if defined result_cb_outcome = None