# botbotrobotics/botbrain architecture

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

- Interactive diagram: https://gitdiagram.com/botbotrobotics/botbrain
- Repository: https://github.com/botbotrobotics/botbrain

## Overview

BotBrain is a modular ROS 2 robot-control platform with a Next.js web interface. The user-facing flow is to select a robot and operate it through dashboards, cockpit/custom controls, or missions; the frontend sends commands and reads telemetry through ROS, while robot-specific packages and navigation, localization, and orchestration provide runtime capabilities. The README documents broader features than the sampled source confirms; those branches are included, but unverified internal links are omitted. The hardware and ROS deployment are represented at subsystem level where implementation was not sampled.

Main entry points: [`frontend/src/utils/ros/topics-and-services-v2.tsx`](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/utils/ros/topics-and-services-v2.tsx) (ROS topic/service factory), [`botbrain_ws/src/bot_state_machine/src/lifecycle_manager.cpp`](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_state_machine/src/lifecycle_manager.cpp) (Lifecycle manager), [`frontend/src/app/dashboard/page.tsx`](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/dashboard/page.tsx) (Dashboard & fleet), [`frontend/src/hooks/useBlockProgramExecution.tsx`](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/hooks/useBlockProgramExecution.tsx) (Block program execution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Interface"]
  node_dashboard["Dashboard &amp; fleet<br/>[page.tsx]"]
  node_cockpit["Cockpit controls<br/>[cockpit-client.tsx]"]
  node_customui["Custom control UI<br/>[page.tsx]"]
  node_missionui["Mission planning<br/>[page.tsx]"]
  node_mapsui["Maps &amp; navigation UI<br/>[page.tsx]"]
  node_healthui["Health &amp; diagnostics UI<br/>[page.tsx]"]
  node_profiles["Robot profiles<br/>[index.ts]"]
  node_rosfactory["ROS topic/service factory"]
  node_program["Block program execution"]
  node_missionsvc["Mission services<br/>[missions.ts]"]
  node_supabase[("User &amp; dashboard storage<br/>[supabase-client.ts]")]
end

subgraph group_ros["ROS Runtime"]
  node_rosgraph{{"ROS 2 robot graph"}}
end

subgraph group_robot["Robot Platforms"]
  node_go2["Unitree Go2 interface<br/>[go2.py]"]
  node_go2w["Unitree Go2-W interface<br/>[go2w.py]"]
  node_g1write["G1 command interface<br/>[g1_write.cpp]"]
  node_g1driver["G1 hardware driver<br/>[g1_driver.cpp]"]
  node_tita["Tita interface<br/>[tita.py]"]
end

subgraph group_ops["Autonomy &amp; Operations"]
  node_stategraph["Lifecycle dependency graph<br/>[graph_node.hpp]"]
  node_lifecycler["Lifecycle manager"]
  node_statecontroller["State controller"]
  node_localization["SLAM &amp; localization"]
  node_navigation["Nav2 planning<br/>[nav2.launch.py]"]
  node_yolo["YOLO perception<br/>[yolo_node.py]"]
  node_rosa["ROSA language control<br/>[llm.py]"]
  node_jetson["Jetson monitoring &amp; WiFi<br/>[ros2_jtop_node.py]"]
  node_bringup["Robot bringup<br/>[bringup.launch.py]"]
end

node_operator(("Robot operator"))

node_operator -->|"opens"| node_dashboard
node_operator -->|"controls"| node_cockpit
node_operator -->|"customizes"| node_customui
node_operator -->|"plans missions"| node_missionui
node_cockpit -.->|"uses ROS"| node_rosfactory
node_customui -.->|"uses ROS"| node_rosfactory
node_missionui -.->|"manages missions"| node_missionsvc
node_program -.->|"publishes commands"| node_rosfactory
node_program -.->|"executes from UI"| node_dashboard
node_rosfactory -->|"sends and reads"| node_rosgraph
node_dashboard -.->|"stores preferences"| node_supabase
node_profiles -->|"configures topics"| node_rosfactory
node_rosgraph -.->|"hosts manager"| node_lifecycler
node_lifecycler -->|"loads node graph"| node_stategraph
node_lifecycler -->|"controls lifecycle"| node_statecontroller
node_statecontroller -->|"requests transitions"| node_lifecycler
node_rosgraph -.->|"provides sensor data"| node_localization
node_localization -.->|"supports mapping"| node_navigation
node_navigation -.->|"plans robot motion"| node_rosgraph
node_rosgraph -.->|"provides camera input"| node_yolo
node_rosgraph -.->|"receives robot commands"| node_rosa
node_rosgraph -.->|"publishes diagnostics"| node_jetson
node_bringup -.->|"starts robot system"| node_rosgraph
node_rosgraph -.->|"exchanges robot commands"| node_go2
node_rosgraph -.->|"exchanges robot commands"| node_go2w
node_rosgraph -.->|"routes robot commands"| node_g1write
node_g1write -->|"controls hardware"| node_g1driver
node_rosgraph -.->|"exchanges robot commands"| node_tita

click node_dashboard "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/dashboard/page.tsx"
click node_cockpit "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/cockpit/cockpit-client.tsx"
click node_customui "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/my-ui/page.tsx"
click node_missionui "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/missions/page.tsx"
click node_mapsui "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/maps/page.tsx"
click node_healthui "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/health/page.tsx"
click node_profiles "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/config/robot-profiles/index.ts"
click node_rosfactory "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/utils/ros/topics-and-services-v2.tsx"
click node_program "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/hooks/useBlockProgramExecution.tsx"
click node_missionsvc "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/services/missions.ts"
click node_supabase "https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/utils/supabase-client.ts"
click node_stategraph "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_state_machine/include/graph_node.hpp"
click node_lifecycler "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_state_machine/src/lifecycle_manager.cpp"
click node_statecontroller "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_state_machine/src/state_controller.cpp"
click node_localization "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_localization/bot_localization/launch/rtab_manager.launch.py"
click node_navigation "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_navigation/launch/nav2.launch.py"
click node_yolo "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_yolo/bot_yolo/yolo_node.py"
click node_rosa "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_rosa/bot_rosa/llm.py"
click node_jetson "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_jetson_stats/bot_jetson_stats/scripts/ros2_jtop_node.py"
click node_go2 "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/go2_pkg/go2_pkg/tools/go2.py"
click node_go2w "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/go2w_pkg/go2w_pkg/tools/go2w.py"
click node_g1write "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/g1_pkg/src/g1_write.cpp"
click node_g1driver "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/g1_pkg/src/g1_driver/g1_driver.cpp"
click node_tita "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/tita_pkg/tita_pkg/tools/tita.py"
click node_bringup "https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_bringup/launch/bringup.launch.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_dashboard,node_cockpit,node_customui,node_missionui,node_mapsui,node_healthui,node_profiles,node_rosfactory,node_program,node_missionsvc,node_supabase toneBlue
class node_rosgraph toneAmber
class node_go2,node_go2w,node_g1write,node_g1driver,node_tita toneMint
class node_stategraph,node_lifecycler,node_statecontroller,node_localization,node_navigation,node_yolo,node_rosa,node_jetson,node_bringup toneRose
class node_operator toneIndigo
```

## Components

### Web Interface

- [Dashboard & fleet](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/dashboard/page.tsx): `frontend/src/app/dashboard/page.tsx`
- [Cockpit controls](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/cockpit/cockpit-client.tsx): `frontend/src/app/cockpit/cockpit-client.tsx`
- [Custom control UI](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/my-ui/page.tsx): `frontend/src/app/my-ui/page.tsx`
- [Mission planning](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/missions/page.tsx): `frontend/src/app/missions/page.tsx`
- [Maps & navigation UI](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/maps/page.tsx): `frontend/src/app/maps/page.tsx`
- [Health & diagnostics UI](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/app/health/page.tsx): `frontend/src/app/health/page.tsx`
- [Robot profiles](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/config/robot-profiles/index.ts): `frontend/src/config/robot-profiles/index.ts`
- [ROS topic/service factory](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/utils/ros/topics-and-services-v2.tsx): `frontend/src/utils/ros/topics-and-services-v2.tsx`
- [Block program execution](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/hooks/useBlockProgramExecution.tsx): `frontend/src/hooks/useBlockProgramExecution.tsx`
- [Mission services](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/services/missions.ts): `frontend/src/services/missions.ts`
- [User & dashboard storage](https://github.com/botbotrobotics/botbrain/blob/main/frontend/src/utils/supabase-client.ts): `frontend/src/utils/supabase-client.ts`

### ROS Runtime

- **ROS 2 robot graph**

### Robot Platforms

- [Unitree Go2 interface](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/go2_pkg/go2_pkg/tools/go2.py): `botbrain_ws/src/go2_pkg/go2_pkg/tools/go2.py`
- [Unitree Go2-W interface](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/go2w_pkg/go2w_pkg/tools/go2w.py): `botbrain_ws/src/go2w_pkg/go2w_pkg/tools/go2w.py`
- [G1 command interface](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/g1_pkg/src/g1_write.cpp): `botbrain_ws/src/g1_pkg/src/g1_write.cpp`
- [G1 hardware driver](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/g1_pkg/src/g1_driver/g1_driver.cpp): `botbrain_ws/src/g1_pkg/src/g1_driver/g1_driver.cpp`
- [Tita interface](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/tita_pkg/tita_pkg/tools/tita.py): `botbrain_ws/src/tita_pkg/tita_pkg/tools/tita.py`

### Autonomy & Operations

- [Lifecycle dependency graph](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_state_machine/include/graph_node.hpp): `botbrain_ws/src/bot_state_machine/include/graph_node.hpp`
- [Lifecycle manager](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_state_machine/src/lifecycle_manager.cpp): `botbrain_ws/src/bot_state_machine/src/lifecycle_manager.cpp`
- [State controller](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_state_machine/src/state_controller.cpp): `botbrain_ws/src/bot_state_machine/src/state_controller.cpp`
- [SLAM & localization](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_localization/bot_localization/launch/rtab_manager.launch.py): `botbrain_ws/src/bot_localization/bot_localization/launch/rtab_manager.launch.py`
- [Nav2 planning](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_navigation/launch/nav2.launch.py): `botbrain_ws/src/bot_navigation/launch/nav2.launch.py`
- [YOLO perception](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_yolo/bot_yolo/yolo_node.py): `botbrain_ws/src/bot_yolo/bot_yolo/yolo_node.py`
- [ROSA language control](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_rosa/bot_rosa/llm.py): `botbrain_ws/src/bot_rosa/bot_rosa/llm.py`
- [Jetson monitoring & WiFi](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_jetson_stats/bot_jetson_stats/scripts/ros2_jtop_node.py): `botbrain_ws/src/bot_jetson_stats/bot_jetson_stats/scripts/ros2_jtop_node.py`
- [Robot bringup](https://github.com/botbotrobotics/botbrain/blob/main/botbrain_ws/src/bot_bringup/launch/bringup.launch.py): `botbrain_ws/src/bot_bringup/launch/bringup.launch.py`

### Other components

- **Robot operator**

## Connections

- Robot operator → Dashboard & fleet: opens (evidence: `README.md`)
- Robot operator → Cockpit controls: controls (evidence: `README.md`)
- Robot operator → Custom control UI: customizes (evidence: `README.md`)
- Robot operator → Mission planning: plans missions (evidence: `README.md`)
- Cockpit controls → ROS topic/service factory: uses ROS
- Custom control UI → ROS topic/service factory: uses ROS
- Mission planning → Mission services: manages missions
- Block program execution → ROS topic/service factory: publishes commands
- Block program execution → Dashboard & fleet: executes from UI
- ROS topic/service factory → ROS 2 robot graph: sends and reads (evidence: `README.md`)
- Dashboard & fleet → User & dashboard storage: stores preferences
- Robot profiles → ROS topic/service factory: configures topics (evidence: `frontend/src/utils/ros/topics-and-services-v2.tsx`)
- ROS 2 robot graph → Lifecycle manager: hosts manager
- Lifecycle manager → Lifecycle dependency graph: loads node graph (evidence: `botbrain_ws/src/bot_state_machine/src/lifecycle_manager.cpp`)
- Lifecycle manager → State controller: controls lifecycle (evidence: `botbrain_ws/src/bot_state_machine/src/lifecycle_manager.cpp`)
- State controller → Lifecycle manager: requests transitions (evidence: `botbrain_ws/src/bot_state_machine/src/state_controller.cpp`)
- ROS 2 robot graph → SLAM & localization: provides sensor data
- SLAM & localization → Nav2 planning: supports mapping
- Nav2 planning → ROS 2 robot graph: plans robot motion
- ROS 2 robot graph → YOLO perception: provides camera input
- ROS 2 robot graph → ROSA language control: receives robot commands
- ROS 2 robot graph → Jetson monitoring & WiFi: publishes diagnostics
- Robot bringup → ROS 2 robot graph: starts robot system
- ROS 2 robot graph → Unitree Go2 interface: exchanges robot commands
- ROS 2 robot graph → Unitree Go2-W interface: exchanges robot commands
- ROS 2 robot graph → G1 command interface: routes robot commands
- G1 command interface → G1 hardware driver: controls hardware (evidence: `botbrain_ws/src/g1_pkg/src/g1_write.cpp`)
- ROS 2 robot graph → Tita interface: exchanges robot commands
