# shxnxz/robox architecture

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

- Interactive diagram: https://gitdiagram.com/shxnxz/robox
- Repository: https://github.com/shxnxz/robox

## Overview

This repository is a work-in-progress sushi-restaurant robot combining plate scanning and checkout with customer welcome, queue calling, and ROS motion routines. The principal checkout flow is operator selection → camera-based plate detection → stable-scene counting → bill calculation → receipt and spoken total. README also describes waypoint navigation and an LCD bill display, but the checked-in tree has no corresponding implementation modules, so those capabilities are noted without inventing source nodes. The graph reflects sampled calls and documented behavior; ROS topics and unsampled integrations are represented only where the excerpts show them.

Main entry points: [`Robot_final_laew_I_SUS/plate_checkout.py`](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/plate_checkout.py) (Checkout workflow), [`Robot_final_laew_I_SUS/robot_menu.py`](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/robot_menu.py) (Robot menu), [`ros2_ws/src/bill_aggregator/price_callout_node.py`](https://github.com/shxnxz/robox/blob/main/ros2_ws/src/bill_aggregator/price_callout_node.py) (Price callout node), [`Robot_final_laew_I_SUS/robot_voice_command.py`](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/robot_voice_command.py) (Voice queue commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_checkout["Plate checkout"]
  node_checkout_app["Checkout workflow<br/>[plate_checkout.py]"]
  node_detection["Plate detection<br/>[plate_checkout.py]"]
  node_scene_scanner["Stable scene counting<br/>[billing.py]"]
  node_billing["Bill calculation<br/>[billing.py]"]
  node_prices["Billing settings"]
  node_receipt["Saved receipt<br/>[plate_checkout.py]"]
  node_price_callout["Price callout node"]
end

subgraph group_robot["Robot operation"]
  node_menu["Robot menu<br/>[robot_menu.py]"]
  node_scanner["Plate scan<br/>[scan_plate_360.py]"]
  node_drift["Figure-eight motion"]
end

subgraph group_queue["Queue and speech"]
  node_voice_command["Voice queue commands"]
  node_queue_state[("Queue number state<br/>[queue_number.txt]")]
end

node_operator(("Operator"))
node_tts["Yahboom TTS"]
node_camera["Camera"]
node_ros_topics["ROS topics"]

node_operator -->|"selects mode"| node_menu
node_menu -->|"starts checkout"| node_checkout_app
node_menu -->|"starts scan"| node_scanner
node_menu -->|"starts motion"| node_drift
node_menu -->|"starts commands"| node_voice_command
node_scanner -->|"reads frames"| node_camera
node_checkout_app -->|"detects plates"| node_detection
node_checkout_app -->|"updates counts"| node_scene_scanner
node_checkout_app -->|"creates bill"| node_billing
node_checkout_app -->|"loads settings"| node_prices
node_checkout_app -->|"writes receipt"| node_receipt
node_price_callout -->|"subscribes total"| node_ros_topics
node_price_callout -->|"publishes text"| node_ros_topics
node_price_callout -.->|"sends speech"| node_tts
node_voice_command -->|"reads and saves"| node_queue_state
node_voice_command -->|"uses queue speech"| node_menu

click node_menu "https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/robot_menu.py"
click node_scanner "https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/scan_plate_360.py"
click node_checkout_app "https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/plate_checkout.py"
click node_detection "https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/plate_checkout.py"
click node_scene_scanner "https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/billing.py"
click node_billing "https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/billing.py"
click node_prices "https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/billing_config.json"
click node_receipt "https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/plate_checkout.py"
click node_voice_command "https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/robot_voice_command.py"
click node_queue_state "https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/queue_number.txt"
click node_price_callout "https://github.com/shxnxz/robox/blob/main/ros2_ws/src/bill_aggregator/price_callout_node.py"

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_checkout_app,node_detection,node_scene_scanner,node_billing,node_prices,node_receipt,node_price_callout toneBlue
class node_menu,node_scanner,node_drift toneAmber
class node_voice_command,node_queue_state toneMint
class node_operator,node_tts,node_camera,node_ros_topics toneIndigo
```

## Components

### Plate checkout

- [Checkout workflow](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/plate_checkout.py): `Robot_final_laew_I_SUS/plate_checkout.py`
- [Plate detection](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/plate_checkout.py): `Robot_final_laew_I_SUS/plate_checkout.py`
- [Stable scene counting](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/billing.py): `Robot_final_laew_I_SUS/billing.py`
- [Bill calculation](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/billing.py): `Robot_final_laew_I_SUS/billing.py`
- [Billing settings](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/billing_config.json): `Robot_final_laew_I_SUS/billing_config.json`
- [Saved receipt](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/plate_checkout.py): `Robot_final_laew_I_SUS/plate_checkout.py`
- [Price callout node](https://github.com/shxnxz/robox/blob/main/ros2_ws/src/bill_aggregator/price_callout_node.py): `ros2_ws/src/bill_aggregator/price_callout_node.py`

### Robot operation

- [Robot menu](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/robot_menu.py): `Robot_final_laew_I_SUS/robot_menu.py`
- [Plate scan](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/scan_plate_360.py): `Robot_final_laew_I_SUS/scan_plate_360.py`
- **Figure-eight motion**

### Queue and speech

- [Voice queue commands](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/robot_voice_command.py): `Robot_final_laew_I_SUS/robot_voice_command.py`
- [Queue number state](https://github.com/shxnxz/robox/blob/main/Robot_final_laew_I_SUS/queue_number.txt): `Robot_final_laew_I_SUS/queue_number.txt`

### Other components

- **Operator**
- **Yahboom TTS**
- **Camera**
- **ROS topics**

## Connections

- Operator → Robot menu: selects mode (evidence: `Robot_final_laew_I_SUS/robot_menu.py`)
- Robot menu → Checkout workflow: starts checkout (evidence: `Robot_final_laew_I_SUS/robot_menu.py`)
- Robot menu → Plate scan: starts scan (evidence: `Robot_final_laew_I_SUS/robot_menu.py`)
- Robot menu → Figure-eight motion: starts motion (evidence: `Robot_final_laew_I_SUS/robot_menu.py`)
- Robot menu → Voice queue commands: starts commands (evidence: `Robot_final_laew_I_SUS/robot_menu.py`)
- Plate scan → Camera: reads frames (evidence: `Robot_final_laew_I_SUS/scan_plate_360.py`)
- Checkout workflow → Plate detection: detects plates (evidence: `Robot_final_laew_I_SUS/plate_checkout.py`)
- Checkout workflow → Stable scene counting: updates counts (evidence: `Robot_final_laew_I_SUS/plate_checkout.py`)
- Checkout workflow → Bill calculation: creates bill (evidence: `Robot_final_laew_I_SUS/plate_checkout.py`)
- Checkout workflow → Billing settings: loads settings (evidence: `Robot_final_laew_I_SUS/plate_checkout.py`)
- Checkout workflow → Saved receipt: writes receipt (evidence: `Robot_final_laew_I_SUS/plate_checkout.py`)
- Price callout node → ROS topics: subscribes total (evidence: `ros2_ws/src/bill_aggregator/price_callout_node.py`)
- Price callout node → ROS topics: publishes text (evidence: `ros2_ws/src/bill_aggregator/price_callout_node.py`)
- Price callout node → Yahboom TTS: sends speech
- Voice queue commands → Queue number state: reads and saves (evidence: `Robot_final_laew_I_SUS/robot_voice_command.py`)
- Voice queue commands → Robot menu: uses queue speech (evidence: `Robot_final_laew_I_SUS/robot_voice_command.py`)
