Retrieved article excerpt
Open article Β· Retrieved 2026-11-24T13:23:39.926969+00:00
# MRCF β Modular Robotics Control Framework
Control a robot arm in plain English, with local models. You type "move the
knight to f6". The framework works out what is on the table, plans a sequence
of actions, checks the plan against safety rules, and runs it through
deterministic skill controllers that check their own success.
The language model never moves the arm itself. It picks actions from a fixed
list (`pick`, `place`, `observe`, β¦), and policies carry them out. Policies
never see object names or memories, so the same pick works in any task, and a
task works on any arm that has its own policies.
A policy is planned or learned. Planned policies, such as pick and place, are
deterministic and work from geometry. A learned policy is a model trained
elsewhere, on demonstrations (ACT, through LeRobot) or by reinforcement
learning. It runs here on the arm's own stream of joints and camera frames,
usually for one segment of a skill between planned steps. Nothing in this
repository trains a model, so the framework stays light enough to deploy on
the robot. Everything runs on your machine: [Ollama](https://ollama.com)
runs the models, and an optional segmentation model (SAM2) measures objects
from camera images.
**Status.** Alpha. The framework is robot-agnostic: nothing in it names an
arm. A deployment is one arm, one layout and one task, and names its arm.
`chess` drives a real [SO-101](https://github.com/TheRobotStudio/SO-ARM100)
arm through [LeRobot](https://github.com/huggingface/lerobot) and plays with
chess pieces. `tabletop` stacks letter blocks with a UR5 (`mrcf/backends/ur5`).
`tidy` has the SO-101 put everyday things away into a tub, and `toolbench` has
the UR5 put hand tools into a box. The last three share one table task (find,
name, pick, place), which belongs to the framework (`mrcf/tabletop`). Each of
them gives it its own arm, layout and rules.
You set up a new automation in the order a factory would: the arm, then its
sensors, then the job.
1. **The arm.** Use one the framework has (`mrcf/backends/so101`, `ur5`), or
add one: answer `n` at run.py's first question, or run
`python tools/new_arm.py NAME`. This copies `mrcf/backends/_template`, which
runs as an arm in memory until you add its SDK
([DEPLOYMENT\_SPEC.md](https://github.com/mitos-robotics/MRCF/blob/main/DEPLOYMENT_SPEC.md#adding-an-arm)).
2. **Its sensors.** List its cameras and other sensors in its
`robot_config.py` (`CAMERAS`, `SENSORS`). Find them by name with
`tools/find_cameras.py` and calibrate them
([COMMANDS.md](https://github.com/mitos-robotics/MRCF/blob/main/COMMANDS.md#first-time-setup-on-another-arm)). run.py shows
them all before each session.
3. **The job.** Answer `n` at run.py's second question to start a deployment
(one arm, one layout, one task) from the nearest existing one. It gets its
own config, its rules for the arm (`profile.py`), and the skills and
policies it needs ([POLICIES.md](https://github.com/mitos-robotics/MRCF/blob/main/POLICIES.md) for a new one, planned or
learned).
4. **Run it, and read the record.** Every run keeps its failures and timings
(see the flight recorder, below), which show what to fix and what to make
faster.
---
## How it works
```
You: "move the knight to f6"
β
βΌ
[scan] overhead camera β board, squares, and every object on it:
where its foot is, how wide, what colour (chessboard.py,
matched against the object memory, so each mrcf/perception/,
piece keeps its identity and what is known object_memory.py)
about it across scans, moves and restarts
β
βΌ
[perceive + decompose] free-text scene description; split into sub-goals (vlm.py)
β
βΌ
[plan] sub-goal + world model + recent events β JSON action list (vlm.py)
β
βΌ
[validate] workspace bounds, object existence, sequence rules, (safety.py)
per-action pre-conditions β a blocked plan does not run
β
βΌ
[execute] each action turns names into geometry and runs the (manipulation.py,
arm's policy: retries; the gripper camera measures the mrcf/policies/)
piece from above before the grasp; a failed step stops
the plan and triggers a re-plan from a fresh look
β
βΌ
[outcome] written back to the world model and the object memory (manipulation.py)
alongside watchers on their own threads β the motion guard: a hand (watchers.py,
everything moving near the arm β can trip the interlock; the arm interlock.py,
freezes where it is at once, and carries on once it has motion_guard.py)
gone (any other stop abandons the command)
```
[DEPLOYMENT\_SPEC.md](https://github.com/mitos-robotics/MRCF/blob/main/DEPLOYMENT_SPEC.md#how-the-pieces-fit) has the full
diagram and the rules that keep its parts separate.
The model never produces coordinates. Positions come from camera geometry: a
calibrated overhead camera, and a gripper camera whose pose is worked out from
the arm's joint angles. So their accuracy depends on the calibration, not on a
language model.
---
## Repository layout
The code has three tiers, so a new task or a new arm touches only one of
them. Each deployment names its arm in its config (`ARM_NAME`). The tools
drive the arm `MRCF_ARM` names (the SO-101 by default). The framework is one
package, `mrcf/`, and the only thing `pip install` installs
(`from mrcf import manipulation`). The scripts beside it use it from the
repository.
```
mrcf/ ββ the framework: the one installed package ββ
robot_env.py RobotEnv β the interface every backend implements
interlock.py stops the arm from anywhere, mid-move
watchers.py runs perception on its own thread while the arm works
motion_guard.py freezes the arm when anything but the arm moves near it
flight_recorder.py what happened, in order: one timeline, the last minute of joints and
frames, and an incident report when an action goes wrong
capabilities.py what a backend can do beyond RobotEnv, one Protocol each
overhead_calibration.py a fixed camera's calibration: checked every scan, re-posed when it moves
rig_state.py where each rig's own files live: rig/<backend>/, under MRCF_HOME
streaming.py an arm's stream: what learned policies are trained on and run on
manipulation.py the standard actions: planner names β policies β world model
NOTES.md what it cannot do yet, and what it has shown (each backend and task has one too)
HISTORY.md the dated runs behind its values and fixes (so do policies/, each backend, each task)
controller.py the loop: a command β plan β safety β dispatch β recover
vlm.py every model call: perception, scene discovery, planner
model_server.py where the models run: Ollama, any OpenAI-compatible API, or a plugin's
scene_state.py the world model the planner sees
action_registry.py the actions a planner may use, their conditions, and dispatch
skill_executor.py run_policy(): safety monitor + failure description
safety.py plan-time validation, execution-time monitoring
object_memory.py one identity per physical object, across scans and restarts
scene_scan.py puts a surface scan into the object memory and the world model
profiles.py a deployment's rules for its arm (its profile.py), laid over the arm's facts
rig_report.py what an arm brings to a job, shown before a run: gripper, cameras, sensors
devices.py this computer's cameras and ports, by name, without opening any
privacy.py guards every kept picture: keeps only the work area, covers faces
tabletop/ the table task (find, name, pick, place, stack, put into) that a
deployment hands its config to (deployments/tabletop, tidy, toolbench)
policies/ how an arm does things. Planned from geometry: parallel_jaw/ (pick,
place, β¦); approaches.py and aligners.py (the ways a pick comes at an
object); stand_up.py (stands a fallen object back up). Or learned:
learned.py (a trained model on the arm's stream); lerobot_model.py
(a LeRobot checkpoint); rl.py (a Stable-Baselines3 one); packages.py
(a model with the manifest it travels with, and the plugin seams for
sources and formats)
perception/ ββ seeing the work surface, from any calibrated camera ββ
plane_geometry.py measures an object (foot, height, widths) from its outline
shape_fit.py how tall an object is: fits a solid to its outlines in several views at once
segment.py SAM2 outlines of whatever is under a set of points
surface_scan.py finds and measures everything on the work surface, in any light
fiducials.py AprilTags and bullseyes: where a camera, a gripper or a board is
hand_eye.py where a wrist camera sits on the arm, from views of a grid
lighting.py whether the light is good enough to see by (washed out, too dark), per area
outlines.py one outline per object from a segmenter's many; an outline's middle
tones.py where a colour falls between two of the surface's own colours (any light)
lying.py an object on its side: which way it lies, which end it stands on, and
where the knob at its top is, from a fixed camera or a wrist one
backends/ ββ how to drive a robot ββ
__init__.py arm(): the arm that runs (MRCF_ARM); RIG_SETTINGS: what every arm's config has
rig.py RigEnv: an arm's cameras and gripper geometry from its kinematics
(camera models, grasp point, gripper tag, wrist servo, sentry)
contract.py check_backend(): what every arm's env must do, checked offline
so101/ the SO-101 follower: env.py (SO101Env, built from follower.py,
kinematics.py, gripper.py, orientation.py, motion.py, cameras.py,
stream.py), robot_config.py (this rig's measured values: the arm's
facts, whatever the task), make_policies()
ur5/ the UR5 (CB3) with a Robotiq Hand-E, over ur_rtde: env.py (UR5Env),
arm.py, gripper.py, kinematics.py, robot_config.py, make_policies()
_template/ a new arm to copy: a RigEnv over an SDK, its config, its policies
(it runs in memory as it is, and passes the contract checks)
real_robot_env.py base class for an arm driven by your own SDK (it owns the cameras)
run.py deployment launcher
deployments/ ββ what to ask it to do ββ
chess/ chess pieces on a board: board scan, naming, controller. A package,
deployments.chess (python -m deployments.chess.llm_controller)
tabletop/ the UR5's letter blocks on its table: the table task (mrcf/tabletop)
tidy/ the SO-101 putting everyday things away into a tub: the table task
toolbench/ the UR5 putting hand tools into a box: the table task
<name>/profile.py how that deployment drives its one arm (ARM_NAME), laid over the arm's facts
tools/ ββ measuring and checking the rig, on whichever arm runs ββ
cameras, tags, the overhead camera's calibration, the motion guard.
new_deployment.py: a new deployment from the nearest one's code, on
its arm or another, with its rules offered as candidates only