Steam Controller Auto-Charge: Autonomous Navigation via Haptic Feedback
Steam Controller Auto-Charge: Autonomous Navigation via Haptic Feedback
Overview
Steam Controller Auto-Charge is an open-source project that enables a Steam Controller to autonomously navigate across a tabletop to its magnetic charging puck. The system achieves this by combining overhead camera tracking, computer vision, and the controller's internal haptic motors to create a physical movement mechanism.
Technical Implementation
The project utilizes a a combination of WebHID, OpenCV.js, and WebAssembly to handle the same-device navigation loop.
Computer Vision and Tracking
The system uses an overhead webcam to monitor the controller and the charging puck. Tracking is handled via OpenCV.js using the Lucas-Kanade optical flow algorithm (calcOpticalFlowPyrLK) to track user-selected points on the hardware. To maintain a fluid tracking loop, the project offloads object detection to a Web Worker using a Rust-based Convolutional Neural Network (CNN) compiled to WebAssembly (WASM).
Haptic-Driven Movement
The controller is moved physically by firing 70Hz asymmetric haptic pulses through its internal dual Linear Resonant Actuators (LRAs). These pulses create enough vibration-induced movement to crawl the device across a surface.
To ensure a gentle dock, the system implements a "Proximity Creep Mode," which reduces the haptic pulse frequency by 50% once the controller is within 150 pixels of the charging puck.
WebHID Telemetry and Communication
The application connects to the Steam Controller via the WebHID API, allowing it to stream input and telemetry. The system specifically monitors two report IDs for device status:
- Report ID 67 (0x43): Used to display live battery percentage and battery cell voltage (mV).
- Report ID 121 (0x79): Intercepted to confirm when the magnetic charging has successfully initiated.
System Architecture
The application is built using a Vue 3 framework with the following architectural components:
App.vue: Manages the camera streams, UI reactivity, the PID tracking loop, and the OpenCV.js optical flow logic.steamController.ts: A WebHID abstraction class that maps API calls to the specific byte payloads required for LRA pulses and battery polling.objectDetector.ts&objectWorker.ts: Handles the offloading of visual processing to a Web Worker to prevent main-thread blocking.wasm-object-detect/: The Rust implementation of the object detection system compiled to WASM for high-performance processing.
Setup and Requirements
To deploy the system, users require a Chromium-based browser supporting WebHID, an overhead webcam, and the Nix package manager for build dependencies. The project can be started using a single command:
nix-shell --run "npm install && npm run dev"
Community Insights
Users in the community have noted the similarities between this approach and other haptic-based movement apps, such as the Cycloramic app for iPhone. One user highlighted that the controller's onboard gyro and microphone could potentially offer even more sophisticated navigation solutions in the future.