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 likemove_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 aprocess(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 rate | 1-3 Hz | 100 Hz |
| Agent writes | Tool call parameters | WAT/WASM code |
| Motion planning | Handled by middleware | Agent implements directly |
| Sensor feedback | Snapshot per tool call | Every tick (10 ms) |
| Safety | Middleware enforces limits | Safety filter clamps per tick |
| Use case | Go-to-pose, pick-and-place | Trajectory tracking, force control |
| Latency | Seconds (LLM round-trip) | 10 ms (WASM tick) |
Combining Both Paths
The agent can use both paths in the same session. A typical pattern:Deploy WASM controller
Write and deploy a WAT controller for the precision task (e.g., a circular polishing motion).
Monitor and iterate
Read sensor state via MCP tools to check progress. If the controller needs adjustment, deploy an updated version.
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
- Control path architecture:
roz-local/src/runtime.rs - MCP tool registration:
roz-local/src/tools/ - WASM deployment:
roz-local/src/tools/deploy_controller.rs