Skip to content

Repository files navigation

Turret Lab

Turret Lab is an interactive, deterministic control-system visualizer for comparing a direct position PID loop with a cascaded position-to-velocity controller. Both controllers receive the same robot pose, target, plant model, and disturbance, so the architecture is the only variable.

What you can explore

  • Drive a shared robot pose with W, A, S, D, , and .
  • Compare direct PID and cascaded control side by side on the same field.
  • Run a repeatable 12-second benchmark.
  • Inspect live turret telemetry, signed error, field position, and rolling metrics.
  • Tune controller, plant, latency, noise, and geometry parameters in real time.
  • Switch alliance target and environment assumptions.

The model is educational: it demonstrates controller behavior under transparent synthetic assumptions, not measured hardware performance.

Run locally

Requirements: Node.js 22.13 or newer.

npm install
npm run dev

Open the local address printed by the development server.

Test and build

npm test
npm run build

The simulation tests cover controller math, determinism, benchmark behavior, and metrics. The production build targets the Cloudflare Worker-compatible output used by OpenAI Sites.

Project structure

app/ Site route and metadata
src/components/ Field, chart, telemetry, metrics, and tuning UI
src/simulation/ Plant, controllers, benchmark engine, and tests
public/assets/ Field image and field geometry data
worker/ Sites runtime entry point

Technical notes

  • React + TypeScript
  • Vinext/Vite build pipeline
  • Fully client-side simulation with a fixed 20 ms step
  • No account, backend, or persistent data required

Source context

The visualizer references Team 6940's 2026 Rebuilt turret architecture and links to the relevant robot code from within the interface. The included field asset is used for the educational field visualization.

About

A turret simulation of the 2026 robot of Team 6940. Comparing two controlling patterns.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages