mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-22 20:19:43 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
@@ -35,7 +35,9 @@ def make_env_config(env_type: str, **kwargs) -> EnvConfig:
|
|||||||
raise ValueError(f"Policy type '{env_type}' is not available.")
|
raise ValueError(f"Policy type '{env_type}' is not available.")
|
||||||
|
|
||||||
|
|
||||||
def make_env(cfg: EnvConfig, n_envs: int = 1, use_async_envs: bool = False) -> gym.vector.VectorEnv | dict[str, dict[int, gym.vector.VectorEnv]]:
|
def make_env(
|
||||||
|
cfg: EnvConfig, n_envs: int = 1, use_async_envs: bool = False
|
||||||
|
) -> gym.vector.VectorEnv | dict[str, dict[int, gym.vector.VectorEnv]]:
|
||||||
"""Makes a gym vector environment according to the config.
|
"""Makes a gym vector environment according to the config.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
@@ -147,7 +147,10 @@ def get_libero_dummy_action():
|
|||||||
"""Get dummy/no-op action, used to roll out the simulation while the robot does nothing."""
|
"""Get dummy/no-op action, used to roll out the simulation while the robot does nothing."""
|
||||||
return [0, 0, 0, 0, 0, 0, -1]
|
return [0, 0, 0, 0, 0, 0, -1]
|
||||||
|
|
||||||
|
|
||||||
ACTION_DIM = 8
|
ACTION_DIM = 8
|
||||||
|
|
||||||
|
|
||||||
class LiberoEnv(gym.Env):
|
class LiberoEnv(gym.Env):
|
||||||
metadata = {"render_modes": ["rgb_array"], "render_fps": 80}
|
metadata = {"render_modes": ["rgb_array"], "render_fps": 80}
|
||||||
|
|
||||||
@@ -178,7 +181,7 @@ class LiberoEnv(gym.Env):
|
|||||||
self.camera_name = camera_name.split(
|
self.camera_name = camera_name.split(
|
||||||
","
|
","
|
||||||
) # agentview_image (main) or robot0_eye_in_hand_image (wrist)
|
) # agentview_image (main) or robot0_eye_in_hand_image (wrist)
|
||||||
|
|
||||||
# Map raw camera names to "image1" and "image2".
|
# Map raw camera names to "image1" and "image2".
|
||||||
# The preprocessing step `preprocess_observation` will then prefix these with `.images.*`,
|
# The preprocessing step `preprocess_observation` will then prefix these with `.images.*`,
|
||||||
# following the LeRobot convention (e.g., `observation.images.image`, `observation.images.image2`).
|
# following the LeRobot convention (e.g., `observation.images.image`, `observation.images.image2`).
|
||||||
|
|||||||
Reference in New Issue
Block a user