LeRobot documentation

環境

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.7.0).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

環境

シミュレーション環境はEnvConfigによって設定され、make_env、または1つのタスクの場合はmake_task_envによって構築されます。設定はオプションのみを保持し、そのsim_settings()はそれらをシミュレータ統合のキーワード引数にマッピングします。

環境の使用方法についてはSimulation、Hub での環境の活用と公開についてはEnvHub、ベンチマークの貢献についてはAdding a Benchmarkを参照してください。

HubEnvConfig

class lerobot.envs.HubEnvConfig

< >

( task: str | None = Nonefps: int = 30features: dict[str, PolicyFeature] = <factory>features_map: dict[str, str] = <factory>max_parallel_tasks: int = 1disable_env_checker: bool = Trueserver: EnvClientConfig | None = Nonehub_path: str | None = Nonetrust_remote_code: bool = Falsemake_env_kwargs: dict[str, Any] = <factory>use_native_batch: bool = False )

EnvHubのリポジトリのenv.pyからのenv。実行するにはtrust_remote_codeが必要です。

EnvConfig

クラス lerobot.envs.EnvConfig

< >

( task: str | None = Nonefps: int = 30features: dict[str, PolicyFeature] = <factory>features_map: dict[str, str] = <factory>max_parallel_tasks: int = 1disable_env_checker: bool = Trueserver: EnvClientConfig | None = None )

環境のオプション。make_envは、そのsim_settings()から環境を構築します。

create_env

< >

( *args: Any**kwargs: Any )

削除: lerobot.envs.make_task_env(config, task_group, task_id, ...) を使用して 1 つのタスクの env を構築する。

create_envs

< >

( *args: Any**kwargs: Any )

削除: lerobot.envs.make_env(config, n_envs, use_async_envs) で envs を構築します。

get_env_processors

< >

( )

この環境の (preprocessor, postprocessor) を返します。デフォルト: identity。

sim_config

< >

( )

sim_settings()を、シミュレーションのデフォルト値として返します。ローカル環境および環境サーバーが実行するのと同じです。

sim_settings

< >

( )

sim セクションのサーバー YAML と同様に、シミュレーション設定を返します。欠落している項目にはシミュレーションのデフォルト値が使用されます。

デフォルトでは、gym_kwargs とデルタアクションを備えた Gymnasium 環境 gym_id が使用されます。それ以外の場合は、上書きしてください。

make_env

lerobot.envs.make_env

< >

( cfg: EnvConfign_envs: int = 1use_async_envs: bool = False ) → dict[str, dict[int, gym.vector.VectorEnv]]

パラメータ

  • cfg (EnvConfig) — 環境設定です。EnvHub リポジトリは HubEnvConfig(hub_path="user/repo", trust_remote_code=True) です。
  • n_envs (int、任意、デフォルトは1) — 各ベクトル環境内の環境数。
  • use_async_envs (bool、省略可能、デフォルトはFalse) — 各環境を独自のワーカープロセスで実行します。

戻り値

dict[str, dict[int, gym.vector.VectorEnv]]

ベクトル環境は、{suite: {task_id: env}} の形式です。単一タスクの環境は1つのスイートを持ち、タスク ID は 0 です。

例外

ValueError または RuntimeError または ModuleNotFoundError

  • ValueError — n_envsが1未満の場合。
  • RuntimeError — EnvHubリポジトリのコードが、その設定のtrust_remote_codeなしで実行される場合。
  • ModuleNotFoundError — シミュレーター、またはリポジトリのenv.pyに必要なパッケージがインストールされていない場合。

設定のベクトル環境を構築します。

make_task_env

lerobot.envs.make_task_env

< >

( cfg: EnvConfigtask_group: str | None = Nonetask_id: int | None = Nonen_envs: int = 1use_async_envs: bool = False )

1つのタスクのローカルまたはサーブされたベクトル環境を構築します。task_idを指定しない場合、スイートの最初のタスクが使用されます。

make_env_config

lerobot.envs.make_env_config

< >

( env_type: str**kwargs )

Update on GitHub