ArfBotOS is a mixed hardware/software robotics project centered on a 6-axis robot and vision system. The repository combines:
- CODESYS PLC project files and scripts
- Arduino firmware for robot and remote I/O hardware
- OpenCV-based vision utilities and a small web server
- Setup, electrical, and project example documentation
When starting a new session in this repo, read these files first:
README.mdNOTES.mdRobots/AR4/README.MDif the work touches robot hardware, setup, or firmwareProjects/HelloWorld/README.mdif the work involves first-run or demo-program behavior
- Main PLC project assets, including
ArfBot.project, XML exports, installation config, and helper scripts. Codesys/scriptengine/is intended as a local-only copy of the CODESYS Python stub files for editor/runtime automation; do not commit it.- To populate it locally, copy from
C:\Program Files\CODESYS 3.5.20.30\CODESYS\ScriptLib\Stubs\scriptengine. - CODESYS automation scripts for this repo live in
Codesys/Scripts/; they run through the CODESYS scripting host, optionally launched from terminal viaCODESYS.exe --runscriptor a Python wrapper. - Treat this as the core runtime/control logic area.
- AR4 robot integration docs, electrical references, setup procedures, and Arduino firmware.
- Important subareas:
Setup/for tuning, mastering, and programming notesArduino/for firmware used by the robot and remote I/O hardwareElectrical/for schematics and wiring references
- Vision-related Python utilities, calibration helpers, template matching experiments, and socket tools.
- The live Flask UI moved to
Web/.OpenCV/VisionWebServeris leftover source and is not deployed.
- Combined Flask app on port 5000: vision templates at
/vision, saved templates at/vision/files, robot animator at/animator, Bluetooth pairing at/bluetooth, HMI image at/vision/output_sized. - Deployed by the Pi installer to
/var/opt/codesys/PlcLogic/Application/Web. Theme is ArfBot Night.
- Raspberry Pi Linux installer:
scripts/install-pi.sh. - Default target is Raspberry Pi OS 64-bit Lite with CODESYS Control Raspberry Pi 64 SL. 32-bit is no longer the documented path.
curl -sSL https://raw.githubusercontent.com/dalethomas81/ArfBotOS/main/scripts/install-pi.sh | bashfetches the installer frommain, then clones the latest GitHub release tag (same tree as the release source zip).--ref mainfor tip-of-tree;--ref <tag>to pin. Flags:--plc-only(no camera/OpenCV; still DualSense + Bluetooth/animator web),--vision-only(no DualSense/CODESYS; still vision + animator web). Writes/var/opt/codesys/PlcLogic/Application/RELEASE(one-line tag) for the HMI to read via SysFile asApplication/RELEASE.- Recommended PLC Pi order: image the Pi, Tools → Update Raspberry Pi, Multiple Download of
ArfBot.project, then the installer. If the runtime was missing, re-run afterward only to setSysProcess=AllowAll. - Covers camera overlay, OpenCV, the combined web UI (
Web/→Application/Webon :5000), vision/controller systemd services, and CODESYSSysProcess=AllowAllwhen the runtime is already present. It does not install the CODESYS Windows IDE, runtime, licenses, or Arduino/Teensy firmware.
- Python scripts related to PlayStation DualSense controller integration.
- Example or application-specific content such as
HelloWorld,HelloWorld-CNC, andEggMaker.
- Supporting images, device description files, and bundled reference material used by docs and setup flows.
- Type stubs and helper files related to CODESYS scripting support.
- The user is usually referring to this repo root when they say "the current project".
- This is not a pure software app; changes may affect PLC behavior, robot motion, electrical integration, or vision tooling.
- Favor cautious edits and preserve existing conventions unless the user asks for a broader refactor.
- Check for documentation that already describes the workflow before changing setup-related files.
- For PLC/runtime work, inspect
Codesys/first and use the top-levelREADME.mdas the architectural overview. - For robot bring-up, use the AR4 docs before modifying firmware or setup instructions.
- For vision work, determine whether the target lives in
Web/(operator UI), a reusable OpenCV utility, or a one-off test script before editing. - For user-facing tutorials or onboarding, keep the "new automation/control engineer" audience in mind.
- The README describes ArfBotOS as an operating system for a 6-axis robot and vision system running on CODESYS, Arduino, and OpenCV.
- The software architecture uses command "processors" that extend a PackML-style state machine.
- The HMI is web-based and hosted through CODESYS Visu.
- The project is intended both as a working robot control stack and as an educational example of IEC-61131 structured-text industrial programming.
NOTES.mdcontains active TODO items, hardware pin notes, and handy Linux/Raspberry Pi commands.- Treat
NOTES.mdas informal project state, not necessarily a guaranteed source of truth.
If a future session starts cold, do this:
- Confirm the workspace root is
ArfBotOS. - Read
README.mdfor system purpose and architecture. - Read
NOTES.mdfor current rough priorities and operational tips. - Read the nearest subsystem README for the area being edited.
- Inspect the specific code or assets only after the above context is loaded.
- Update this file when major architecture decisions, preferred workflows, or important project entry points change.
- Keep it short, practical, and focused on helping future sessions get productive quickly.