# gtcodes22/cubiclean_farm_robot architecture

> Architecture diagram of the GitHub repository gtcodes22/cubiclean_farm_robot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gtcodes22/cubiclean_farm_robot
- Repository: https://github.com/gtcodes22/cubiclean_farm_robot

## Overview

Cubiclean’s intended workflow is waypoint-based bedding surveillance: the robot navigates stops, collects chemical and odometry readings, sends CSVs to a PC server, and exposes readings to operators through web and app interfaces. The README documents navigation and viewer capabilities whose implementation files are absent from this tree; those are represented only at supported enclosing-directory paths. The sampled source confirms the client’s command handling, while detailed sensor, server, and viewer wiring is based on README descriptions.

Main entry points: [`server_main.py`](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server_main.py) (Server runtime), [`bot_get_readings.py`](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/bot_get_readings.py) (Bot collection), [`bot_main.py`](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/bot_main.py) (Robot bridge), [`server/ThreadedTCPServer.py`](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server/ThreadedTCPServer.py) (TCP receiver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_robot["Robot workflow"]
  node_nav["Waypoint navigation"]
  node_bot_collect["Bot collection"]
  node_bot_main["Robot bridge<br/>[bot_main.py]"]
  node_query["Command handler<br/>[query_handler.py]"]
end

subgraph group_sensing["Sensing"]
  node_sensor_logger["Sensor logger"]
  node_sensor_drivers["Sensor drivers"]
  node_odom["Odometry capture"]
end

subgraph group_backend["Backend"]
  node_server_entry["Server runtime<br/>[server_main.py]"]
  node_tcp_server["TCP receiver"]
  node_packet["Packet protocol<br/>[packet.py]"]
  node_bed_data[("Bed data<br/>[BedData.py]")]
  node_qt_ui["Operator GUI<br/>[mainwindow.py]"]
end

subgraph group_operator["Operator interfaces"]
  node_dashboard["Web dashboard"]
  node_mobile_viewer["Mobile desktop app"]
end

node_operator_user(("Operator"))
node_server(("PC server"))
node_sensors{{"Onboard sensors"}}

node_nav -.->|"triggers at stops"| node_bot_collect
node_bot_collect -->|"calls logger"| node_sensor_logger
node_sensor_logger -->|"reads sensors"| node_sensor_drivers
node_bot_collect -->|"captures alongside"| node_odom
node_bot_collect -->|"signals CSV paths"| node_bot_main
node_bot_main -->|"sends CSV data"| node_server_entry
node_server -->|"hosts"| node_server_entry
node_server_entry -->|"starts receiver"| node_tcp_server
node_tcp_server -->|"decodes packets"| node_packet
node_tcp_server -->|"stores CSVs"| node_bed_data
node_server_entry -->|"starts GUI"| node_qt_ui
node_server_entry -->|"serves dashboard"| node_dashboard
node_operator_user -->|"views readings"| node_dashboard
node_operator_user -->|"views data"| node_mobile_viewer
node_dashboard -->|"reads CSVs"| node_bed_data
node_query -->|"signals commands"| node_bot_main
node_bot_main -->|"dispatches queries"| node_query

click node_nav "https://github.com/gtcodes22/cubiclean_farm_robot/tree/main/turtlebot3_ws"
click node_bot_collect "https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/bot_get_readings.py"
click node_bot_main "https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/bot_main.py"
click node_query "https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/turtlebot_client/query_handler.py"
click node_sensor_logger "https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/bed_webview/sci_i2c_logger_unified.py"
click node_sensor_drivers "https://github.com/gtcodes22/cubiclean_farm_robot/tree/main/chemical_sensor_drivers"
click node_odom "https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/bot_get_readings.py"
click node_server_entry "https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server_main.py"
click node_tcp_server "https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server/ThreadedTCPServer.py"
click node_packet "https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server/packet.py"
click node_bed_data "https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server/BedData.py"
click node_qt_ui "https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server/pyqt/mainwindow.py"
click node_dashboard "https://github.com/gtcodes22/cubiclean_farm_robot/tree/main/bed_webview"
click node_mobile_viewer "https://github.com/gtcodes22/cubiclean_farm_robot/tree/main/data_viewer"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_nav,node_bot_collect,node_bot_main,node_query toneBlue
class node_sensor_logger,node_sensor_drivers,node_odom toneAmber
class node_server_entry,node_tcp_server,node_packet,node_bed_data,node_qt_ui,node_server toneMint
class node_dashboard,node_mobile_viewer toneRose
class node_operator_user,node_sensors toneIndigo
```

## Components

### Robot workflow

- [Waypoint navigation](https://github.com/gtcodes22/cubiclean_farm_robot/tree/main/turtlebot3_ws): `turtlebot3_ws`
- [Bot collection](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/bot_get_readings.py): `bot_get_readings.py`
- [Robot bridge](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/bot_main.py): `bot_main.py`
- [Command handler](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/turtlebot_client/query_handler.py): `turtlebot_client/query_handler.py`

### Sensing

- [Sensor logger](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/bed_webview/sci_i2c_logger_unified.py): `bed_webview/sci_i2c_logger_unified.py`
- [Sensor drivers](https://github.com/gtcodes22/cubiclean_farm_robot/tree/main/chemical_sensor_drivers): `chemical_sensor_drivers`
- [Odometry capture](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/bot_get_readings.py): `bot_get_readings.py`

### Backend

- [Server runtime](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server_main.py): `server_main.py`
- [TCP receiver](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server/ThreadedTCPServer.py): `server/ThreadedTCPServer.py`
- [Packet protocol](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server/packet.py): `server/packet.py`
- [Bed data](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server/BedData.py): `server/BedData.py`
- [Operator GUI](https://github.com/gtcodes22/cubiclean_farm_robot/blob/main/server/pyqt/mainwindow.py): `server/pyqt/mainwindow.py`

### Operator interfaces

- [Web dashboard](https://github.com/gtcodes22/cubiclean_farm_robot/tree/main/bed_webview): `bed_webview`
- [Mobile desktop app](https://github.com/gtcodes22/cubiclean_farm_robot/tree/main/data_viewer): `data_viewer`

### Other components

- **Operator**
- **PC server**
- **Onboard sensors**

## Connections

- Waypoint navigation → Bot collection: triggers at stops
- Bot collection → Sensor logger: calls logger
- Sensor logger → Sensor drivers: reads sensors
- Bot collection → Odometry capture: captures alongside
- Bot collection → Robot bridge: signals CSV paths
- Robot bridge → Server runtime: sends CSV data
- PC server → Server runtime: hosts
- Server runtime → TCP receiver: starts receiver
- TCP receiver → Packet protocol: decodes packets
- TCP receiver → Bed data: stores CSVs
- Server runtime → Operator GUI: starts GUI
- Server runtime → Web dashboard: serves dashboard
- Operator → Web dashboard: views readings
- Operator → Mobile desktop app: views data
- Web dashboard → Bed data: reads CSVs
- Command handler → Robot bridge: signals commands
- Robot bridge → Command handler: dispatches queries
