Skip to content
Merged
Show file tree
Hide file tree
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 pymoveit2/gripper_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def force_reset_executing_state(self):
self.__is_motion_requested = False
self.__is_executing = False

def wait_until_executed(self):
def wait_until_executed(self) -> bool:
"""
Wait until the previously requested motion is finalised through either a success or failure.
"""
Expand All @@ -216,10 +216,11 @@ def wait_until_executed(self):
self._node.get_logger().warn(
"Cannot wait until motion is executed (no motion is in progress)."
)
return
return False

while self.__is_motion_requested or self.__is_executing:
self.__wait_until_executed_rate.sleep()
return True

def __joint_state_callback(self, msg: JointState):
# Update only if all relevant joints are included in the message
Expand Down
6 changes: 3 additions & 3 deletions pymoveit2/gripper_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def force_reset_executing_state(self):

self._interface.force_reset_executing_state(self=self)

def wait_until_executed(self):
def wait_until_executed(self) -> bool:
"""
Wait until the previously requested motion is finalised through either a success or failure.
"""
Expand All @@ -186,6 +186,6 @@ def wait_until_executed(self):
self._node.get_logger().error(
f"Unable to wait until a motion is executed because the appropriate interface cannot be determined."
)
return
return False

self._interface.wait_until_executed(self=self)
return self._interface.wait_until_executed(self=self)
Loading