The Robot Arm Controller consists of two parts. The user interface is written as a webpage frontend and a small websocket to serial backend.
Running the Robot Arm Controller is usually done by starting the backend and then connecting to the backend from a browser using the frontend.
Start the backend by running the Python 3 script called __main__.py
. The script has some dependencies on other
modules, and they can be installed using the supplied requirements.txt
file. It is recommended that the user
creates a virtual environment before installing the dependencies.
pip install -r requirements.txt
python3 . COM_PORT SOCKET_PORT
Open index.htm
in Firefox (could work in other browsers).
Press Connect
in the GUI.
An Arduino, should be connected to the computer using the USB cable. SERVOS amount of servos should be connected starting at pin SERVO_START_PIN.
- Upload Arduino software to Romeo board:
- Connect Romeo to computer using the USB cable.
- Open Arduino sketch
arduino/robotArmController.ino
using Arduino IDE. - Make sure the correct COM port is selected under Tools->Port.
- Make sure the correct Board is selected under Tools->Board->Arduino Uno.
- Upload sketch to Romeo using Sketch->Upload.
- Create a virtual environment for Python3:
- Windows:
python.exe -m venv venv
. - Linux:
python -m venv venv
.
- Windows:
- Activate the virtual environment:
- Windows:
venv/Scripts/activate.bat
. - Linux:
. venv/bin/activate
.
- Windows:
- Install required Python modules using
pip install -r requirements.txt
. - Start Python program with the COM port where the Arduino is connected:
- Windows:
python.exe . COM1 8765
. (Substitute COM1 with correct COM port) - Linux:
python . /dev/ttyACM0 8765
. (Substitute ttyACM0 with correct COM port)
- Windows: