# mykullllll/smart-walker architecture

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

- Interactive diagram: https://gitdiagram.com/mykullllll/smart-walker
- Repository: https://github.com/mykullllll/smart-walker
- Video tour (about a minute): https://gitdiagram.com/mykullllll/smart-walker/video

## Overview

This repository implements a ROS-based Smart Walker that uses LiDAR-observed leg motion and wheel-encoder feedback to estimate gait and command assisted wheel speeds. The principal runtime is the ROS control node, which passes sensor state into the control logic and publishes motor commands; the controller includes clustering, adaptive-frequency feedforward, calibration, corrective feedback, and gait-state handling. The README also describes gait metrics and validation work. Runtime wiring is based on the sampled controller excerpts and README; validation links are documented, but their full runtime integration is not shown.

Main entry points: [`Control/Code/AFO_control_PID.py`](https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_control_PID.py) (ROS control node), [`Control/Code/AFO_PID.py`](https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_PID.py) (Cadence and stride), [`Control/Reverse/AFO_control_reverse.py`](https://github.com/mykullllll/smart-walker/blob/main/Control/Reverse/AFO_control_reverse.py) (Reverse AFO control), [`Validation/LiDAR/Code/dbscan_parameter_sweep.py`](https://github.com/mykullllll/smart-walker/blob/main/Validation/LiDAR/Code/dbscan_parameter_sweep.py) (Clustering sweep)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Walker runtime"]
  node_ros_control["ROS control node<br/>[AFO_control_PID.py]"]
  node_metrics["Gait metrics<br/>[AFO_control_PID.py]"]
  node_afo_reverse["Reverse AFO control"]
end

subgraph group_control["Gait and control"]
  node_leg_processing["Scan and leg tracking<br/>[AFO_PID.py]"]
  node_gait_estimation["Cadence and stride<br/>[AFO_PID.py]"]
  node_calibration["Gait calibration<br/>[calibration.py]"]
  node_velocity_control["Feedforward and PID<br/>[AFO_PID.py]"]
  node_safety_gait["Freeze and safety<br/>[AFO_PID.py]"]
  node_reverse_logic["Reverse control logic<br/>[AFO_reverse.py]"]
end

subgraph group_validation["Validation workflows"]
  node_afo_validation["AFO validation<br/>[AFO_validation.py]"]
  node_pid_validation["PID validation<br/>[pid_validation.py]"]
  node_lidar_capture["LiDAR trial capture"]
  node_cluster_validation["Clustering sweep"]
  node_latency_validation["Latency tests"]
  node_motor_validation["Motor tests"]
end

subgraph group_hil["Hardware trials"]
  node_hil_gait["Hardware gait trials<br/>[Gait_data.py]"]
end

node_patient(("Walker user"))
node_lidar(("LiDAR scanner"))
node_encoder(("Wheel encoders"))
node_motors(("Wheel motors"))

node_patient -->|"moves within view"| node_lidar
node_lidar -->|"publishes scans"| node_ros_control
node_encoder -->|"publishes velocity"| node_ros_control
node_ros_control -->|"processes scans"| node_leg_processing
node_ros_control -->|"steps from legs"| node_gait_estimation
node_leg_processing -->|"tracks legs"| node_gait_estimation
node_gait_estimation -->|"calibrates gait"| node_calibration
node_ros_control -->|"supplies gait history"| node_calibration
node_ros_control -->|"computes commands"| node_velocity_control
node_gait_estimation -->|"provides cadence"| node_velocity_control
node_encoder -->|"feedback input"| node_velocity_control
node_ros_control -->|"checks gait state"| node_safety_gait
node_safety_gait -->|"gates control"| node_ros_control
node_ros_control -->|"publishes wheel speeds"| node_motors
node_ros_control -->|"publishes metrics"| node_metrics
node_afo_validation -.->|"evaluates oscillator"| node_gait_estimation
node_pid_validation -.->|"evaluates feedback"| node_velocity_control
node_lidar_capture -->|"records trial scans"| node_cluster_validation
node_cluster_validation -.->|"sweeps clustering"| node_leg_processing
node_latency_validation -.->|"checks timing"| node_ros_control
node_motor_validation -.->|"tests response"| node_motors
node_lidar -.->|"publishes scans"| node_afo_reverse
node_encoder -.->|"publishes state"| node_afo_reverse
node_afo_reverse -->|"runs control logic"| node_reverse_logic
node_afo_reverse -.->|"publishes wheel speeds"| node_motors
node_lidar -.->|"provides scans"| node_hil_gait
node_encoder -.->|"provides odometry"| node_hil_gait

click node_ros_control "https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_control_PID.py"
click node_leg_processing "https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_PID.py"
click node_gait_estimation "https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_PID.py"
click node_calibration "https://github.com/mykullllll/smart-walker/blob/main/Control/Code/calibration.py"
click node_velocity_control "https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_PID.py"
click node_safety_gait "https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_PID.py"
click node_metrics "https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_control_PID.py"
click node_afo_validation "https://github.com/mykullllll/smart-walker/blob/main/Validation/AFO/Code/AFO_validation.py"
click node_pid_validation "https://github.com/mykullllll/smart-walker/blob/main/Validation/PID/Code/pid_validation.py"
click node_lidar_capture "https://github.com/mykullllll/smart-walker/blob/main/Validation/LiDAR/Code/lidar_scan_values.py"
click node_cluster_validation "https://github.com/mykullllll/smart-walker/blob/main/Validation/LiDAR/Code/dbscan_parameter_sweep.py"
click node_latency_validation "https://github.com/mykullllll/smart-walker/tree/main/Validation/Latency/Code"
click node_motor_validation "https://github.com/mykullllll/smart-walker/tree/main/Validation/Motor/Code"
click node_afo_reverse "https://github.com/mykullllll/smart-walker/blob/main/Control/Reverse/AFO_control_reverse.py"
click node_reverse_logic "https://github.com/mykullllll/smart-walker/blob/main/Control/Reverse/AFO_reverse.py"
click node_hil_gait "https://github.com/mykullllll/smart-walker/blob/main/HardwareInTheLoop/Gait_data.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_ros_control,node_metrics,node_afo_reverse,node_patient toneBlue
class node_leg_processing,node_gait_estimation,node_calibration,node_velocity_control,node_safety_gait,node_reverse_logic toneAmber
class node_afo_validation,node_pid_validation,node_lidar_capture,node_cluster_validation,node_latency_validation,node_motor_validation toneMint
class node_hil_gait toneRose
class node_lidar,node_encoder,node_motors toneIndigo
```

## Components

### Walker runtime

- [ROS control node](https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_control_PID.py): `Control/Code/AFO_control_PID.py`
- [Gait metrics](https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_control_PID.py): `Control/Code/AFO_control_PID.py`
- [Reverse AFO control](https://github.com/mykullllll/smart-walker/blob/main/Control/Reverse/AFO_control_reverse.py): `Control/Reverse/AFO_control_reverse.py`

### Gait and control

- [Scan and leg tracking](https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_PID.py): `Control/Code/AFO_PID.py`
- [Cadence and stride](https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_PID.py): `Control/Code/AFO_PID.py`
- [Gait calibration](https://github.com/mykullllll/smart-walker/blob/main/Control/Code/calibration.py): `Control/Code/calibration.py`
- [Feedforward and PID](https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_PID.py): `Control/Code/AFO_PID.py`
- [Freeze and safety](https://github.com/mykullllll/smart-walker/blob/main/Control/Code/AFO_PID.py): `Control/Code/AFO_PID.py`
- [Reverse control logic](https://github.com/mykullllll/smart-walker/blob/main/Control/Reverse/AFO_reverse.py): `Control/Reverse/AFO_reverse.py`

### Validation workflows

- [AFO validation](https://github.com/mykullllll/smart-walker/blob/main/Validation/AFO/Code/AFO_validation.py): `Validation/AFO/Code/AFO_validation.py`
- [PID validation](https://github.com/mykullllll/smart-walker/blob/main/Validation/PID/Code/pid_validation.py): `Validation/PID/Code/pid_validation.py`
- [LiDAR trial capture](https://github.com/mykullllll/smart-walker/blob/main/Validation/LiDAR/Code/lidar_scan_values.py): `Validation/LiDAR/Code/lidar_scan_values.py`
- [Clustering sweep](https://github.com/mykullllll/smart-walker/blob/main/Validation/LiDAR/Code/dbscan_parameter_sweep.py): `Validation/LiDAR/Code/dbscan_parameter_sweep.py`
- [Latency tests](https://github.com/mykullllll/smart-walker/tree/main/Validation/Latency/Code): `Validation/Latency/Code`
- [Motor tests](https://github.com/mykullllll/smart-walker/tree/main/Validation/Motor/Code): `Validation/Motor/Code`

### Hardware trials

- [Hardware gait trials](https://github.com/mykullllll/smart-walker/blob/main/HardwareInTheLoop/Gait_data.py): `HardwareInTheLoop/Gait_data.py`

### Other components

- **Walker user**
- **LiDAR scanner**
- **Wheel encoders**
- **Wheel motors**

## Connections

- Walker user → LiDAR scanner: moves within view
- LiDAR scanner → ROS control node: publishes scans
- Wheel encoders → ROS control node: publishes velocity
- ROS control node → Scan and leg tracking: processes scans
- ROS control node → Cadence and stride: steps from legs
- Scan and leg tracking → Cadence and stride: tracks legs
- Cadence and stride → Gait calibration: calibrates gait
- ROS control node → Gait calibration: supplies gait history
- ROS control node → Feedforward and PID: computes commands
- Cadence and stride → Feedforward and PID: provides cadence
- Wheel encoders → Feedforward and PID: feedback input
- ROS control node → Freeze and safety: checks gait state
- Freeze and safety → ROS control node: gates control
- ROS control node → Wheel motors: publishes wheel speeds
- ROS control node → Gait metrics: publishes metrics
- AFO validation → Cadence and stride: evaluates oscillator
- PID validation → Feedforward and PID: evaluates feedback
- LiDAR trial capture → Clustering sweep: records trial scans
- Clustering sweep → Scan and leg tracking: sweeps clustering
- Latency tests → ROS control node: checks timing
- Motor tests → Wheel motors: tests response
- LiDAR scanner → Reverse AFO control: publishes scans
- Wheel encoders → Reverse AFO control: publishes state
- Reverse AFO control → Reverse control logic: runs control logic
- Reverse AFO control → Wheel motors: publishes wheel speeds
- LiDAR scanner → Hardware gait trials: provides scans
- Wheel encoders → Hardware gait trials: provides odometry
