Extending UniLab: New Task¶
Start from the contracts: Env Contract, Task Owner Config Contract, and ADR-0005 Unified Obs Critic Env And IPC Contract.
Implementation Checklist¶
Pick the closest owner package under
src/unilab/envs/.Define or extend an env config dataclass and register it with
@registry.envcfg("EnvName").Register each supported backend implementation with
@registry.env("EnvName", sim_backend="mujoco")or@registry.env("EnvName", sim_backend="motrix").If the task lives in a new module, add that module to the package
__unilab_registry_modules__tuple soensure_registries()imports it.Keep
obs_groups_specaccurate. It must includeobsand may includecritic; wrappers and learners trust these dimensions.Keep reset and step semantics at the env owner layer:
reset(env_indices)returns(obs_dict, info_dict), andstep(actions)returnsNpEnvState.Add owner YAMLs under the relevant config root, such as
conf/ppo/task/<task>/<backend>.yamlorconf/offpolicy/task/<algo>/<task>/<backend>.yaml.Put task or scene keyframes in task/scene XML fragments referenced through
SceneCfg.fragment_files; do not put task-level keyframes inrobot.xml.
Validation Near Risk¶
Registry and config shape:
tests/base/test_registry.py,tests/config/test_config_system.pyEnv observation/reset behavior:
tests/base/test_np_env.pyand the nearest task-specific tests undertests/envs/Script composition:
tests/scripts/test_train_script_configs.py
Evidence In Repo¶
Registry API:
src/unilab/base/registry.pyEnv state contract:
src/unilab/base/np_env.pyScene config:
src/unilab/base/scene.pyExisting task examples:
src/unilab/envs/locomotion/go2/joystick.py,src/unilab/envs/manipulation/allegro_inhand/rotation.py