# fuwei007/navbot-eg02 architecture

> Architecture diagram of the GitHub repository fuwei007/navbot-eg02, 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/fuwei007/navbot-eg02
- Repository: https://github.com/fuwei007/navbot-eg02

## Overview

This repository combines Mini Cheetah/MIT Cheetah quadruped control software with two embedded motor/leg-board firmware projects. The principal runtime path is operator or host commands into the robot controller, through common leg control, then over a board interface to motor commands; feedback returns through the board and leg-data interface. The Hobbyking firmware separately runs motor setup, calibration, sensing, and field-oriented control. Evidence is limited to the provided excerpts and source index, so several subsystem links remain unverified rather than asserting unshown call paths.

Main entry points: [`3-Software/jetson_nano_-mit_-cheetah-main/robot/include/RobotController.h`](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/robot/include/RobotController.h) (Robot controller), [`2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/main.cpp`](https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/main.cpp) (Motor firmware entry), [`3-Software/jetson_nano_-mit_-cheetah-main/robot/src/RobotRunner.cpp`](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/robot/src/RobotRunner.cpp) (Robot runner), [`3-Software/jetson_nano_-mit_-cheetah-main/common/src/Controllers/LegController.cpp`](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/src/Controllers/LegController.cpp) (Leg control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_robot["Robot control"]
  node_runner["Robot runner<br/>[RobotRunner.cpp]"]
  node_controller["Robot controller<br/>[RobotController.h]"]
  node_usercontrollers["User controllers"]
  node_balance["Balance control"]
  node_legcontrol["Leg control<br/>[LegController.cpp]"]
end

subgraph group_board["Embedded boards"]
  node_spineboard["Spine board interface<br/>[SpineBoard.cpp]"]
  node_spinefw["SPIne firmware<br/>[main.cpp]"]
end

subgraph group_motor["Motor firmware"]
  node_hobbymain["Motor firmware entry<br/>[main.cpp]"]
  node_foc["Field-oriented control<br/>[foc.cpp]"]
  node_position["Position sensing<br/>[PositionSensor.cpp]"]
  node_calibration["Motor calibration<br/>[calibration.cpp]"]
  node_drv["DRV8323 interface<br/>[DRV.cpp]"]
  node_cancom["CAN communication<br/>[CAN_com.cpp]"]
  node_preferences[("Preference storage")]
  node_flash["Flash writer<br/>[FlashWriter.cpp]"]
end

subgraph group_support["State and support"]
  node_estimation["State estimation"]
  node_gait["Gait and swing<br/>[GaitScheduler.cpp]"]
  node_dynamics["Robot dynamics"]
  node_gamepad["Gamepad input<br/>[GamepadCommand.h]"]
end

node_operator(("Operator"))
node_host(("Host commands"))
node_canmotors{{"CAN motor network"}}

node_operator -.->|"provides input"| node_gamepad
node_host -.->|"sends commands"| node_runner
node_runner -.->|"runs"| node_controller
node_controller -->|"uses"| node_legcontrol
node_controller -->|"uses"| node_estimation
node_controller -->|"reads"| node_gamepad
node_usercontrollers -.->|"implements"| node_controller
node_balance -.->|"implements"| node_controller
node_legcontrol -.->|"updates commands"| node_spineboard
node_legcontrol -.->|"reads feedback"| node_spineboard
node_spineboard -.->|"exchanges SPI"| node_spinefw
node_spinefw -->|"sends CAN frames"| node_canmotors
node_canmotors -.->|"returns feedback"| node_spinefw
node_runner -.->|"coordinates"| node_gait
node_controller -->|"uses model"| node_dynamics
node_hobbymain -->|"runs control"| node_foc
node_hobbymain -->|"reads position"| node_position
node_hobbymain -->|"calibrates"| node_calibration
node_hobbymain -->|"configures driver"| node_drv
node_hobbymain -.->|"handles CAN"| node_cancom
node_hobbymain -->|"loads settings"| node_preferences
node_preferences -.->|"persists data"| node_flash

click node_runner "https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/robot/src/RobotRunner.cpp"
click node_controller "https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/robot/include/RobotController.h"
click node_usercontrollers "https://github.com/fuwei007/navbot-eg02/tree/main/3-Software/jetson_nano_-mit_-cheetah-main/user"
click node_balance "https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/user/MIT_Controller/Controllers/BalanceController/BalanceControllerVBL.cpp"
click node_legcontrol "https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/src/Controllers/LegController.cpp"
click node_estimation "https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/include/Controllers/StateEstimatorContainer.h"
click node_gait "https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/src/Controllers/GaitScheduler.cpp"
click node_dynamics "https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/src/Dynamics/FloatingBaseModel.cpp"
click node_gamepad "https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/include/SimUtilities/GamepadCommand.h"
click node_spineboard "https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/src/SimUtilities/SpineBoard.cpp"
click node_spinefw "https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/splne-master/main.cpp"
click node_hobbymain "https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/main.cpp"
click node_foc "https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/FOC/foc.cpp"
click node_position "https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/PositionSensor/PositionSensor.cpp"
click node_calibration "https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/Calibration/calibration.cpp"
click node_drv "https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/DRV8323/DRV.cpp"
click node_cancom "https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/CAN/CAN_com.cpp"
click node_preferences "https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/PreferenceWriter/PrefrenceWriter.cpp"
click node_flash "https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/FlashWriter/FlashWriter.cpp"

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_runner,node_controller,node_usercontrollers,node_balance,node_legcontrol toneBlue
class node_spineboard,node_spinefw toneAmber
class node_hobbymain,node_foc,node_position,node_calibration,node_drv,node_cancom,node_preferences,node_flash toneMint
class node_estimation,node_gait,node_dynamics,node_gamepad toneRose
class node_operator,node_host,node_canmotors toneIndigo
```

## Components

### Robot control

- [Robot runner](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/robot/src/RobotRunner.cpp): `3-Software/jetson_nano_-mit_-cheetah-main/robot/src/RobotRunner.cpp`
- [Robot controller](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/robot/include/RobotController.h): `3-Software/jetson_nano_-mit_-cheetah-main/robot/include/RobotController.h`
- [User controllers](https://github.com/fuwei007/navbot-eg02/tree/main/3-Software/jetson_nano_-mit_-cheetah-main/user): `3-Software/jetson_nano_-mit_-cheetah-main/user`
- [Balance control](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/user/MIT_Controller/Controllers/BalanceController/BalanceControllerVBL.cpp): `3-Software/jetson_nano_-mit_-cheetah-main/user/MIT_Controller/Controllers/BalanceController/BalanceControllerVBL.cpp`
- [Leg control](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/src/Controllers/LegController.cpp): `3-Software/jetson_nano_-mit_-cheetah-main/common/src/Controllers/LegController.cpp`

### Embedded boards

- [Spine board interface](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/src/SimUtilities/SpineBoard.cpp): `3-Software/jetson_nano_-mit_-cheetah-main/common/src/SimUtilities/SpineBoard.cpp`
- [SPIne firmware](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/splne-master/main.cpp): `3-Software/splne-master/main.cpp`

### Motor firmware

- [Motor firmware entry](https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/main.cpp): `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/main.cpp`
- [Field-oriented control](https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/FOC/foc.cpp): `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/FOC/foc.cpp`
- [Position sensing](https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/PositionSensor/PositionSensor.cpp): `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/PositionSensor/PositionSensor.cpp`
- [Motor calibration](https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/Calibration/calibration.cpp): `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/Calibration/calibration.cpp`
- [DRV8323 interface](https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/DRV8323/DRV.cpp): `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/DRV8323/DRV.cpp`
- [CAN communication](https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/CAN/CAN_com.cpp): `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/CAN/CAN_com.cpp`
- [Preference storage](https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/PreferenceWriter/PrefrenceWriter.cpp): `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/PreferenceWriter/PrefrenceWriter.cpp`
- [Flash writer](https://github.com/fuwei007/navbot-eg02/blob/main/2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/FlashWriter/FlashWriter.cpp): `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/FlashWriter/FlashWriter.cpp`

### State and support

- [State estimation](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/include/Controllers/StateEstimatorContainer.h): `3-Software/jetson_nano_-mit_-cheetah-main/common/include/Controllers/StateEstimatorContainer.h`
- [Gait and swing](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/src/Controllers/GaitScheduler.cpp): `3-Software/jetson_nano_-mit_-cheetah-main/common/src/Controllers/GaitScheduler.cpp`
- [Robot dynamics](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/src/Dynamics/FloatingBaseModel.cpp): `3-Software/jetson_nano_-mit_-cheetah-main/common/src/Dynamics/FloatingBaseModel.cpp`
- [Gamepad input](https://github.com/fuwei007/navbot-eg02/blob/main/3-Software/jetson_nano_-mit_-cheetah-main/common/include/SimUtilities/GamepadCommand.h): `3-Software/jetson_nano_-mit_-cheetah-main/common/include/SimUtilities/GamepadCommand.h`

### Other components

- **Operator**
- **Host commands**
- **CAN motor network**

## Connections

- Operator → Gamepad input: provides input
- Host commands → Robot runner: sends commands
- Robot runner → Robot controller: runs
- Robot controller → Leg control: uses (evidence: `3-Software/jetson_nano_-mit_-cheetah-main/robot/include/RobotController.h`)
- Robot controller → State estimation: uses (evidence: `3-Software/jetson_nano_-mit_-cheetah-main/robot/include/RobotController.h`)
- Robot controller → Gamepad input: reads (evidence: `3-Software/jetson_nano_-mit_-cheetah-main/robot/include/RobotController.h`)
- User controllers → Robot controller: implements
- Balance control → Robot controller: implements
- Leg control → Spine board interface: updates commands
- Leg control → Spine board interface: reads feedback
- Spine board interface → SPIne firmware: exchanges SPI
- SPIne firmware → CAN motor network: sends CAN frames (evidence: `3-Software/splne-master/main.cpp`)
- CAN motor network → SPIne firmware: returns feedback
- Robot runner → Gait and swing: coordinates
- Robot controller → Robot dynamics: uses model (evidence: `3-Software/jetson_nano_-mit_-cheetah-main/robot/include/RobotController.h`)
- Motor firmware entry → Field-oriented control: runs control (evidence: `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/main.cpp`)
- Motor firmware entry → Position sensing: reads position (evidence: `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/main.cpp`)
- Motor firmware entry → Motor calibration: calibrates (evidence: `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/main.cpp`)
- Motor firmware entry → DRV8323 interface: configures driver (evidence: `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/main.cpp`)
- Motor firmware entry → CAN communication: handles CAN
- Motor firmware entry → Preference storage: loads settings (evidence: `2-Hardware/Hobbyking_Cheetah_Compact_DRV8323-6cd89bd6fcaa/main.cpp`)
- Preference storage → Flash writer: persists data
