mani_skill.envs.tasks.tabletop ============================== .. py:module:: mani_skill.envs.tasks.tabletop Submodules ---------- .. toctree:: :maxdepth: 1 /api/mani_skill/envs/tasks/tabletop/assembling_kits/index /api/mani_skill/envs/tasks/tabletop/lift_peg_upright/index /api/mani_skill/envs/tasks/tabletop/peg_insertion_side/index /api/mani_skill/envs/tasks/tabletop/pick_clutter_ycb/index /api/mani_skill/envs/tasks/tabletop/pick_cube/index /api/mani_skill/envs/tasks/tabletop/pick_cube_cfgs/index /api/mani_skill/envs/tasks/tabletop/pick_single_ycb/index /api/mani_skill/envs/tasks/tabletop/place_sphere/index /api/mani_skill/envs/tasks/tabletop/plug_charger/index /api/mani_skill/envs/tasks/tabletop/poke_cube/index /api/mani_skill/envs/tasks/tabletop/pull_cube/index /api/mani_skill/envs/tasks/tabletop/pull_cube_tool/index /api/mani_skill/envs/tasks/tabletop/push_cube/index /api/mani_skill/envs/tasks/tabletop/push_t/index /api/mani_skill/envs/tasks/tabletop/roll_ball/index /api/mani_skill/envs/tasks/tabletop/stack_cube/index /api/mani_skill/envs/tasks/tabletop/stack_pyramid/index /api/mani_skill/envs/tasks/tabletop/turn_faucet/index /api/mani_skill/envs/tasks/tabletop/two_robot_pick_cube/index /api/mani_skill/envs/tasks/tabletop/two_robot_stack_cube/index Classes ------- .. autoapisummary:: mani_skill.envs.tasks.tabletop.AssemblingKitsEnv mani_skill.envs.tasks.tabletop.LiftPegUprightEnv mani_skill.envs.tasks.tabletop.PegInsertionSideEnv mani_skill.envs.tasks.tabletop.PickClutterYCBEnv mani_skill.envs.tasks.tabletop.PickCubeEnv mani_skill.envs.tasks.tabletop.PickSingleYCBEnv mani_skill.envs.tasks.tabletop.PlaceSphereEnv mani_skill.envs.tasks.tabletop.PlugChargerEnv mani_skill.envs.tasks.tabletop.PokeCubeEnv mani_skill.envs.tasks.tabletop.PullCubeEnv mani_skill.envs.tasks.tabletop.PullCubeToolEnv mani_skill.envs.tasks.tabletop.PushCubeEnv mani_skill.envs.tasks.tabletop.PushTEnv mani_skill.envs.tasks.tabletop.RollBallEnv mani_skill.envs.tasks.tabletop.StackCubeEnv mani_skill.envs.tasks.tabletop.StackPyramidEnv mani_skill.envs.tasks.tabletop.TurnFaucetEnv mani_skill.envs.tasks.tabletop.TwoRobotPickCube mani_skill.envs.tasks.tabletop.TwoRobotStackCube Package Contents ---------------- .. py:class:: AssemblingKitsEnv(asset_root=f'{ASSET_DIR}/tasks/assembling_kits', robot_uids='panda_wristcam', num_envs=1, reconfiguration_freq=None, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** The robot must pick up one of the misplaced shapes on the board/kit and insert it into the correct empty slot. **Randomizations:** - the kit geometry is randomized, with different already inserted shapes and different holes affording insertion of specific shapes. (during reconfiguration) - the misplaced shape's geometry is sampled from one of 20 different shapes. (during reconfiguration) - the misplaced shape is randomly spawned anywhere on top of the board with a random z-axis rotation **Success Conditions:** - the misplaced shape is inserted completely into the correct slot .. py:method:: _check_in_slot(obj, height_eps=0.003) .. py:method:: _check_pos_diff(pos_eps=0.02) .. py:method:: _check_rot_diff(rot_eps=np.deg2rad(4)) .. py:method:: _get_kit_builder_and_goals(kit_id) .. py:method:: _get_object_builder(object_id, static = False, color_id = 0) .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: _parse_json(path) Parse kit JSON information and return the goal positions and rotations .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_REWARD_MODES :value: ['sparse', 'none'] .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda_wristcam'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _episode_json .. py:attribute:: _episodes .. py:attribute:: _kit_dir .. py:attribute:: _models_dir .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/AssemblingKits-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.PandaWristCam] .. py:attribute:: asset_root .. py:attribute:: color .. py:attribute:: episode_idx :value: None .. py:attribute:: object_scale .. py:attribute:: symmetry .. py:class:: LiftPegUprightEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** A simple task where the objective is to move a peg laying on the table to any upright position on the table **Randomizations:** - the peg's xy position is randomized on top of a table in the region [0.1, 0.1] x [-0.1, -0.1]. It is placed flat along it's length on the table **Success Conditions:** - the absolute value of the peg's y euler angle is within 0.08 of $\pi$/2 and the z position of the peg is within 0.005 of its half-length (0.12). .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda', 'fetch'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/LiftPegUpright-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.Panda, mani_skill.agents.robots.Fetch] .. py:attribute:: peg_half_length :value: 0.12 .. py:attribute:: peg_half_width :value: 0.025 .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:class:: PegInsertionSideEnv(*args, robot_uids='panda_wristcam', num_envs=1, reconfiguration_freq=None, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** Pick up a orange-white peg and insert the orange end into the box with a hole in it. **Randomizations:** - Peg half length is randomized between 0.085 and 0.125 meters. Box half length is the same value. (during reconfiguration) - Peg radius/half-width is randomized between 0.015 and 0.025 meters. Box hole's radius is same value + 0.003m of clearance. (during reconfiguration) - Peg is laid flat on table and has it's xy position and z-axis rotation randomized - Box is laid flat on table and has it's xy position and z-axis rotation randomized **Success Conditions:** - The white end of the peg is within 0.015m of the center of the box (inserted mid way). .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:method:: has_peg_inserted() .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda_wristcam'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:attribute:: _clearance :value: 0.003 .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PegInsertionSide-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.panda.PandaWristCam] .. py:property:: box_hole_pose .. py:property:: goal_pose .. py:property:: peg_head_pos .. py:property:: peg_head_pose .. py:class:: PickClutterYCBEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, num_envs=1, reconfiguration_freq=None, episode_json = None, **kwargs) Bases: :py:obj:`PickClutterEnv` Base environment picking items out of clutter type of tasks. Flexibly supports using different configurations and object datasets .. py:method:: _load_model(model_id) .. py:attribute:: DEFAULT_EPISODE_JSON :value: 'Instance of pathlib.Path/tasks/pick_clutter/ycb_train_5k.json.gz' .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PickClutterYCB-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:class:: PickCubeEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` Superclass for ManiSkill environments. :param num_envs: number of parallel environments to run. By default this is 1, which means a CPU simulation is used. If greater than 1, then we initialize the GPU simulation setup. Note that not all environments are faster when simulated on the GPU due to limitations of GPU simulations. For example, environments with many moving objects are better simulated by parallelizing across CPUs. :param obs_mode: observation mode to be used. Must be one of ("state", "state_dict", "none", "sensor_data", "rgb", "depth", "segmentation", "rgbd", "rgb+depth", "rgb+depth+segmentation", "rgb+segmentation", "depth+segmentation", "pointcloud") The obs_mode is mostly for convenience to automatically optimize/setup all sensors/cameras for the given observation mode to render the correct data and try to ignore unnecessary rendering. For the most advanced use cases (e.g. you have 1 RGB only camera and 1 depth only camera) :param reward_mode: reward mode to use. Must be one of ("normalized_dense", "dense", "sparse", "none"). With "none" the reward returned is always 0 :param control_mode: control mode of the agent. "*" represents all registered controllers, and the action space will be a dict. :param render_mode: render mode registered in @SUPPORTED_RENDER_MODES. :param shader_dir: shader directory. Defaults to None. Setting this will override the shader used for all cameras in the environment. This is legacy behavior kept for backwards compatibility. The proper way to change the shaders used for cameras is to either change the environment code or pass in sensor_configs/human_render_camera_configs with the desired shaders. Previously the options are "default", "rt", "rt-fast". "rt" means ray-tracing which results in more photorealistic renders but is slow, "rt-fast" is a lower quality but faster version of "rt". :type shader_dir: Optional[str] :param enable_shadow: whether to enable shadow for lights. Defaults to False. :type enable_shadow: bool :param sensor_configs: configurations of sensors to override any environment defaults. If the key is one of sensor names (e.g. a camera), the config value will be applied to the corresponding sensor. Otherwise, the value will be applied to all sensors (but overridden by sensor-specific values). For possible configurations see the documentation see :doc:`the sensors documentation `. :type sensor_configs: dict :param human_render_camera_configs: configurations of human rendering cameras to override any environment defaults. Similar usage as @sensor_configs. :type human_render_camera_configs: dict :param viewer_camera_configs: configurations of the viewer camera in the GUI to override any environment defaults. Similar usage as @sensor_configs. :type viewer_camera_configs: dict :param robot_uids: list of robots to instantiate and control in the environment. :type robot_uids: Union[str, BaseAgent, list[Union[str, BaseAgent]]] :param sim_config: Configurations for simulation if used that override the environment defaults. If given a dictionary, it can just override specific attributes e.g. ``sim_config=dict(scene_config=dict(solver_iterations=25))``. If passing in a SimConfig object, while typed, will override every attribute including the task defaults. Some environments define their own recommended default sim configurations via the ``self._default_sim_config`` attribute that generally should not be completely overriden. :type sim_config: Union[SimConfig, dict] :param reconfiguration_freq: How frequently to call reconfigure when environment is reset via `self.reset(...)` Generally for most users who are not building tasks this does not need to be changed. The default is 0, which means the environment reconfigures upon creation, and never again. :type reconfiguration_freq: int :param sim_backend: By default this is "auto". If sim_backend is "auto", then if ``num_envs == 1``, we use the PhysX CPU sim backend, otherwise we use the PhysX GPU sim backend and automatically pick a GPU to use. Can also be "physx_cpu" or "physx_cuda" to force usage of a particular sim backend. To select a particular GPU to run the simulation on, you can pass "physx_cuda:n" where n is the ID of the GPU, similar to the way PyTorch selects GPUs. Note that if this is "physx_cpu", num_envs can only be equal to 1. :type sim_backend: str :param render_backend: By default this is "gpu". If render_backend is "gpu" or it's alias "sapien_cuda", then we auto select a GPU to render with. It can be "sapien_cuda:n" where n is the ID of the GPU to render with. If this is "cpu" or "sapien_cpu", then we try to render on the CPU. If this is "none" or None, then we disable rendering. Note that some environments may require rendering functionalities to work. Moreover it is sometimes difficult to determine before running an environment if your machine can render or not. If you encounter some issue with rendering you can first try to double check your NVIDIA drivers / Vulkan drivers are setup correctly. If you don't need to do rendering you can simply disable it by setting render_backend to "none" or None. :type render_backend: str :param parallel_in_single_scene: By default this is False. If True, rendered images and the GUI will show all objects in one view. This is only really useful for generating cool videos showing all environments at once but it is not recommended otherwise as it slows down simulation and rendering. :type parallel_in_single_scene: bool :param enhanced_determinism: By default this is False and env resets will reset the episode RNG only when a seed / seed list is given. If True, the environment will reset the episode RNG upon each reset regardless of whether a seed is provided. Generally enhanced_determinisim is not needed and users are recommended to pass seeds into the env reset function instead. :type enhanced_determinism: bool .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda', 'fetch', 'xarm6_robotiq', 'so100', 'widowxai'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PickCube-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.Panda, mani_skill.agents.robots.Fetch, mani_skill.agents.robots.XArm6Robotiq, mani_skill.agents.robots.SO100, mani_skill.agents.robots.WidowXAI] .. py:attribute:: cube_half_size :value: 0.02 .. py:attribute:: cube_spawn_center :value: (0, 0) .. py:attribute:: cube_spawn_half_size :value: 0.05 .. py:attribute:: goal_thresh :value: 0.025 .. py:attribute:: human_cam_eye_pos :value: [0.6, 0.7, 0.6] .. py:attribute:: human_cam_target_pos :value: [0.0, 0.0, 0.35] .. py:attribute:: max_goal_height :value: 0.3 .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:attribute:: sensor_cam_eye_pos :value: [0.3, 0, 0.6] .. py:attribute:: sensor_cam_target_pos .. py:class:: PickSingleYCBEnv(*args, robot_uids='panda_wristcam', robot_init_qpos_noise=0.02, num_envs=1, reconfiguration_freq=None, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** Pick up a random object sampled from the [YCB dataset](https://www.ycbbenchmarks.com/) and move it to a random goal position **Randomizations:** - the object's xy position is randomized on top of a table in the region [0.1, 0.1] x [-0.1, -0.1]. It is placed flat on the table - the object's z-axis rotation is randomized - the object geometry is randomized by randomly sampling any YCB object. (during reconfiguration) **Success Conditions:** - the object position is within goal_thresh (default 0.025) euclidean distance of the goal position - the robot is static (q velocity < 0.2) **Goal Specification:** - 3D goal position (also visualized in human renders) **Additional Notes** - On GPU simulation, in order to collect data from every possible object in the YCB database we recommend using at least 128 parallel environments or more, otherwise you will need to reconfigure in order to sample new objects. .. py:method:: _after_reconfigure(options) Add code here that should run immediately after self._reconfigure is called. The torch RNG context is still active so RNG is still seeded here by self._episode_seed. This is useful if you need to run something that only happens after reconfiguration but need the GPU initialized so that you can check e.g. collisons, poses etc. .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda', 'panda_wristcam', 'fetch'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PickSingleYCB-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.panda.panda.Panda, mani_skill.agents.robots.panda.panda_wristcam.PandaWristCam, mani_skill.agents.robots.fetch.fetch.Fetch] .. py:attribute:: all_model_ids .. py:attribute:: goal_thresh :value: 0.025 .. py:attribute:: model_id :value: None .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:class:: PlaceSphereEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** Place the sphere into the shallow bin. **Randomizations:** - The position of the bin and the sphere are randomized: The bin is initialized in [0, 0.1] x [-0.1, 0.1], and the sphere is initialized in [-0.1, -0.05] x [-0.1, 0.1] **Success Conditions:** - The sphere is placed on the top of the bin. The robot remains static and the gripper is not closed at the end state. .. py:method:: _build_bin(radius) .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda', 'fetch'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PlaceSphere-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.Panda, mani_skill.agents.robots.Fetch] .. py:attribute:: block_half_size .. py:attribute:: edge_block_half_size .. py:attribute:: inner_side_half_len :value: 0.02 .. py:attribute:: radius :value: 0.02 .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:attribute:: short_side_half_size :value: 0.0025 .. py:class:: PlugChargerEnv(*args, robot_uids='panda_wristcam', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** The robot must pick up one of the misplaced shapes on the board/kit and insert it into the correct empty slot. **Randomizations:** - The charger position is randomized on the XY plane on top of the table. The rotation is also randomized - The receptacle position is randomized on the XY plane and the rotation is also randomized. Note that the human render camera has its pose fixed relative to the receptacle. **Success Conditions:** - The charger is inserted into the receptacle .. py:method:: _build_charger(peg_size, base_size, gap) .. py:method:: _build_receptacle(peg_size, receptacle_size, gap) .. py:method:: _compute_distance() .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_REWARD_MODES :value: ['none', 'sparse'] .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda_wristcam'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:attribute:: _base_size :value: [0.02, 0.015, 0.012] .. py:attribute:: _clearance :value: 0.0005 .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _peg_gap :value: 0.007 .. py:attribute:: _peg_size :value: [0.008, 0.00075, 0.0032] .. py:attribute:: _receptacle_size :value: [0.01, 0.05, 0.05] .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PlugCharger-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.PandaWristCam] .. py:property:: charger_base_pose .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:class:: PokeCubeEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** A simple task where the objective is to poke a red cube with a peg and push it to a target goal position. **Randomizations:** - the peg's xy position is randomized on top of a table in the region [0.1, 0.1] x [-0.1, -0.1]. It is placed flat along it's length on the table - the cube's x-coordinate is fixed to peg's x-coordinate + peg half-length (0.12) + 0.1 and y-coordinate is randomized in range [-0.1, 0.1]. It is placed flat on the table - the cube's z-axis rotation is randomized in range [-$\pi$/ 6, $\pi$ / 6] - the target goal region is marked by a red/white circular target. The position of the target is fixed to be the cube xy position + [0.05 + goal_radius, 0] **Success Conditions:** - the cube's xy position is within goal_radius (default 0.05) of the target's xy position by euclidean distance - the robot is static .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda', 'fetch'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PokeCube-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.Panda, mani_skill.agents.robots.Fetch] .. py:attribute:: cube_half_size :value: 0.02 .. py:attribute:: goal_radius :value: 0.05 .. py:attribute:: peg_half_length :value: 0.12 .. py:attribute:: peg_half_width :value: 0.025 .. py:property:: peg_head_pos .. py:property:: peg_head_pose .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:class:: PullCubeEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** A simple task where the objective is to pull a cube onto a target. **Randomizations:** - the cube's xy position is randomized on top of a table in the region [0.1, 0.1] x [-0.1, -0.1]. - the target goal region is marked by a red and white target. The position of the target is fixed to be the cube's xy position - [0.1 + goal_radius, 0] **Success Conditions:** - the cube's xy position is within goal_radius (default 0.1) of the target's xy position by euclidean distance. .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda', 'fetch'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PullCube-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.Panda, mani_skill.agents.robots.Fetch] .. py:attribute:: cube_half_size :value: 0.02 .. py:attribute:: goal_radius :value: 0.1 .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:class:: PullCubeToolEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description** Given an L-shaped tool that is within the reach of the robot, leverage the tool to pull a cube that is out of it's reach **Randomizations** - The cube's position (x,y) is randomized on top of a table in the region "". It is placed flat on the table - The target goal region is the region on top of the table marked by "" **Success Conditions** - The cube's xy position is within the goal region of the arm's base (marked by reachability) .. py:method:: _build_l_shaped_tool(handle_length, hook_length, width, height) .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Normalizes the dense reward by the maximum possible reward (success bonus) .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_REWARD_MODES :value: ('normalized_dense', 'dense', 'sparse', 'none') .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda', 'fetch'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PullCubeTool-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.Panda, mani_skill.agents.robots.Fetch] .. py:attribute:: arm_reach :value: 0.35 .. py:attribute:: cube_half_size :value: 0.02 .. py:attribute:: cube_size :value: 0.02 .. py:attribute:: goal_radius :value: 0.3 .. py:attribute:: handle_length :value: 0.2 .. py:attribute:: height :value: 0.05 .. py:attribute:: hook_length :value: 0.05 .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:attribute:: width :value: 0.05 .. py:class:: PushCubeEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** A simple task where the objective is to push and move a cube to a goal region in front of it **Randomizations:** - the cube's xy position is randomized on top of a table in the region [0.1, 0.1] x [-0.1, -0.1]. It is placed flat on the table - the target goal region is marked by a red/white circular target. The position of the target is fixed to be the cube xy position + [0.1 + goal_radius, 0] **Success Conditions:** - the cube's xy position is within goal_radius (default 0.1) of the target's xy position by euclidean distance and the cube is still on the table. .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda', 'fetch'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PushCube-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.Panda, mani_skill.agents.robots.Fetch] .. py:attribute:: cube_half_size :value: 0.02 .. py:attribute:: goal_radius :value: 0.1 .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:class:: PushTEnv(*args, robot_uids='panda_stick', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** A simulated version of the real-world push-T task from Diffusion Policy: https://diffusion-policy.cs.columbia.edu/ In this task, the robot needs to: 1. Precisely push the T-shaped block into the target region, and 2. Move the end-effector to the end-zone which terminates the episode. [2 Not required for PushT-easy-v1] **Randomizations:** - 3D T block initial position on table [-1,1] x [-1,2] + T Goal initial position - 3D T block initial z rotation [0,2pi] **Success Conditions:** - The T block covers 90% of the 2D goal T's area .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:method:: pseudo_render_intersection() 'pseudo render' algo for calculating the intersection made custom 'psuedo renderer' to compute intersection area all computation in parallel on cuda, zero explicit loops views blocks in 2d in the goal tee frame to see overlap .. py:method:: quat_to_z_euler(quats) .. py:method:: quat_to_zrot(quats) .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda_stick'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:attribute:: T_dynamic_friction :value: 3 .. py:attribute:: T_mass :value: 0.8 .. py:attribute:: T_static_friction :value: 3 .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/PushT-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: mani_skill.agents.robots.PandaStick .. py:attribute:: ee_starting_pos2D .. py:attribute:: ee_starting_pos3D .. py:attribute:: goal_offset .. py:attribute:: goal_z_rot .. py:attribute:: intersection_thresh :value: 0.9 .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:attribute:: tee_spawnbox_xlength :value: 0.2 .. py:attribute:: tee_spawnbox_xoffset :value: -0.1 .. py:attribute:: tee_spawnbox_ylength :value: 0.3 .. py:attribute:: tee_spawnbox_yoffset :value: -0.1 .. py:class:: RollBallEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** A simple task where the objective is to push and roll a ball to a goal region at the other end of the table **Randomizations:** - The ball's xy position is randomized on top of a table in the region [0.2, 0.5] x [-0.4, 0.7]. It is placed flat on the table - The target goal region is marked by a red/white circular target. The position of the target is randomized on top of a table in the region [-0.4, -0.7] x [0.2, -0.9] **Success Conditions:** - The ball's xy position is within goal_radius (default 0.1) of the target's xy position by euclidean distance. .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/RollBall-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: mani_skill.agents.robots.Panda .. py:attribute:: ball_radius :type: float :value: 0.035 .. py:attribute:: goal_radius :type: float :value: 0.1 .. py:attribute:: reached_status :type: torch.Tensor .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:class:: StackCubeEnv(*args, robot_uids='panda_wristcam', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** The goal is to pick up a red cube and stack it on top of a green cube and let go of the cube without it falling **Randomizations:** - both cubes have their z-axis rotation randomized - both cubes have their xy positions on top of the table scene randomized. The positions are sampled such that the cubes do not collide with each other **Success Conditions:** - the red cube is on top of the green cube (to within half of the cube size) - the red cube is static - the red cube is not being grasped by the robot (robot must let go of the cube) .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda_wristcam', 'panda', 'fetch'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/StackCube-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: Union[mani_skill.agents.robots.Panda, mani_skill.agents.robots.Fetch] .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:class:: StackPyramidEnv(*args, robot_uids='panda_wristcam', robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** - The goal is to pick up a red cube, place it next to the green cube, and stack the blue cube on top of the red and green cube without it falling off. **Randomizations:** - all cubes have their z-axis rotation randomized - all cubes have their xy positions on top of the table scene randomized. The positions are sampled such that the cubes do not collide with each other **Success Conditions:** - the blue cube is static - the blue cube is on top of both the red and green cube (to within half of the cube size) - none of the red, green, blue cubes are grasped by the robot (robot must let go of the cubes) _sample_video_link = "https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/StackPyramid-v1_rt.mp4" .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_REWARD_MODES :value: ['none', 'sparse'] .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda_wristcam', 'panda', 'fetch'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:attribute:: agent :type: Union[mani_skill.agents.robots.Panda, mani_skill.agents.robots.Fetch] .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:class:: TurnFaucetEnv(*args, robot_uids='panda_wristcam', robot_init_qpos_noise=0.02, reconfiguration_freq=None, num_envs=1, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` Superclass for ManiSkill environments. :param num_envs: number of parallel environments to run. By default this is 1, which means a CPU simulation is used. If greater than 1, then we initialize the GPU simulation setup. Note that not all environments are faster when simulated on the GPU due to limitations of GPU simulations. For example, environments with many moving objects are better simulated by parallelizing across CPUs. :param obs_mode: observation mode to be used. Must be one of ("state", "state_dict", "none", "sensor_data", "rgb", "depth", "segmentation", "rgbd", "rgb+depth", "rgb+depth+segmentation", "rgb+segmentation", "depth+segmentation", "pointcloud") The obs_mode is mostly for convenience to automatically optimize/setup all sensors/cameras for the given observation mode to render the correct data and try to ignore unnecessary rendering. For the most advanced use cases (e.g. you have 1 RGB only camera and 1 depth only camera) :param reward_mode: reward mode to use. Must be one of ("normalized_dense", "dense", "sparse", "none"). With "none" the reward returned is always 0 :param control_mode: control mode of the agent. "*" represents all registered controllers, and the action space will be a dict. :param render_mode: render mode registered in @SUPPORTED_RENDER_MODES. :param shader_dir: shader directory. Defaults to None. Setting this will override the shader used for all cameras in the environment. This is legacy behavior kept for backwards compatibility. The proper way to change the shaders used for cameras is to either change the environment code or pass in sensor_configs/human_render_camera_configs with the desired shaders. Previously the options are "default", "rt", "rt-fast". "rt" means ray-tracing which results in more photorealistic renders but is slow, "rt-fast" is a lower quality but faster version of "rt". :type shader_dir: Optional[str] :param enable_shadow: whether to enable shadow for lights. Defaults to False. :type enable_shadow: bool :param sensor_configs: configurations of sensors to override any environment defaults. If the key is one of sensor names (e.g. a camera), the config value will be applied to the corresponding sensor. Otherwise, the value will be applied to all sensors (but overridden by sensor-specific values). For possible configurations see the documentation see :doc:`the sensors documentation `. :type sensor_configs: dict :param human_render_camera_configs: configurations of human rendering cameras to override any environment defaults. Similar usage as @sensor_configs. :type human_render_camera_configs: dict :param viewer_camera_configs: configurations of the viewer camera in the GUI to override any environment defaults. Similar usage as @sensor_configs. :type viewer_camera_configs: dict :param robot_uids: list of robots to instantiate and control in the environment. :type robot_uids: Union[str, BaseAgent, list[Union[str, BaseAgent]]] :param sim_config: Configurations for simulation if used that override the environment defaults. If given a dictionary, it can just override specific attributes e.g. ``sim_config=dict(scene_config=dict(solver_iterations=25))``. If passing in a SimConfig object, while typed, will override every attribute including the task defaults. Some environments define their own recommended default sim configurations via the ``self._default_sim_config`` attribute that generally should not be completely overriden. :type sim_config: Union[SimConfig, dict] :param reconfiguration_freq: How frequently to call reconfigure when environment is reset via `self.reset(...)` Generally for most users who are not building tasks this does not need to be changed. The default is 0, which means the environment reconfigures upon creation, and never again. :type reconfiguration_freq: int :param sim_backend: By default this is "auto". If sim_backend is "auto", then if ``num_envs == 1``, we use the PhysX CPU sim backend, otherwise we use the PhysX GPU sim backend and automatically pick a GPU to use. Can also be "physx_cpu" or "physx_cuda" to force usage of a particular sim backend. To select a particular GPU to run the simulation on, you can pass "physx_cuda:n" where n is the ID of the GPU, similar to the way PyTorch selects GPUs. Note that if this is "physx_cpu", num_envs can only be equal to 1. :type sim_backend: str :param render_backend: By default this is "gpu". If render_backend is "gpu" or it's alias "sapien_cuda", then we auto select a GPU to render with. It can be "sapien_cuda:n" where n is the ID of the GPU to render with. If this is "cpu" or "sapien_cpu", then we try to render on the CPU. If this is "none" or None, then we disable rendering. Note that some environments may require rendering functionalities to work. Moreover it is sometimes difficult to determine before running an environment if your machine can render or not. If you encounter some issue with rendering you can first try to double check your NVIDIA drivers / Vulkan drivers are setup correctly. If you don't need to do rendering you can simply disable it by setting render_backend to "none" or None. :type render_backend: str :param parallel_in_single_scene: By default this is False. If True, rendered images and the GUI will show all objects in one view. This is only really useful for generating cool videos showing all environments at once but it is not recommended otherwise as it slows down simulation and rendering. :type parallel_in_single_scene: bool :param enhanced_determinism: By default this is False and env resets will reset the episode RNG only when a seed / seed list is given. If True, the environment will reset the episode RNG upon each reset regardless of whether a seed is provided. Generally enhanced_determinisim is not needed and users are recommended to pass seeds into the env reset function instead. :type enhanced_determinism: bool .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_REWARD_MODES :value: ['sparse', 'none'] .. py:attribute:: SUPPORTED_ROBOTS :value: ['panda', 'panda_wristcam', 'fetch'] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:attribute:: TRAIN_JSON .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: agent :type: Union[mani_skill.agents.robots.Panda, mani_skill.agents.robots.Fetch] .. py:attribute:: all_model_ids .. py:property:: current_angle .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:attribute:: train_info .. py:class:: TwoRobotPickCube(*args, robot_uids=('panda_wristcam', 'panda_wristcam'), robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** The goal is to pick up a red cube and lift it to a goal location. There are two robots in this task and the goal location is out of reach of the left robot while the cube is out of reach of the right robot, thus the two robots must work together to move the cube to the goal. **Randomizations:** - cube has its z-axis rotation randomized - cube has its xy positions on top of the table scene randomized such that it is in within reach of the left robot but not the right. - the target goal position (marked by a green sphere) of the cube is randomized such that it is within reach of the right robot but not the left. **Success Conditions:** - red cube is at the goal location .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: [('panda_wristcam', 'panda_wristcam')] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/refs/heads/main/figures/environment_demos/TwoRobotPick... a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: mani_skill.agents.multi_agent.MultiAgent[Tuple[mani_skill.agents.robots.panda.Panda, mani_skill.agents.robots.panda.Panda]] .. py:attribute:: cube_half_size :value: 0.02 .. py:attribute:: goal_thresh :value: 0.025 .. py:property:: left_agent :type: mani_skill.agents.robots.panda.Panda .. py:property:: right_agent :type: mani_skill.agents.robots.panda.Panda .. py:attribute:: robot_init_qpos_noise :value: 0.02 .. py:class:: TwoRobotStackCube(*args, robot_uids=('panda_wristcam', 'panda_wristcam'), robot_init_qpos_noise=0.02, **kwargs) Bases: :py:obj:`mani_skill.envs.sapien_env.BaseEnv` **Task Description:** A collaborative task where two robot arms need to work together to stack two cubes. One robot must pick up the green cube and place it on the target region, while the other robot picks up the blue cube and stacks it on top of the green cube. The cubes are initially positioned such that each robot can only reach one cube - the green cube is near the right robot and the blue cube is near the left robot. This requires coordination between the robots to complete the stacking task. **Randomizations:** - Both cubes have random rotations around their z-axis - The xy positions of both cubes on the table are randomized, while ensuring: - The cubes do not collide with each other - The green cube remains reachable by the right robot - The blue cube remains reachable by the left robot - The goal region is placed along the midline between the robots (y=0), with randomized x position **Success Conditions:** - The blue cube is stacked on top of the green cube (within half a cube size) - The green cube is placed on the red/white target region - Both cubes are released by the robots (not being grasped) .. py:method:: _get_obs_extra(info) Get task-relevant extra observations. Usually defined on a task by task basis .. py:method:: _initialize_episode(env_idx, options) Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions .. py:method:: _load_agent(options) loads the agent/controllable articulations into the environment. The default function provides a convenient way to setup the agent/robot by a robot_uid (stored in self.robot_uids) without requiring the user to have to write the robot building and controller code themselves. For more advanced use-cases you can override this function to have more control over the agent/robot building process. :param options: The options for the environment. :type options: dict :param initial_agent_poses: The initial poses of the agent/robot. Providing these poses and ensuring they are picked such that they do not collide with objects if spawned there is highly recommended to ensure more stable simulation (the agent pose can be changed later during episode initialization). :type initial_agent_poses: Optional[Union[sapien.Pose, Pose]] :param build_separate: Whether to build the agent/robot separately. If True, the agent/robot will be built separately for each parallel environment and then merged together to be accessible under one view/object. This is useful for randomizing physical and visual properties of the agent/robot which is only permitted for articulations built separately in each environment. :type build_separate: bool .. py:method:: _load_scene(options) Loads all objects like actors and articulations into the scene. Called by `self._reconfigure`. Given options argument is the same options dictionary passed to the self.reset function .. py:method:: compute_dense_reward(obs, action, info) Compute the dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: compute_normalized_dense_reward(obs, action, info) Compute the normalized dense reward. :param obs: The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.) :type obs: Any :param action: The most recent action. :type action: torch.Tensor :param info: The info dictionary. :type info: dict .. py:method:: evaluate() Evaluate whether the environment is currently in a success state by returning a dictionary with a "success" key or a failure state via a "fail" key This function may also return additional data that has been computed (e.g. is the robot grasping some object) that may be reused when generating observations and rewards. By default if not overriden this function returns an empty dictionary .. py:attribute:: SUPPORTED_ROBOTS :value: [('panda_wristcam', 'panda_wristcam')] Override this to enforce which robots or tuples of robots together are supported in the task. During env creation, setting robot_uids auto loads all desired robots into the scene, but not all tasks are designed to support some robot setups .. py:property:: _default_human_render_camera_configs Add default cameras for rendering when using render_mode='rgb_array'. These can be overriden by the user at env creation time .. py:property:: _default_sensor_configs Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time .. py:property:: _default_sim_config .. py:attribute:: _sample_video_link :value: 'https://github.com/haosulab/ManiSkill/raw/main/figures/environment_demos/TwoRobotStackCube-v1_rt.mp4' a link to a sample video of the task. This is mostly used for automatic documentation generation .. py:attribute:: agent :type: mani_skill.agents.multi_agent.MultiAgent[Tuple[mani_skill.agents.robots.panda.Panda, mani_skill.agents.robots.panda.Panda]] .. py:attribute:: goal_radius :value: 0.06 .. py:property:: left_agent :type: mani_skill.agents.robots.panda.Panda .. py:property:: right_agent :type: mani_skill.agents.robots.panda.Panda .. py:attribute:: robot_init_qpos_noise :value: 0.02