Skip to content

feat(mesh): Zenoh peer-to-peer mesh for Robot() — fleet coordination #95

@cagataycali

Description

@cagataycali

Summary

Add a Zenoh-based peer-to-peer mesh layer so every Robot() instance auto-discovers and communicates with peers on the network. This enables agent-to-agent tool calls across mixed sim+real fleets.

Motivation

Today Robot("so100") is a solo actor. With the mesh:

from strands_robots import Robot

striker = Robot("unitree_g1", peer_id="striker")
mid_1   = Robot("unitree_g1", peer_id="mid_1")

# Peers auto-discover — no config, no broker
print(striker.mesh.peers)  # → [{'peer_id': 'mid_1', ...}]

# Agent-to-agent tool call
striker.mesh.tell("mid_1", "pass the ball to me")

# Safety — broadcasts to all peers
striker.mesh.emergency_stop()

Design

Topic namespace (frozen contract — PRs #48 and #52 already consume these)

strands/{peer_id}/presence        # 2 Hz heartbeat + capabilities
strands/{peer_id}/state           # 10-50 Hz joint/obs
strands/{peer_id}/cmd             # Addressable commands
strands/{peer_id}/response/{turn} # Response correlation
strands/{peer_id}/stream          # VLA execution stream
strands/broadcast                 # Fan-out to all

Key components

Module Purpose ~LOC
mesh_session.py Process-level singleton over zenoh.Session, ref-counted 150
zenoh_mesh.pyMesh class Presence, peer discovery, heartbeat 250
RPC (send/tell/broadcast) Request-response with turn correlation 250
Pub/Sub (subscribe/publish_step) State streaming, dashboards 200
Emergency stop Broadcast stop with ≤100ms SLA 150
Robot integration Wire mesh into Robot.__init__ (opt-out via mesh_enabled=False) 50

Implementation plan (6 small PRs)

  1. Session singleton + connection configmesh_session.py
  2. Mesh class + presence + peer discovery — heartbeat, peers()
  3. tell/send/broadcast + response correlation — RPC
  4. publish_step + subscribe + on_stream — pub/sub
  5. emergency_stop + safety audit log — e-stop ≤100ms
  6. Wire mesh into Robot.init — depends on feat: Robot() factory + top-level lazy imports #86 landing first

Prototype

A validated 691-line prototype exists (zenoh_mesh.py) with:

  • 2 SO-100 arms on LAN, 10-min soak, 0 dropped messages
  • 10 simulated G1 humanoids, coordinated scenarios
  • Mac ↔ Jetson Thor over Wi-Fi, 50 Hz stable

Dependencies

Related


🤖 AI agent response. Strands Agents. Feedback welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions