Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

ModulePurpose
haptic_skinPackage entry point — haptic(), connect(), re-exports
necklaceNecklace controller + Direction enum
patternsOne-shot vibration patterns (preview, approach, now, arrived…)
navNavigator — continuous homing compass from GPS fixes
routingRoute parsing + Google Directions + trace densification
geoHaversine distance, bearing, relative-bearing buckets
bridgeWebSocket bridge for the Street View demo
transportSerialTransport / MockTransport + simulator
protocolBinary 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.