Skip to main content
roz provides two complementary control paths. The agent chooses which path to use based on the task, and can combine both in the same session.

Path A: MCP Tools

The agent calls high-level tools through the Model Context Protocol. Each sim container bundles its own MCP server with robot-specific tools like move_to_pose, get_joint_state, takeoff, or navigate_to. MCP tools handle motion planning, collision checking, and middleware coordination internally. The agent says what to do, and the tool handles how. Rate: 1-3 Hz (one tool call per LLM turn). Best for:
  • Discrete actions (go to a waypoint, pick up an object, land)
  • Positioning and setup before a precision task
  • Tasks where the middleware’s built-in planner is sufficient

Path B: WASM Controllers

The agent writes WAT (WebAssembly Text) code implementing a process(tick) function. The code is compiled to WASM, verified in a sandbox, and deployed to a 100 Hz Copper control loop. Each tick, the controller reads sensor state and writes motor commands through the channel interface. The agent has direct, continuous control over the robot’s actuators. Rate: 100 Hz (10 ms per tick). Best for:
  • Continuous control (smooth trajectories, oscillation, impedance control)
  • Reactive behaviors that need fast sensor feedback
  • Custom motion patterns the middleware does not support

When to Use Which

MCP Tools (Path A)WASM Controllers (Path B)
Control rate1-3 Hz100 Hz
Agent writesTool call parametersWAT/WASM code
Motion planningHandled by middlewareAgent implements directly
Sensor feedbackSnapshot per tool callEvery tick (10 ms)
SafetyMiddleware enforces limitsSafety filter clamps per tick
Use caseGo-to-pose, pick-and-placeTrajectory tracking, force control
LatencySeconds (LLM round-trip)10 ms (WASM tick)

Combining Both Paths

The agent can use both paths in the same session. A typical pattern:
1

Position with MCP

Use move_to_pose to move the arm to a starting configuration.
2

Deploy WASM controller

Write and deploy a WAT controller for the precision task (e.g., a circular polishing motion).
3

Monitor and iterate

Read sensor state via MCP tools to check progress. If the controller needs adjustment, deploy an updated version.
4

Halt and return

Stop the controller and use MCP tools to move back to a safe home position.
Both control paths go through the safety filter before reaching the robot. MCP tools are checked by the middleware’s own safety layer. WASM commands are clamped per-channel by SafetyFilterTask at 100 Hz.

Source