Skip to content

feat: shared robot transport (pub-sub) #180

Description

@maxxgx

Problem statement

Every robot consumer talks to the serial wire directly (via get_observation() / send_action()). These calls are blocking, which creates two issues:

  • Latency: blocking reads/writes stall the inference loop while waiting on the bus. Multi-robot doesn't scale as latency adds up (e.g. left arm moves first than right arm).
  • Redundant bus traffic: with multiple consumers (inference, recording, logging), each hits the serial bus separately for the same data.

Proposed solution

Apply the SharedCamera model to robots: one owner process per bus, sharing state over iceoryx2 (or zenoh).

  • Reads (fan-out): the owner reads state and publishes to shared memory. Consumers subscribe, they never touch the wire, so adding consumers adds no bus traffic.
  • Writes (fan-in): producers publish desired actions to a command channel; the owner applies them. For now, last-writer-wins should be sufficient

Read path is the same as SharedCamera; the new work is the write path.

Alternatives considered

  • Background reader thread only and no register: isolates read jitter but doesn't solve multiple consumers or address writes.
  • asyncio instead of threads: serial libraries are blocking; threads are simpler and I/O already releases the GIL, so async does not offer improvements over threads.

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions