AR4 (MK2) External Control through python
@chrisannin, first of all I would like to thank you for all the hard work that already went into this magnificent project. I love to play around with this robot.
I have no remarks to the provided software whatsoever. It works beautifully, is easy-to-use and provides sufficient functionality for most applications. Yet I am looking for a way to control the robot through Python. Since the provided software is written in Python, I was wondering if someone already took the time to write a Python API (so without GUI) for the robot. I searched the internet, yet could not locate such an API.
I seems that RoboDK has created such an API, yet it is not usable apart from their software. Also, ROS2 seems to be an option for external control, yet my current knowledge of ROS2 is very limited, so at this point I would like to stay away from that.
The options for external control I am looking for to use are:
-
Calibrate the robot
-
Move the robot manually (based on joint angles and or Cartesian coordinates)
-
Load and execute programs with splines
-
Optionally, create new programs
The reason I would like to externally control the robot is that I wish to control the robot using a PLC which provides an interface to many programming languages like c, c#, Python,...
Thanks,
Jona
Thanks Chris,
I was already aware of that by looking at your source code and the software. I was hoping someone already did the work of extracting an api out of the source code, which would save me quite a bit of time.
I will give it a shot myself. I will keep you posted when I have something that works.
Thanks again.
Hi Chris,
It took me a while to get a first version working. I still call it version 0.1 because the arc anc circle moves are not tested. The joint and linear moves work. It is derived from your application source.
If you have any remarks or suggestions, feel free to respond.
You can find the API here:
When Trying, Be sure to include the robot calibration file, called "ARbot.cal" into the project directory, as the API loads the same file.
https://github.com/Jones1403/AR4_PyAPI
Thanks again @chrisannin for all the hard work that went into this project already.
This code was only tested on an AR4 MK2, however, I suspect none or only minor issues with other versions.
8 replies

Chris Annin
The robot can be controlled through simple serial commands. This video at 4:35 covers that topic
Let me know if that helps.