mani_skill.envs.tasks.mobile_manipulation.open_cabinet_drawer#

Attributes#

Classes#

OpenCabinetDoorEnv

Task Description:

OpenCabinetDrawerEnv

Task Description:

Module Contents#

class mani_skill.envs.tasks.mobile_manipulation.open_cabinet_drawer.OpenCabinetDoorEnv(*args, robot_uids='fetch', robot_init_qpos_noise=0.02, reconfiguration_freq=None, num_envs=1, **kwargs)[source]#

Bases: OpenCabinetDrawerEnv

Task Description: Use the Fetch mobile manipulation robot to move towards a target cabinet and open the target drawer out.

Randomizations: - Robot is randomly initialized 1.6 to 1.8 meters away from the cabinet and positioned to face it - Robot’s base orientation is randomized by -9 to 9 degrees - The cabinet selected to manipulate is randomly sampled from all PartnetMobility cabinets that have drawers - The drawer to open is randomly sampled from all drawers available to open

Success Conditions: - The drawer is open at least 90% of the way, and the angular/linear velocities of the drawer link are small

Goal Specification: - 3D goal position centered at the center of mass of the handle mesh on the drawer to open (also visualized in human renders with a sphere).

TRAIN_JSON[source]#
handle_types = ['revolute', 'revolute_unwrapped'][source]#
class mani_skill.envs.tasks.mobile_manipulation.open_cabinet_drawer.OpenCabinetDrawerEnv(*args, robot_uids='fetch', robot_init_qpos_noise=0.02, reconfiguration_freq=None, num_envs=1, **kwargs)[source]#

Bases: mani_skill.envs.sapien_env.BaseEnv

Task Description: Use the Fetch mobile manipulation robot to move towards a target cabinet and open the target drawer out.

Randomizations: - Robot is randomly initialized 1.6 to 1.8 meters away from the cabinet and positioned to face it - Robot’s base orientation is randomized by -9 to 9 degrees - The cabinet selected to manipulate is randomly sampled from all PartnetMobility cabinets that have drawers - The drawer to open is randomly sampled from all drawers available to open

Success Conditions: - The drawer is open at least 90% of the way, and the angular/linear velocities of the drawer link are small

Goal Specification: - 3D goal position centered at the center of mass of the handle mesh on the drawer to open (also visualized in human renders with a sphere).

_after_control_step()[source]#

Code that runs after each action has been taken. On GPU simulation this is called right before observations are fetched from the GPU buffers.

_after_reconfigure(options)[source]#

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.

_get_obs_extra(info)[source]#

Get task-relevant extra observations. Usually defined on a task by task basis

Parameters:

info (dict) –

_initialize_episode(env_idx, options)[source]#

Initialize the episode, e.g., poses of actors and articulations, as well as task relevant data like randomizing goal positions

Parameters:
  • env_idx (torch.Tensor) –

  • options (dict) –

_load_agent(options)[source]#

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.

Parameters:
  • options (dict) – The options for the environment.

  • initial_agent_poses (Optional[Union[sapien.Pose, Pose]]) – 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).

  • build_separate (bool) – 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.

_load_cabinets(joint_types)[source]#
Parameters:

joint_types (list[str]) –

_load_scene(options)[source]#

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

Parameters:

options (dict) –

compute_dense_reward(obs, action, info)[source]#

Compute the dense reward.

Parameters:
  • obs (Any) – The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.)

  • action (torch.Tensor) – The most recent action.

  • info (dict) – The info dictionary.

compute_normalized_dense_reward(obs, action, info)[source]#

Compute the normalized dense reward.

Parameters:
  • obs (Any) – The observation data. By default the observation data will be in its most raw form, a dictionary (no flattening, wrappers etc.)

  • action (torch.Tensor) – The most recent action.

  • info (dict) – The info dictionary.

evaluate()[source]#

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

Parameters:

env_idx (Optional[torch.Tensor]) –

SUPPORTED_ROBOTS = ['fetch'][source]#

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

TRAIN_JSON[source]#
property _default_human_render_camera_configs[source]#

Add default cameras for rendering when using render_mode=’rgb_array’. These can be overriden by the user at env creation time

property _default_sensor_configs[source]#

Add default (non-agent) sensors to the environment by returning sensor configurations. These can be overriden by the user at env creation time

property _default_sim_config[source]#

a link to a sample video of the task. This is mostly used for automatic documentation generation

agent: mani_skill.agents.robots.Fetch[source]#
all_model_ids[source]#
handle_types = ['prismatic'][source]#
min_open_frac = 0.75[source]#
robot_init_qpos_noise = 0.02[source]#
mani_skill.envs.tasks.mobile_manipulation.open_cabinet_drawer.CABINET_COLLISION_BIT = 29[source]#