Python API — haptic_skin
The full, auto-generated reference (from docstrings) lives here:
➡️ Open the complete haptic_skin API reference
It is generated with pdoc from the package source, so it always matches the installed code.
Module map
| Module | Purpose |
|---|---|
haptic_skin | Package entry point — haptic(), connect(), re-exports |
necklace | Necklace controller + Direction enum |
patterns | One-shot vibration patterns (preview, approach, now, arrived…) |
nav | Navigator — continuous homing compass from GPS fixes |
routing | Route parsing + Google Directions + trace densification |
geo | Haversine distance, bearing, relative-bearing buckets |
bridge | WebSocket bridge for the Street View demo |
transport | SerialTransport / MockTransport + simulator |
protocol | Binary frame builders + Decoder |
Quick reference
from haptic_skin import haptic, connect, Necklace, Direction
# one-liner on the default necklace (simulator unless HAPTIC_SKIN_PORT is set)
haptic("turn_left", 0.8)
# explicit controller
nk = connect(port="/dev/ttyACM0")
nk.set_motor(Direction.NE, 200) # one motor
nk.set_vector([0]*8) # the 8 motors at once
nk.haptic("E", 0.5) # a direction at 0..1 intensity
nk.ping() # -> bool (Pong received)
nk.stop()
See the serial protocol for what these calls put on the wire.