# varadha24/butler_robot architecture

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

- Interactive diagram: https://gitdiagram.com/varadha24/butler_robot
- Repository: https://github.com/varadha24/butler_robot

## Overview

Butler Robot is a ROS-based restaurant delivery robot. Order and cancellation messages enter the main node, which delegates delivery and cancellation behavior to their handlers; those handlers direct robot movement, while order handling waits for confirmation state before continuing. The README also describes multiple-order handling, but the sampled code shows no separate queue. The graph reflects shown calls and parameter access; confirmation handling is instantiated by the node, but no invocation path is shown.

Main entry points: [`src/robot_butler_node.py`](https://github.com/varadha24/butler_robot/blob/main/src/robot_butler_node.py) (Butler Node), [`src/robot_movement.py`](https://github.com/varadha24/butler_robot/blob/main/src/robot_movement.py) (Robot Movement), [`src/order_handler.py`](https://github.com/varadha24/butler_robot/blob/main/src/order_handler.py) (Order Handler), [`src/confirmation_handler.py`](https://github.com/varadha24/butler_robot/blob/main/src/confirmation_handler.py) (Confirmation Handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["ROS Control"]
  node_butler_node["Butler Node"]
end

subgraph group_tasks["Task Handling"]
  node_order_handler["Order Handler<br/>[order_handler.py]"]
  node_confirmation_handler["Confirmation Handler"]
  node_cancellation_handler["Cancellation Handler"]
end

subgraph group_motion["Robot Navigation"]
  node_movement["Robot Movement<br/>[robot_movement.py]"]
end

subgraph group_shared["Shared State"]
  node_param_server[("ROS Parameter Server")]
  node_utils["Logging Utilities<br/>[utils.py]"]
end

node_order_source(("Order Submitter"))
node_cancel_source(("Cancellation Issuer"))
node_nav_stack["ROS Navigation"]

node_order_source -->|"publishes orders"| node_butler_node
node_cancel_source -->|"publishes cancellations"| node_butler_node
node_butler_node -->|"delegates orders"| node_order_handler
node_butler_node -->|"delegates cancellations"| node_cancellation_handler
node_butler_node -->|"instantiates"| node_confirmation_handler
node_order_handler -->|"directs movement"| node_movement
node_order_handler -->|"reads confirmations"| node_param_server
node_cancellation_handler -->|"directs movement"| node_movement
node_confirmation_handler -->|"sets confirmation"| node_param_server
node_movement -->|"sends goals"| node_nav_stack
node_movement -->|"logs via"| node_utils
node_butler_node -->|"logs via"| node_utils

click node_butler_node "https://github.com/varadha24/butler_robot/blob/main/src/robot_butler_node.py"
click node_order_handler "https://github.com/varadha24/butler_robot/blob/main/src/order_handler.py"
click node_confirmation_handler "https://github.com/varadha24/butler_robot/blob/main/src/confirmation_handler.py"
click node_cancellation_handler "https://github.com/varadha24/butler_robot/blob/main/src/cancellation_handler.py"
click node_movement "https://github.com/varadha24/butler_robot/blob/main/src/robot_movement.py"
click node_utils "https://github.com/varadha24/butler_robot/blob/main/src/utils.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_butler_node toneBlue
class node_order_handler,node_confirmation_handler,node_cancellation_handler toneAmber
class node_movement toneMint
class node_param_server,node_utils toneRose
class node_order_source,node_cancel_source,node_nav_stack toneIndigo
```

## Components

### ROS Control

- [Butler Node](https://github.com/varadha24/butler_robot/blob/main/src/robot_butler_node.py): `src/robot_butler_node.py`

### Task Handling

- [Order Handler](https://github.com/varadha24/butler_robot/blob/main/src/order_handler.py): `src/order_handler.py`
- [Confirmation Handler](https://github.com/varadha24/butler_robot/blob/main/src/confirmation_handler.py): `src/confirmation_handler.py`
- [Cancellation Handler](https://github.com/varadha24/butler_robot/blob/main/src/cancellation_handler.py): `src/cancellation_handler.py`

### Robot Navigation

- [Robot Movement](https://github.com/varadha24/butler_robot/blob/main/src/robot_movement.py): `src/robot_movement.py`

### Shared State

- **ROS Parameter Server**
- [Logging Utilities](https://github.com/varadha24/butler_robot/blob/main/src/utils.py): `src/utils.py`

### Other components

- **Order Submitter**
- **Cancellation Issuer**
- **ROS Navigation**

## Connections

- Order Submitter → Butler Node: publishes orders (evidence: `src/robot_butler_node.py`)
- Cancellation Issuer → Butler Node: publishes cancellations (evidence: `src/robot_butler_node.py`)
- Butler Node → Order Handler: delegates orders (evidence: `src/robot_butler_node.py`)
- Butler Node → Cancellation Handler: delegates cancellations (evidence: `src/robot_butler_node.py`)
- Butler Node → Confirmation Handler: instantiates (evidence: `src/robot_butler_node.py`)
- Order Handler → Robot Movement: directs movement (evidence: `src/order_handler.py`)
- Order Handler → ROS Parameter Server: reads confirmations (evidence: `src/order_handler.py`)
- Cancellation Handler → Robot Movement: directs movement (evidence: `src/cancellation_handler.py`)
- Confirmation Handler → ROS Parameter Server: sets confirmation (evidence: `src/confirmation_handler.py`)
- Robot Movement → ROS Navigation: sends goals (evidence: `src/robot_movement.py`)
- Robot Movement → Logging Utilities: logs via (evidence: `src/robot_movement.py`)
- Butler Node → Logging Utilities: logs via (evidence: `src/robot_butler_node.py`)
