Skip to content

ROS 2 examples: a Twist → Zenoh gateway and a turtlesim driven by goals over MCP #421

Closed

Description

@lxsaah

Context

The Zenoh connector ships the ros2_talker and ros2_listener examples, which the interop test uses. Its README shows how plain Zenoh and ROS 2 can share one session. Two runnable examples should show what AimDB adds next to a ROS 2 system:

  1. Observe: a gateway that reads a robot's topic, keeps it as a typed record and republishes it for non-ROS consumers.
  2. Command: an LLM, through aimdb-mcp, sets goals; an AimDB controller turns goal + pose into velocity commands. The model says what to do, the controller decides how to move, and ROS 2 actuates.

The second example is the basis for a walkthrough and a blog post.

Part 1: ros2_gateway (Twist → JSON)

  • Topic type: geometry_msgs/msg/Twist on /cmd_vel. It is a standard type with nested messages (Vector3) but no header or sequences, so the derive and CDR path carry it today. Type hash (Jazzy and Lyrical): RIHS01_9c45bf16fe0983d80e3cfe750d6835843d265a9a6c46bd2e609fcddde6fb8d2a.
  • Flow: ros2://cmd_vel → record robot.cmd_vel → zenoh://telemetry/cmd_vel as JSON, on one Zenoh session. Read-only AimX on a Unix socket for aimdb watch.
  • Location: aimdb-zenoh-connector/examples/ros2_gateway.rs, with a small zenoh_sub example so the payload can be read without the Zenoh tools.

Part 2: turtlesim_mcp (goals over MCP)

Claude ──set_record──▶ turtle.goal   {"GoTo": {"x": 8.0, "y": 8.0}} | "Stop"
turtlesim ──/turtle1/pose──▶ turtle.pose
turtle.goal + turtle.pose ──transform_join──▶ turtle.cmd_vel ──▶ /turtle1/cmd_vel
  • Records:
    • turtle.goal is an enum with GoTo { x, y } and Stop. It is the only record writable over AimX.
    • turtle.pose is turtlesim's pose, read-only. turtlesim's messages moved packages after Jazzy, so the type name and hash depend on the distro:
      • Jazzy: turtlesim/msg/Pose (RIHS01_739beba26bcba6920404ba722b7b8321348512f92ea5be235c47251940dd8aa9)
      • Lyrical: turtlesim_msgs/msg/Pose (RIHS01_37b07ace09a0ed2c5b774b1410dec972dfd1d292de5656ebc2b075ac646e09c8)
    • turtle.cmd_vel is a Twist produced by the controller, so remote writes to it are refused.
  • Controller: a transform_join over goal and pose that runs on every pose. It turns toward the target, drives, and stops within a tolerance. Speeds are clamped in the controller, not trusted from the caller.
  • Location: aimdb-zenoh-connector/examples/turtlesim_mcp.rs.

Acceptance criteria

  • ros2_gateway: subscribes to Twist over ros2://, stores it as a typed record, and republishes JSON on zenoh://. Both links share one session, and AimX serves the record for aimdb watch.
  • turtlesim_mcp: GoTo and Stop set over AimX (aimdb-mcp set_record, or the CLI) move the turtle to the target and stop it there. turtle.cmd_vel and turtle.pose are readable but not writable.
  • A walkthrough with a supported ROS 2 distro and rmw_zenoh_cpp. It covers:
    • starting the router,
    • ROS_DOMAIN_ID and ZENOH_ENDPOINT,
    • ros2 topic pub with the expected aimdb watch output and Zenoh JSON payload,
    • turtlesim with aimdb-mcp configured in Claude.
  • tests/interop/ros2_interop.sh and its Dockerfile run both examples against real ROS 2, so the walkthrough can't drift:
    • the gateway's republished JSON and its aimdb watch output,
    • a GoTo reaching its target in turtlesim within a tolerance,
    • a refused write to turtle.cmd_vel.
  • Both examples are linked from the connector README.

Not in scope

Services and actions (for example turtlesim's RotateAbsolute), path planning, and hardcoded maneuvers. A square is four GoTos sequenced by the caller.

Shared-session setup · Existing talker example · Existing interop test

Activity

  1. changed the title [-]Add a runnable ROS 2 → Zenoh telemetry gateway example[/-] [+]ROS 2 examples: a Twist → Zenoh gateway and a turtlesim driven by goals over MCP[/+] on Nov 7, 2026
  2. lxsaah commented on Nov 8, 2026

    @lxsaah
    MemberAuthor

    Closed by #442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions