Bug Description
When using the goto_pose_sync method for dual-arm control in yumi_robot.py, a deadlock occurs, causing the program to hang and eventually time out with a YuMiCommException.
How to Reproduce
- Call the
robot.goto_pose_sync(left_pose, right_pose) function.
- The Python client sends a command to the left arm and waits for a response because
_goto_pose_sync is a blocking call.
- The left arm's RAPID program receives the command and executes
SyncMoveOn, where it waits for the right arm to also reach the synchronization point.
- The Python client is still blocked waiting for the left arm, so it never sends the command to the right arm.
- This creates a deadlock: The Python client waits for the left arm, the left arm waits for the right arm, and the right arm waits for the Python client.
Problematic Code (yumipy/yumi_arm.py)
def goto_pose_sync(self, left_pose, right_pose):
# ... (omitted for brevity)
self.left._goto_pose_sync(left_pose)
self.right._goto_pose_sync(right_pose)
Root Cause
The first call, self.left._goto_pose_sync(left_pose), is blocking (wait_for_res=True by default). It prevents the script from ever reaching the second call for the right arm.
Suggested Solution
The deadlock can be resolved by making the first call non-blocking, allowing the second command to be sent immediately.
def goto_pose_sync(self, left_pose, right_pose):
# ... (omitted for brevity)
# Send the first command without waiting for a response
self.left._goto_pose_sync(left_pose, wait_for_res=False)
# Send the second command and wait for the synchronized motion to complete
self.right._goto_pose_sync(right_pose, wait_for_res=True)
Bug Description
When using the
goto_pose_syncmethod for dual-arm control inyumi_robot.py, a deadlock occurs, causing the program to hang and eventually time out with aYuMiCommException.How to Reproduce
robot.goto_pose_sync(left_pose, right_pose)function._goto_pose_syncis a blocking call.SyncMoveOn, where it waits for the right arm to also reach the synchronization point.Problematic Code (
yumipy/yumi_arm.py)Root Cause
The first call, self.left._goto_pose_sync(left_pose), is blocking (wait_for_res=True by default). It prevents the script from ever reaching the second call for the right arm.
Suggested Solution
The deadlock can be resolved by making the first call non-blocking, allowing the second command to be sent immediately.