A Python application that controls a robotic arm by inputting Cartesian coordinates (X, Y, Z).
Future version: will allow control through individual joint angles, enabling movement by controller and later by AI.
- Move the robotic arm by specifying X, Y, Z coordinates
- Visualize coordinates on an XY plot
- Maintain a FIFO list of coordinates to be executed by the arm
Follow these steps to set up the project and install all required dependencies.
- Clone the repository
git clone https://github.com/yourusername/robotic-arm-controller.git
cd robotic-arm-controller- Create a virtual environment
python -m venv venv- Activate the virtual environment
.\venv\Scripts\Activate.ps1- Install Dependencies
pip install -r requirements.txt- Run the Application
python main.pyWhen you start the application with python main.py, the GUI window will open and let you plot and send coordinate sequences to the robotic arm. Below are general usage instructions and recommended workflows.
- Plotting points: Use the plot area to add or visualise points in the XY plane. Depending on the GUI controls you can typically add points by clicking the plot or by entering exact coordinates in the input fields.
- Adding coordinates to the list: Enter coordinates using the provided input fields (X, Y, Z) and press the button to append them to the coordinate list. The list follows a FIFO protocol: the oldest coordinate will be executed first when you send the list to the arm.
- Editing / Removing points: Use the list controls to remove or reorder entries before sending. If the GUI supports it, select a point and delete or edit the values.
- Sending to the arm: There is a control/button to send the queued coordinate list to the robotic arm. Press it to begin execution. Monitor the GUI for status updates or errors.
- Start / Stop / Pause: Use the provided start/stop/pause controls to control execution. If your GUI does not have pause, stop will typically abort execution and clear or retain the queue depending on settings.
- Coordinates are Cartesian triples:
X, Y, Z(units depend on your arm configuration, commonly millimeters). - Example entry:
X: 150, Y: 0, Z: 100 - Example list (pseudo-format):
[(150, 0, 100), (160, 20, 90), (140, -20, 95)]
- Start the application:
python main.pyand wait for the GUI window. - Use the plot or input fields to add the desired waypoints to the list.
- Verify the order of waypoints in the FIFO list. Edit or remove any points as needed.
- Click
Send(or equivalent) to begin execution on the robotic arm. - Monitor the status in the GUI and use
Stopimmediately if anything behaves unexpectedly.
- Safety first: Keep a safe distance from the arm during motion. Ensure no objects or people are inside the workspace when commanding moves.
- Limits: If a coordinate is outside the robot's reachable workspace, the arm may error or behave unpredictably. Validate coordinates before sending.
- Connection errors: If the GUI cannot communicate with the arm, check cables, power, and the device connection settings (serial port, IP, etc.). Restart the app after fixing connection issues.
- Logs / Errors: Check the terminal running
main.pyfor log output and error messages — they usually provide clues for what went wrong.
- Add three points:
(150, 0, 100),(160, 20, 90),(140, -20, 95). - Confirm order in the FIFO list.
- Click
Sendto move the arm through the points in order.
This project works on macOS with these small adjustments. Use python3 on macOS and create/activate the virtual environment as shown below.
- Create venv:
python3 -m venv venv- Activate venv (macOS / Bash / Zsh):
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run the application:
python3 main.pyNotes for macOS users:
- If you use a conda environment, you can skip the
venvsteps and useconda activateinstead. - If any GUI libraries require a specific backend on macOS (e.g., for matplotlib), the terminal logs will indicate missing backends; install the required packages (for example,
pip install pyobjc-framework-Quartzor follow the library-specific instructions).
To interact with the robot the PC must be connected to the robot controller over Ethernet. On Windows the GUI expects the network link on the machine's Ethernet adapter named or routed through Ethernet 2 (this is how our environment is set up). On macOS and other platforms the same idea applies: connect the PC's Ethernet port directly to the robot controller (or to the switch on the same subnet) and ensure your machine's interface is on the same subnet as the robot.
Steps to configure the connection (generic):
- Physically connect an Ethernet cable between your computer and the robot controller or switch.
- Identify the local interface that corresponds to that port (Windows:
Ethernet 2; macOS: likelyen0,en1, or a Thunderbolt Ethernet adapter). Use System Preferences/Settings → Network orifconfig/ipconfigto identify the interface. - Assign a static IP on the same subnet as the robot controller. Example (macOS):
# replace en0 with your interface name and choose an IP in the robot's subnet
sudo ifconfig en0 inet 192.168.1.100 netmask 255.255.255.0On Windows use the GUI network settings to set a manual IPv4 address that matches the robot's subnet and use Ethernet 2 as the active interface.
4. Connect from the GUI using the robot's IP address (enter it in the GUI's connection field or ensure the GUI is configured to use the same interface). If you don't know the robot's IP, check the robot controller documentation, or scan the local subnet with a network tool (for example nmap) to locate the device.
Troubleshooting tips:
- If the GUI shows "Demo Mode (No Robot)", check that the Ethernet interface is up and that the selected interface is the one connected to the robot.
- Ensure any OS firewall is disabled or configured to allow the GUI application to communicate on the local network.
- If you cannot reach the robot, try pinging the robot IP from a terminal to confirm connectivity.
If you'd like, I can extract exact connection fields and button names from Interface.py and update the README to show the exact GUI steps (I won't modify Interface.py itself unless you ask).
