Skip to content

Environments

RoboSmith uses an environment registry as a searchable catalog. The default file is configs/env_registry.yaml and currently contains 30 entries across classic control, MuJoCo, Gymnasium-Robotics, and Isaac Lab.

Each entry becomes an EnvEntry:

from robosmith.envs.registry import EnvRegistry
registry = EnvRegistry()
entry = registry.get("mujoco-ant")
print(entry.env_id) # Ant-v5
print(entry.framework) # gymnasium
print(entry.task_tags) # locomotion, walk, run, quadruped, forward
matches = registry.search(
robot_type="arm",
env_type="tabletop",
framework="gymnasium",
tags=["pick", "place"],
)

Filters are combined. Tags are scored and sorted by match count. CLI filters use case-insensitive substring matching:

Terminal window
robosmith envs
robosmith envs --framework gym
robosmith envs --robot arm
robosmith envs --env-type tabletop
robosmith envs --tags "pick place"

Environment synthesis uses match_task_to_env():

from robosmith.config import TaskSpec
from robosmith.stages.env_synthesis.synthesis import match_task_to_env
spec = TaskSpec(
task_description="A quadruped runs forward",
robot_type="quadruped",
environment_type="floor",
)
match = match_task_to_env(spec, registry)
print(match.entry.id)
print(match.score)
print(match.match_reason)

Matching order:

  1. Use TaskSpec.environment_id directly when present.
  2. Search by robot type, environment type, framework, robot model, and extracted task tags.
  3. Relax the environment type constraint.
  4. Fall back to robot type plus tags.
  5. Reject weak matches with no tag overlap.

make_env() routes an EnvEntry through EnvAdapterRegistry.

from robosmith.envs.wrapper import make_env
env = make_env(entry, render_mode="rgb_array", max_episode_steps=500)
obs, info = env.reset()
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
env.close()

The wrapper builds an EnvConfig from keyword arguments and passes it to the framework-specific adapter.

AdapterFrameworksDependency status
GymnasiumAdaptergymnasium, gymAvailable with .[sim].
IsaacLabAdapterisaac_labRequires Isaac Lab and Isaac Sim setup.
LIBEROAdapterliberoRequires LIBERO installation.
ManiSkillAdaptermaniskillRequires .[maniskill] and simulator dependencies.
CustomMJCFAdaptercustom_mjcfFor custom MJCF or URDF-like assets.

Inspect adapter availability:

from robosmith.envs.adapter_registry import EnvAdapterRegistry
adapters = EnvAdapterRegistry()
print(adapters.list_available())
print(adapters.list_all())
from pathlib import Path
from robosmith.envs.adapters import EnvConfig
cfg = EnvConfig(
render_mode="rgb_array",
seed=42,
max_episode_steps=500,
num_envs=16,
asset_path=Path("robot.xml"),
extra={"camera_name": "front"},
)

Framework-specific options belong in extra.

Use a custom registry file with ForgeConfig.env_registry_path or robosmith.yaml.

env_registry_path: ./my_envs.yaml

Example entry:

environments:
- id: my-franka-reach
name: My Franka Reach
framework: gymnasium
env_id: MyFrankaReach-v0
robot_type: arm
robot_model: franka
env_type: tabletop
task_tags: [reach, franka, arm, target]
obs_type: state
action_type: continuous
description: Franka reaches to a custom target.
source: local