🚀 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.
cd accGyro
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtrequirements.txt installs the toolbox directly from GitHub:
git+https://github.com/olvvier/apple-silicon-accelerometer.git
sudo .venv/bin/python sensor_bridge.pyThe 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
In another terminal:
cd accGyro
python3 -m http.server 8080Open:
http://127.0.0.1:8080
Click Connect Mac Sensor, then Recenter Tilt while holding your normal riding posture.
- Mac tilt mode:
- pitch forward = more throttle
- roll left/right = bike lean
- Fallback mode:
W/SorUp/Down: throttleA/DorLeft/Right: lean- mouse position also influences fallback steering/throttle
