Exemple #1
0
    def _update_state(self, event):
        with self._lock:
            # Ignore updates for already destructed goal handles
            if self._handle is None:
                return

            # Update state
            _rclpy_action.rclpy_action_update_goal_state(self._handle, event.value)

            # Publish state change
            _rclpy_action.rclpy_action_publish_status(self._action_server._handle)

            # If it's a terminal state, then also notify the action server
            if not _rclpy_action.rclpy_action_goal_handle_is_active(self._handle):
                self._action_server.notify_goal_done()
Exemple #2
0
 def is_active(self):
     with self._lock:
         if self._handle is None:
             return False
         return _rclpy_action.rclpy_action_goal_handle_is_active(
             self._handle)