RoboDK Forum
Working with External Rail using Python API- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API)
+--- Thread: Working with External Rail using Python API (/Thread-Working-with-External-Rail-using-Python-API)



Working with External Rail using Python API-oakleybaron-04-20-2022

I am trying to setup a Fanuc robot on a single axis external rail. I followed the tutorials and believe I have the rail synced with the robot. I have taught a reference frame for the table in the cell and a TCP for my tool. Teaching targets in the GUI and selecting them moves the robot as expected. However, trying to generate similar results in Python using the attached script, does not give the same result.


.py TargetTest.py(Size: 1.07 KB / Downloads: 163)

I tried following the steps in this post://www.sinclairbody.com/forum/Thread-External-Rail-programmation-with-the-Python-APIbut did not have any more luck. I attempted to interrogate the joint values of the target and it looks like the rail should be set to 0 however performing a joint move to the target sets the rail value to ~115mm. Any advice would be appreciated!


RE: Working with External Rail using Python API-Albert-04-24-2022

Your robot item was set to the rail, not the robot. To solve the problem you should properly retrieve the robot arm. Example:
Code:
# Get a named robot in your cell
机器人= RDK。项目(Fanuc r - 2000磅/ 165 f ', ITEM_TYPE_ROBOT)

# Print the robot name
print(robot.Name())


Alternatively, you can also retrieve the parent robot an axis is linked to by using getLink. Example:
Code:
# Get the first robot in your cell
机器人= RDK。Item('', ITEM_TYPE_ROBOT)

# Get the parent robot of an external axis if it is synchronized
robot = robot.getLink(ITEM_TYPE_ROBOT)

# Print the robot name
print(robot.Name())