Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Move between two targets and maintain tool orientation
#1
Hi, I'm programming a UR10 to repeatedly move back and forth between targets A and B with a hexagon-shaped "tool" that has a picture on each of it's 6 sides. At target B there is a camera which will look at the picture. Every N cycles I want to rotate the tool to a different picture while it is at target A (out of the camera's view). After rotating the tool the robot repeats the cycle with the new picture.

The problem I am having is the tool always rotates to the desired image WHILE it moves to target B and rotates back to the first image WHILE it returns to target A.

Instead, I need it to:
  1. Start at target A
  2. Rotate tool to the desired image
  3. 移动到目标B同时保持方向
  4. Return to target A while maintaining orientation
  5. 代表eat steps 3 and 4 N times
  6. Rotate tool to the next desired image (while at target A)
  7. 代表eat steps 3-6 until all images have been shown.
I have a simple program called "show_from_right" defined within the RoboDK GUI which executes the moves between A and B. I'm using Python to call this program and run the code that changes which image is shown in between program calls. The images below (next post) show the setup. Here is my code for changing which picture is shown (it runs in a wrapper around the API)

Code:
def set_picture(self, new_pic_idx):
""" Rotate the tool so that the given new_pic_idx is the picture that will be shown to the camera """
new_pic_angle = (new_pic_idx - 1) * -self.deg_per_idx # Calculate the new picture angle
new_pose = robomath.rotz(new_pic_angle * self.d2r) # Calculate the new pose (d2r converts deg to radians)
result = self.robot.setPoseTool(new_pose) # Move the robot to the new pose
self.current_pic_idx = new_pic_idx # Update the current picture index
self.robot.WaitMove(timeout=5000)

Hopefully someone can help me understand what I am doing wrong here!



Messages In This Thread
Move between two targets and maintain tool orientation - bydunderMethods- 02-22-2023, 01:16 AM



Users browsing this thread:
1 Guest(s)