-
Notifications
You must be signed in to change notification settings - Fork 92
Python Control
Once the server module is loaded onto the ABB robot controller, and started (in automatic mode, ABB Menu Button > Production Window, "PP to Main", press physical start button) any computer on the network can very simply interact with the robot via the Python Robot object. It is totally platform independent, working with only the Python Standard Library.
Before moving the robot, you may want to turn the speed down to a low percentage of set speed, do this by clicking the menu button on the lower right of the teach pendant, Speed > 25% (or lower)
Keep clear of the robot when the program is running.
$ python
>>> import robot
>>> R = robot.Robot(IP='192.168.125.1') #this is the default, you don't need to include it
>>> R.setCartesian(1000,0,1000], [0,0,1,0)
And it moves! That command will move it to X= 1000mm, Y=0mm, Z=1000mm. The next four numbers represent quaternion orientation , the important thing to remember being that q = [0,0,1,0] points the tool down and q = [1,0,0,0] points the tool up.
Usually it is not necessary or desirable to specify the quaternions by hand, but rather rotate around things, check out Christoph Gohlke's [great transformations library] for this (http://www.lfd.uci.edu/~gohlke/code/transformations.py) (requires Numpy).
Other commands include joint moves (where you specify the angles of joints 1-6 in degrees)
>>> R.setJoints([0,0,0,0,90,0])
And many others.