srb real_agent — Sim-to-Real Bridge
The srb real_agent family inspects simulated Gymnasium environments from the Space Robotics Bench, generates their lightweight real-world counterparts (registered under srb_real/), and exposes the same agent verbs (zero, rand, teleop, ros, train, eval, collect) for hardware execution. The generated environments do not depend on Isaac Sim and can be installed on the deployment target alongside the user’s chosen hardware backends.
Sub-Subcommands
srb real_agent <action> [options]
| Subcommand | Purpose |
|---|---|
gen | Generate the real-world counterpart for a simulated environment. |
sim2real_gen | Alias for gen. |
zero | Run a real agent with zero-valued actions. |
rand | Run a real agent with random actions. |
teleop | Manually teleoperate the real agent, directly or through a trained policy. |
ros | Drive the real agent from ROS 2 / Space ROS action topics. |
train | Train a reinforcement-learning policy directly against hardware. |
eval | Evaluate a trained policy on hardware. |
collect | Record real-world demonstration datasets from human, policy, random, or zero controllers. |
validate | Run a structured real-hardware validation protocol with telemetry and pass/fail output. |
rebuild-summary | Rebuild validation summary.json and report.md from a session directory. |
replay-twin | Open a Rerun replay comparing a validation session against a baseline .rrd. |
srb real_agent gen
srb real_agent gen --env ENV_ID [options]
| Option | Description | Default |
|---|---|---|
-e/--env/--task ENV_ID | Name of the simulated environment to generate the real-world counterpart for. Can be ALL to generate for every registered (non-template) environment. | REQUIRED |
--cfg PATH | Hydra config YAML override (DEFAULT/IGNORE/NONE/NULL recognised) | DEFAULT |
--hardware/--hw [HW …] | Default hardware interfaces (for example, ros_cmd_vel, ros_tf, ros_mw, ros_depth_heightmap, ros_imu) to link with the generated environment | [] |
--check | Deterministic freshness gate: render a candidate, byte-compare it with the checked-in module, print a unified diff, and exit non-zero on drift without overwriting | False |
The command inspects the Gymnasium spec of ENV_ID, asks the RealEnvGenerator for a real-world counterpart, and writes the resulting Python module to srb/interfaces/sim_to_real/env/<env_id>.py. From that point on, the same --env ID is recognised by every other srb real_agent subcommand.
Example
srb real_agent gen --env waypoint_navigation env.robot=leo_rover \
--hardware ros_cmd_vel ros_tf ros_mw
If the environment passed to a non-gen subcommand has not yet been registered under srb_real/, the runner triggers the generation step automatically (in a sub-process) and asks you to re-run the original command.
--check — the freshness gate
--check never writes. It renders a fresh candidate beside the target, formats it, byte-compares it against the checked-in module, prints a unified diff, and exits non-zero on drift. Because the comparison is against a formatted file, it requires the repository’s pinned formatter (ruff) on PATH; without one it raises a typed FormatterUnavailableError naming the pinned formatter rather than reporting drift that an unformatted candidate would manufacture.
--env ALL --check runs the gate across every cached environment and exits non-zero if any has drifted — or if the environment cache is empty, since a gate that inspected nothing is not a pass. Generated modules whose task is no longer registered are absent from the cache and therefore outside the batch’s reach.
Landscaping task IDs
Terrain landscaping has two task IDs, and each generates its own module. They must never be conflated: the general task has no fixed target manifest and must never be relabelled with the crater’s hash.
| Task ID | Target manifest | Generated module |
|---|---|---|
terrain_landscaping_crater | fixed crater manifest, hash pinned in the module | srb/interfaces/sim_to_real/env/terrain_landscaping_crater.py |
terrain_landscaping | per-episode mission manifest; the module declares REQUIRES_RUNTIME_TARGET_MANIFEST = True | srb/interfaces/sim_to_real/env/terrain_landscaping.py |
srb real_agent gen --env terrain_landscaping_crater
srb real_agent gen --env terrain_landscaping
srb real_agent gen --env terrain_landscaping_crater --check
srb real_agent gen --env terrain_landscaping --check
Both run unqualified — no env.particles_height override belongs in them. Generating a bridge module does not make either task deployable: construction of the landscaping RealEnv still fails closed on missing hardware capability tags. See Terrain Landscaping Training Readiness.
Shared Options for the Other Sub-Subcommands
The non-gen real_agent subcommands accept the same baseline options:
| Option | Description | Default |
|---|---|---|
-e/--env/--task ENV | Name of the real environment (resolved under srb_real/) | REQUIRED |
--cfg PATH | Hydra config YAML override | DEFAULT |
--hardware/--hw [HW …] | Hardware interfaces to instantiate at runtime | [] |
--logdir/--logs PATH | Path to root logging directory | SRB_LOGS_DIR |
Additional groups depend on the subcommand:
teleopandcollectaccept the standard teleop arguments (--teleop_device,--pos_sensitivity,--rot_sensitivity,--invert_controls). Teleop devices includekeyboard,spacemouse,ros,gamepad, andhaptic.collectaccepts the standard collection arguments (--collector,--num_episodes,--horizon,--success_only).--collectorcan behuman,policy,random, orzero.trainrequires--algo(RL). Supported RL choices includedreamer,tdmpc2, andsbx_ppo; training also supports--continue_training/--model.evalrequires--algoand/or--model. Evaluation choices includedreamer,tdmpc2,sbx_ppo,robomimic_bc, androbomimic_cql.teleopandcollectalso accept the optionalTeleop Policygroup (--algo,--model) for policy-driven rollouts.
eval and policy-driven collect accept SRB model artifact directories as --model values, not only raw checkpoint files. The manifest supplies the algorithm when --algo is omitted, and bundled framework config is reused by adapters that need the original restore context. Real collection records datasets with split=real while keeping the source as controller=human, controller=policy, controller=random, or controller=zero; artifact-backed policy collection records both the resolved checkpoint path and the source model artifact path.
Real Validation
srb real_agent validate --spec SPEC_PATH [options]
| Option | Description | Default |
|---|---|---|
--spec PATH | Path to validation spec YAML (e.g. hyperparams/validation/excavation.yaml) | REQUIRED |
--checkpoint PATH | Override the checkpoint field in the spec | None |
--episodes N | Override the n_episodes field in the spec | None |
--wandb | Enable the optional Weights & Biases summary sink | False |
--no-tensorboard | Disable the TensorBoard scalar sink | False |
--no-rerun-web | Disable the Rerun web viewer (local .rrd recording is still active) | False |
--post-status | Post the validation pass/fail status as a GitHub commit status (requires gh CLI) | False |
--storage-root | Override the session artifact root directory | logs/real_validation |
--dry-run | Skip environment and policy instantiation to smoke-test the validation wiring | False |
--dry-runnever passes. It skips environment and policy instantiation, then finalizes the session withexit_code: 4(preflight_fail),pass_overall: false,hardware_evidence: false,metrics.n_episodes: 0, and a redbadge.jsonof{"label": "real-eval", "message": "non-hardware evidence", "color": "red"}. All three criteria are reported with statusskipped. A dry-run artifact is a wiring smoke test, never a validation result. See Sim-to-Real Transfer for the full exit-code table.
Validation runs the generated real environment, creates telemetry in logs/real_validation/, and calls a policy reset hook at the start of every episode when the loaded policy exposes one. --checkpoint can point to a raw checkpoint or an SRB model artifact; artifact checkpoints reuse the same policy-loading path as eval and collect, including bundled framework config for Dreamer, TD-MPC2, and RSL-RL. When the validation spec omits algo or uses REQUIRED_AT_RUNTIME, an artifact checkpoint supplies the algorithm from its manifest; an explicit conflicting spec algorithm is rejected.
srb real_agent rebuild-summary
Rebuild the summary.json and report.md artifacts for an existing real validation session directory. This is useful when the validation spec has changed, or you wish to adjust metrics or post-processing without re-running the physical hardware validation.
srb real_agent rebuild-summary SESSION_DIR
SESSION_DIR: Path to the validation session directory (which must contain aspec.yamland logged.jsonl/.rrdtelemetry).
srb real_agent replay-twin
Open a local Rerun viewer showing a time-aligned comparison of a real hardware validation rollout side-by-side with a simulated baseline rollout (“sim ghost” vs. “real solid”).
srb real_agent replay-twin --session SESSION_DIR --baseline BASELINE_RRD_PATH
--sessionSESSION_DIR: Path to the validation session directory containingrollout.rrd.--baselineBASELINE_RRD_PATH: Path to the baseline.rrdfile captured from a Phase 0 simulation run.
See Also
- Sim-to-Real Transfer Workflow — end-to-end example, ROS 2 hardware bridges, mission rehearsal
srb agent— the simulation-side counterparts of the same verbs