Quick start
With the app open on the phone and imuninn installed (see Install), five lines get you poses:
import imuninn
with imuninn.connect() as dev: # first phone found; or "iPhone" / "10.0.0.5" / "10.0.0.5:7420" dev.start() # capture session on (or tap Start on the phone) for pose in dev.iter("ar_pose"): # blocking iterator; same for "imu" / "rgb" / "depth" / "health" print(pose.position, pose.intrinsics.fx)Everything is synchronous; no asyncio needed.
Discover and connect
Section titled “Discover and connect”for p in imuninn.discover(): # Bonjour, about 2 s print(p.name, p.address, p.protocol_version)
dev = imuninn.connect("iPhone") # by namedev = imuninn.connect("10.0.0.5:7420") # by address (when the Wi‑Fi blocks mDNS)dev.close()connect() returns after the handshake, clock sync and subscribing to every stream. With a USB cable the phone also has a 169.254.x.x link-local address with lower latency (≈1.5 ms round trip instead of ≈8 ms); imuninn list shows both.
Change parameters
Section titled “Change parameters”r = dev.set("imu.rate_hz", 200) # returns ConfigResultfor f in r.fields: print(f.key, f.status, f.reason) # applied / clamped / rejecteddev.set("rgb.exposure_mode", "locked")dev.set("depth.enabled", True) # restarts the capture session, about 1 sdev.apply_profile("calibration") # built-in YAML preset, one round tripParameters are self-describing: dev.capabilities lists every parameter of every stream with type, range, choices and whether it applies immediately or restarts the session. Rules in Concepts.
Receive data
Section titled “Receive data”# iterator, one streamfor imu in dev.iter("imu"): print(imu.header.device_time_ns, imu.accel, imu.gyro)
# iterator, every stream: (stream, sample) tuplesfor stream, sample in dev.iter(): ...
# callbacks: run on the client thread, keep them shortdev.on("rgb", lambda frame: q.put(frame))dev.on("*", lambda stream, sample: ...)dev.on("__event__", print) # "connected" / "config" / "lease" / "disconnected"dev.stats has per-stream counts, drops (from seq gaps) and rates; dev.health is the phone’s latest thermal / battery report.
Every sample carries header.device_time_ns, the phone’s monotonic clock. dev.to_pc_time(ns) converts to PC wall-clock seconds using the offset measured at connect (≈1 ms error over USB, ≈4 ms over Wi‑Fi).
The same from the command line
Section titled “The same from the command line”imuninn watch --start # print samples as textimuninn rerun --start --depth # visualiseimuninn record -o run1.mcap # recordAll commands: CLI reference.