Skip to content

Deadlock in goto_pose_sync due to blocking calls for synchronized dual-arm motion in yumi_robot.py #38

@97944yyh

Description

@97944yyh

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

  1. Call the robot.goto_pose_sync(left_pose, right_pose) function.
  2. The Python client sends a command to the left arm and waits for a response because _goto_pose_sync is a blocking call.
  3. 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.
  4. The Python client is still blocked waiting for the left arm, so it never sends the command to the right arm.
  5. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions