Sync wrappers

Synchronous wrappers around Tile and TileFleet.

These are thin shims that run the async SDK on a shared background event loop. They exist so callback-driven code (notably the Viser GUI) can call tile.m1_extend() without having to manage asyncio themselves.

omnitiles.sync.scan_sync(*, timeout=5.0, name_prefix='OmniTile_')[source]

Synchronous version of omnitiles.scan().

Parameters:
  • timeout (float)

  • name_prefix (str)

Return type:

list[TileInfo]

class omnitiles.sync.SyncTile(tile)[source]

Bases: object

Blocking facade around Tile.

Every method delegates to the async Tile running on the shared background loop. on_telemetry callbacks fire on that loop’s thread; keep them fast and non-blocking.

Parameters:

tile (Tile)

classmethod connect(info)[source]
Parameters:

info (TileInfo)

Return type:

SyncTile

classmethod discover_one(*, timeout=5.0, name_prefix='OmniTile_')[source]

Scan, take the first match, and return a connected SyncTile.

Parameters:
  • timeout (float)

  • name_prefix (str)

Return type:

SyncTile

property name: str
property address: str
property connected: bool
disconnect()[source]
Return type:

None

ping()[source]
Return type:

None

m1_extend(speed=255)[source]
Parameters:

speed (int)

Return type:

None

m1_retract(speed=255)[source]
Parameters:

speed (int)

Return type:

None

m1_brake()[source]
Return type:

None

m1_set_position(position)[source]
Parameters:

position (int)

Return type:

None

m1_set_position_mm(mm)[source]
Parameters:

mm (float)

Return type:

None

m2_extend(speed=255)[source]
Parameters:

speed (int)

Return type:

None

m2_retract(speed=255)[source]
Parameters:

speed (int)

Return type:

None

m2_brake()[source]
Return type:

None

m2_set_position(position)[source]
Parameters:

position (int)

Return type:

None

m2_set_position_mm(mm)[source]
Parameters:

mm (float)

Return type:

None

base_velocity(vx, vy, omega)[source]
Parameters:
  • vx (int)

  • vy (int)

  • omega (int)

Return type:

None

base_brake()[source]
Return type:

None

property telemetry: Telemetry | None
on_telemetry(callback)[source]
Parameters:

callback (Callable[[Telemetry], None])

Return type:

Callable[[], None]

wait_for_telemetry(timeout=None)[source]
Parameters:

timeout (float | None)

Return type:

Telemetry

class omnitiles.sync.SyncFleet(fleet)[source]

Bases: object

Blocking facade around TileFleet.

Parameters:

fleet (TileFleet)

classmethod discover(*, timeout=5.0, name_prefix='OmniTile_')[source]
Parameters:
  • timeout (float)

  • name_prefix (str)

Return type:

SyncFleet

property names: list[str]
disconnect_all()[source]
Return type:

None

broadcast(action)[source]
Parameters:

action (Callable[[Tile], Awaitable[None]])

Return type:

None