Source code for mani_skill.envs.tasks.empty_env

import numpy as np
import sapien
import torch

from mani_skill.agents.robots.fetch.fetch import Fetch
from mani_skill.agents.robots.panda.panda import Panda
from mani_skill.envs.sapien_env import BaseEnv
from mani_skill.sensors.camera import CameraConfig
from mani_skill.utils import sapien_utils
from mani_skill.utils.building.ground import build_ground
from mani_skill.utils.registration import register_env
from mani_skill.utils.structs.types import GPUMemoryConfig, SimConfig


@register_env("Empty-v1", max_episode_steps=200000)
[docs]class EmptyEnv(BaseEnv):
[docs] SUPPORTED_REWARD_MODES = ["none"]
""" This is just a dummy environment for showcasing robots in a empty scene """ def __init__(self, *args, robot_uids="panda", **kwargs): super().__init__(*args, robot_uids=robot_uids, **kwargs) @property
[docs] def _default_sensor_configs(self): pose = sapien_utils.look_at([1.25, -1.25, 1.5], [0.0, 0.0, 0.2]) return [CameraConfig("base_camera", pose, 128, 128, np.pi / 2, 0.01, 100)]
@property
[docs] def _default_human_render_camera_configs(self): pose = sapien_utils.look_at([1.25, -1.25, 1.5], [0.0, 0.0, 0.2]) return CameraConfig("render_camera", pose, 2048, 2048, 1, 0.01, 100)
[docs] def _load_agent(self, options: dict): super()._load_agent(options, sapien.Pose())
[docs] def _load_scene(self, options: dict): self.ground = build_ground(self.scene) self.ground.set_collision_group_bit(group=2, bit_idx=30, bit=1)
[docs] def _initialize_episode(self, env_idx: torch.Tensor, options: dict): pass
[docs] def evaluate(self): return {}
[docs] def _get_obs_extra(self, info: dict): return dict()