mani_skill.envs.tasks.tabletop.pull_cube_tool#

Classes#

PullCubeToolEnv

Task Description

Module Contents#

class mani_skill.envs.tasks.tabletop.pull_cube_tool.PullCubeToolEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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 “<out of manipulator reach, but within reach of tool>”. It is placed flat on the table - The target goal region is the region on top of the table marked by “<within reach of arm>”

Success Conditions - The cube’s xy position is within the goal region of the arm’s base (marked by reachability)

_build_l_shaped_tool(handle_length, hook_length, width, height)[source]#
_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_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]#

Normalizes the dense reward by the maximum possible reward (success bonus)

Parameters:
  • obs (Any) –

  • action (torch.Tensor) –

  • info (dict) –

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

SUPPORTED_REWARD_MODES = ('normalized_dense', 'dense', 'sparse', 'none')[source]#
SUPPORTED_ROBOTS = ['panda', '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

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.Panda | mani_skill.agents.robots.Fetch[source]#
arm_reach = 0.35[source]#
cube_half_size = 0.02[source]#
cube_size = 0.02[source]#
goal_radius = 0.3[source]#
handle_length = 0.2[source]#
height = 0.05[source]#
hook_length = 0.05[source]#
robot_init_qpos_noise = 0.02[source]#
width = 0.05[source]#