srb real_agent — Sim-to-Real Bridge
srb real_agent generates lightweight hardware environments under srb_real/ from simulated Gymnasium environments, then provides agent commands for hardware. Generated environments do not depend on Isaac Sim.
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 control the real agent through its declared direct-command mapping. |
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. ALL selects every cached 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 and writes the counterpart to srb/interfaces/sim_to_real/env/<env_id>.py. Other srb real_agent commands then resolve that --env ID under srb_real/.
When the live action configuration declares command semantics, generation
emits optional COMMAND_MAPPING metadata: six device values (translation and
rotation XYZ, after gains) and an event mapped to named action slices. The
declaration is checked against action order; hardware scaling remains in the
downstream adapter.
Older modules keep COMMAND_MAPPING = None; policy actions and raw ROS input
retain existing behavior. Custom simulator mappers need an explicit declaration.
Native direct teleop and human collection require it and reject unmigrated
checked-in profiles before hardware starts. Review regeneration and the robot’s
deployment contract before adopting a module.
Example
srb real_agent gen --env waypoint_navigation env.robot=leo_rover \
--hardware ros_cmd_vel ros_tf ros_mw
If another command’s environment is not registered under srb_real/, the
runner generates it in a subprocess and asks you to rerun the command.
--check — the freshness gate
For --env ALL --check, cached environments without generated modules are
skipped; drift, orphan modules, an empty cache, or no generated module fails.
Landscaping task IDs
Terrain landscaping has three task IDs. The general task uses per-episode mission manifests; the crater and mound tasks use fixed target manifests.
| 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_mound | fixed mound manifest | Not generated yet |
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
The listed commands run unqualified — no env.particles_height override
belongs in them. Generating a bridge module does not make these tasks
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 runtime subcommands (zero, rand, teleop, ros, train, eval,
collect) 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:
teleopand humancollectaccept--teleop_device,--pos_sensitivity,--rot_sensitivity, and--invert_controls. Native devices areros(default),spacemouse, andhaptic; simulator-onlykeyboardandgamepadare rejected before hardware or input acquisition.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.collectaccepts--algoand--modelfor policy rollouts. Nativeteleoprejects these arguments: it has no declared policy-command interface. Useevalor policycollectto run a policy; simulation-sidesrb agent teleopretains its policy-command mode.
eval and policy collect accept SRB model artifact directories as --model.
Their manifest supplies an omitted --algo, and adapters reuse bundled framework
config. Real collection sets split=real and records the controller label;
artifact-backed policy collection records both checkpoint and model artifact paths.
Native direct input
Native direct teleop and human collection validate the generated mapping and
all devices before session startup. Device commands map to one flat action;
hardware scaling runs in the adapter. --invert_controls applies the existing
manipulation-only XY inversion. Session cleanup finishes before the environment
releases its ROS node and context.
ROS teleop consumes global /cmd_vel (Twist) and /gripper (Bool) device
inputs with sensitivity gains. These are not the flat policy actions consumed by
real_agent ros. ROS and haptic
devices retain existing timeout behavior; they do not use the raw policy
source’s selected-sample deadline. Haptic input has no simulator-contact force
feedback.
ROS and haptic inputs have no manual save/discard/reset callbacks; collection
ends on environment termination or --horizon. SpaceMouse keeps button
callbacks, including left-button reset, and the CLI prints available controls.
Datasets store observation leaves at contract shape and include a terminal row
on completion. SpaceMouse open or cleanup failures are reported as failures.
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 stays active while the spec’s rerun.record_to_rrd is true, the default, and Rerun is installed and starts) | 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, RSL-RL, and SKRL. A raw SKRL or RSL-RL checkpoint recovers its agent config from the training run’s .hydra/config.yaml; a checkpoint without one, or a config restored from a sanitized metadata snapshot, is rejected with a clear error. 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 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