Skip to content

kylemath/accGyro

Repository files navigation

Tilt Moto FPV (Mac Sensor Edition)

🚀 Live Demo 🚀

Small first-person motorcycle racing demo that uses your MacBook motion sensor data for:

  • Throttle (pitch forward/back)
  • Lean (roll left/right)

It receives sensor data from the AppleSPU toolbox over local WebSocket.

1) Create and use a Python 3.12 virtual environment

cd accGyro
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

requirements.txt installs the toolbox directly from GitHub: git+https://github.com/olvvier/apple-silicon-accelerometer.git

2) Run the sensor bridge (needs sudo)

sudo .venv/bin/python sensor_bridge.py

The bridge publishes sensor orientation at ws://127.0.0.1:8765.

If you prefer a local clone instead, pass: --toolbox-path /path/to/apple-silicon-accelerometer

3) Run the browser demo

In another terminal:

cd accGyro
python3 -m http.server 8080

Open:

  • http://127.0.0.1:8080

Click Connect Mac Sensor, then Recenter Tilt while holding your normal riding posture.

Controls

  • Mac tilt mode:
    • pitch forward = more throttle
    • roll left/right = bike lean
  • Fallback mode:
    • W/S or Up/Down: throttle
    • A/D or Left/Right: lean
    • mouse position also influences fallback steering/throttle

Preview

Project screenshot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published