Hi Guys,
I am trying to set a second robot to follow the path of first robot. I have started by setting a target on Robot 1 and am looking to understand how to rotate that cartesian point so that the 2nd bot tcp is aligned on the z axis but rotated 180 around y. I will then want to offset by some arbitrary number. I used the offset command first but that resulted in more of a 1st robot moves right and 2nd robot moves right (after rotation). Here is my current code:
It seems I am also struggling with an error with dropping a target onto the new frame. Let me know if this seems like a good path.
Thanks, Jacob
Just in case anyone wants a visual to understand what I am aiming to do. I have a robodk station with a target attached to a frame. This is linked to second robot so that the 1st and 2nd tcp are always in line and offset. I am trying to figure out how to do this by code now rather than graphically. Thanks
I am trying to set a second robot to follow the path of first robot. I have started by setting a target on Robot 1 and am looking to understand how to rotate that cartesian point so that the 2nd bot tcp is aligned on the z axis but rotated 180 around y. I will then want to offset by some arbitrary number. I used the offset command first but that resulted in more of a 1st robot moves right and 2nd robot moves right (after rotation). Here is my current code:
Code:
# Type help("robolink") or help("robodk") for more information
# Press F5 to run the script
# Documentation: https://robodk.com/doc/en/RoboDK-API.html
# Reference: https://robodk.com/doc/en/PythonAPI/index.html
# Note: It is not required to keep a copy of this file, your python script is saved with the station
from robolink import * # RoboDK API
from robodk import * # Robot toolbox
RDK = Robolink()
#
tool1 = RDK.Item('Fan1 Tool 1') # Get an item named Tool (name in the RoboDK station tree)
robot1 = RDK.Item('Fan1', ITEM_TYPE_ROBOT) # Get the first available robot
robot2 = RDK.Item('Fan2', ITEM_TYPE_ROBOT)
target = RDK.Item('Target 1', ITEM_TYPE_TARGET)
frameA = RDK.AddFrame('FrameA',tool1)
#set frame rel to tool tcp
frameA
#set tool
#add target to frame in cartesian
tar1 = RDK.AddTarget('tar1','frameA')
tar1 = tar1*roty(pi)
#move to target with other bot
Thanks, Jacob
(12-16-2019, 05:57 PM)Jacob Wrote: Hi Guys,
I am trying to set a second robot to follow the path of first robot. I have started by setting a target on Robot 1 and am looking to understand how to rotate that cartesian point so that the 2nd bot tcp is aligned on the z axis but rotated 180 around y. I will then want to offset by some arbitrary number. I used the offset command first but that resulted in more of a 1st robot moves right and 2nd robot moves right (after rotation). Here is my current code:
It seems I am also struggling with an error with dropping a target onto the new frame. Let me know if this seems like a good path.Code:# Type help("robolink") or help("robodk") for more information
# Press F5 to run the script
# Documentation: https://robodk.com/doc/en/RoboDK-API.html
# Reference: https://robodk.com/doc/en/PythonAPI/index.html
# Note: It is not required to keep a copy of this file, your python script is saved with the station
from robolink import * # RoboDK API
from robodk import * # Robot toolbox
RDK = Robolink()
#
tool1 = RDK.Item('Fan1 Tool 1') # Get an item named Tool (name in the RoboDK station tree)
robot1 = RDK.Item('Fan1', ITEM_TYPE_ROBOT) # Get the first available robot
robot2 = RDK.Item('Fan2', ITEM_TYPE_ROBOT)
target = RDK.Item('Target 1', ITEM_TYPE_TARGET)
frameA = RDK.AddFrame('FrameA',tool1)
#set frame rel to tool tcp
frameA
#set tool
#add target to frame in cartesian
tar1 = RDK.AddTarget('tar1','frameA')
tar1 = tar1*roty(pi)
#move to target with other bot
Thanks, Jacob
Just in case anyone wants a visual to understand what I am aiming to do. I have a robodk station with a target attached to a frame. This is linked to second robot so that the 1st and 2nd tcp are always in line and offset. I am trying to figure out how to do this by code now rather than graphically. Thanks