Python Simulation

This example shows how to create a new station using a UR robot and simulate a hexagonal movement with the robot.

1.Select FileRoboDK API - Image 2 Open

2.Open the UR10 robot

3.Select FileRoboDK API - Image 3 Open

4.Open the Paint_gun.tool file

5.Open the sample Python program SampleOfflineProgramming.py from C:/RoboDK/Library/Macros/

6.Double click the SampleOfflineProgramming item to run the simulation. The robot should draw a hexagon around the current location of the robot and the trace of the TCP will be displayed in yellow.    
Alternatively, right click the program and select RoboDK API - Image 5Run Python Script.

7.Right click the RoboDK API - Image 6 SampleOfflineProgramming item and select Edit Python Script. We should see the program as shown in the following image.

The SampleOfflineProgramming macro will draw a polygon of side n_sides and radius R at the current location of the robot, with respect to the robot reference frame. If desired, move the robot to a different location changing the polygon dimensions and re-run the program.

This example is similar to the program displayed in the offline programming section of the website (video included).

RoboDK API - Image 7