mani_skill.envs.tasks.tabletop#

Submodules#

Classes#

AssemblingKitsEnv

Task Description:

LiftPegUprightEnv

Task Description:

PegInsertionSideEnv

Task Description:

PickClutterYCBEnv

Base environment picking items out of clutter type of tasks. Flexibly supports using different configurations and object datasets

PickCubeEnv

Superclass for ManiSkill environments.

PickSingleYCBEnv

Task Description:

PlaceSphereEnv

Task Description:

PlugChargerEnv

Task Description:

PokeCubeEnv

Task Description:

PullCubeEnv

Task Description:

PullCubeToolEnv

Task Description

PushCubeEnv

Task Description:

PushTEnv

Task Description:

RollBallEnv

Task Description:

StackCubeEnv

Task Description:

StackPyramidEnv

Task Description:

TurnFaucetEnv

Superclass for ManiSkill environments.

TwoRobotPickCube

Task Description:

TwoRobotStackCube

Task Description:

Package Contents#

class mani_skill.envs.tasks.tabletop.AssemblingKitsEnv(asset_root=f'{ASSET_DIR}/tasks/assembling_kits', robot_uids='panda_wristcam', num_envs=1, reconfiguration_freq=None, **kwargs)[source]#

Bases: 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

_check_in_slot(obj, height_eps=0.003)[source]#
Parameters:

obj (mani_skill.utils.structs.Actor) –

_check_pos_diff(pos_eps=0.02)[source]#
_check_rot_diff(rot_eps=np.deg2rad(4))[source]#
_get_kit_builder_and_goals(kit_id)[source]#
Parameters:

kit_id (str) –

_get_object_builder(object_id, static=False, color_id=0)[source]#
Parameters:
  • object_id (str) –

  • static (bool) –

  • color_id (int) –

_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_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) –

_parse_json(path)[source]#

Parse kit JSON information and return the goal positions and rotations

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

Return type:

dict

SUPPORTED_REWARD_MODES = ['sparse', 'none']#
SUPPORTED_ROBOTS = ['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

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

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

property _default_sim_config#
_episode_json#
_episodes#
_kit_dir#
_models_dir#

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

agent: mani_skill.agents.robots.PandaWristCam#
asset_root#
color#
episode_idx = None#
object_scale#
symmetry#
class mani_skill.envs.tasks.tabletop.LiftPegUprightEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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).

_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_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

SUPPORTED_ROBOTS = ['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

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

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

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#
peg_half_length = 0.12#
peg_half_width = 0.025#
robot_init_qpos_noise = 0.02#
class mani_skill.envs.tasks.tabletop.PegInsertionSideEnv(*args, robot_uids='panda_wristcam', num_envs=1, reconfiguration_freq=None, **kwargs)[source]#

Bases: 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).

_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_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

has_peg_inserted()[source]#
SUPPORTED_ROBOTS = ['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

_clearance = 0.003#
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

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

property _default_sim_config#

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

agent: mani_skill.agents.robots.panda.PandaWristCam#
property box_hole_pose#
property goal_pose#
property peg_head_pos#
property peg_head_pose#
class mani_skill.envs.tasks.tabletop.PickClutterYCBEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, num_envs=1, reconfiguration_freq=None, episode_json=None, **kwargs)[source]#

Bases: PickClutterEnv

Base environment picking items out of clutter type of tasks. Flexibly supports using different configurations and object datasets

Parameters:

episode_json (str) –

_load_model(model_id)[source]#
DEFAULT_EPISODE_JSON = 'Instance of pathlib.Path/tasks/pick_clutter/ycb_train_5k.json.gz'#

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

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

Bases: mani_skill.envs.sapien_env.BaseEnv

Superclass for ManiSkill environments.

Parameters:
  • 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.

  • 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)

  • reward_mode – reward mode to use. Must be one of (“normalized_dense”, “dense”, “sparse”, “none”). With “none” the reward returned is always 0

  • control_mode – control mode of the agent. “*” represents all registered controllers, and the action space will be a dict.

  • render_mode – render mode registered in @SUPPORTED_RENDER_MODES.

  • shader_dir (Optional[str]) –

    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”.

  • enable_shadow (bool) – whether to enable shadow for lights. Defaults to False.

  • sensor_configs (dict) – 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 the sensors documentation.

  • human_render_camera_configs (dict) – configurations of human rendering cameras to override any environment defaults. Similar usage as @sensor_configs.

  • viewer_camera_configs (dict) – configurations of the viewer camera in the GUI to override any environment defaults. Similar usage as @sensor_configs.

  • robot_uids (Union[str, BaseAgent, list[Union[str, BaseAgent]]]) – list of robots to instantiate and control in the environment.

  • sim_config (Union[SimConfig, dict]) – 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.

  • reconfiguration_freq (int) – 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.

  • sim_backend (str) – 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.

  • render_backend (str) –

    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.

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

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

_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_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

SUPPORTED_ROBOTS = ['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

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

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

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 | mani_skill.agents.robots.XArm6Robotiq | mani_skill.agents.robots.SO100 | mani_skill.agents.robots.WidowXAI#
cube_half_size = 0.02#
cube_spawn_center = (0, 0)#
cube_spawn_half_size = 0.05#
goal_thresh = 0.025#
human_cam_eye_pos = [0.6, 0.7, 0.6]#
human_cam_target_pos = [0.0, 0.0, 0.35]#
max_goal_height = 0.3#
robot_init_qpos_noise = 0.02#
sensor_cam_eye_pos = [0.3, 0, 0.6]#
sensor_cam_target_pos#
class mani_skill.envs.tasks.tabletop.PickSingleYCBEnv(*args, robot_uids='panda_wristcam', robot_init_qpos_noise=0.02, num_envs=1, reconfiguration_freq=None, **kwargs)[source]#

Bases: 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.

_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.

Parameters:

options (dict) –

_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_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

SUPPORTED_ROBOTS = ['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

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

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

property _default_sim_config#

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

agent: mani_skill.agents.robots.panda.panda.Panda | mani_skill.agents.robots.panda.panda_wristcam.PandaWristCam | mani_skill.agents.robots.fetch.fetch.Fetch#
all_model_ids#
goal_thresh = 0.025#
model_id = None#
robot_init_qpos_noise = 0.02#
class mani_skill.envs.tasks.tabletop.PlaceSphereEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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.

_build_bin(radius)[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_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_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

SUPPORTED_ROBOTS = ['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

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

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

property _default_sim_config#

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#
block_half_size#
edge_block_half_size#
inner_side_half_len = 0.02#
radius = 0.02#
robot_init_qpos_noise = 0.02#
short_side_half_size = 0.0025#
class mani_skill.envs.tasks.tabletop.PlugChargerEnv(*args, robot_uids='panda_wristcam', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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

_build_charger(peg_size, base_size, gap)[source]#
_build_receptacle(peg_size, receptacle_size, gap)[source]#
_compute_distance()[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_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_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) –

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 = ['none', 'sparse']#
SUPPORTED_ROBOTS = ['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

_base_size = [0.02, 0.015, 0.012]#
_clearance = 0.0005#
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

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

property _default_sim_config#
_peg_gap = 0.007#
_peg_size = [0.008, 0.00075, 0.0032]#
_receptacle_size = [0.01, 0.05, 0.05]#

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

agent: mani_skill.agents.robots.PandaWristCam#
property charger_base_pose#
robot_init_qpos_noise = 0.02#
class mani_skill.envs.tasks.tabletop.PokeCubeEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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

_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_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

SUPPORTED_ROBOTS = ['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

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

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

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#
cube_half_size = 0.02#
goal_radius = 0.05#
peg_half_length = 0.12#
peg_half_width = 0.025#
property peg_head_pos#
property peg_head_pose#
robot_init_qpos_noise = 0.02#
class mani_skill.envs.tasks.tabletop.PullCubeEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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.

_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_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

SUPPORTED_ROBOTS = ['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

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

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

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#
cube_half_size = 0.02#
goal_radius = 0.1#
robot_init_qpos_noise = 0.02#
class mani_skill.envs.tasks.tabletop.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')#
SUPPORTED_ROBOTS = ['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

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

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

property _default_sim_config#

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#
arm_reach = 0.35#
cube_half_size = 0.02#
cube_size = 0.02#
goal_radius = 0.3#
handle_length = 0.2#
height = 0.05#
hook_length = 0.05#
robot_init_qpos_noise = 0.02#
width = 0.05#
class mani_skill.envs.tasks.tabletop.PushCubeEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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.

_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_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

SUPPORTED_ROBOTS = ['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

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

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

property _default_sim_config#

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#
cube_half_size = 0.02#
goal_radius = 0.1#
robot_init_qpos_noise = 0.02#
class mani_skill.envs.tasks.tabletop.PushTEnv(*args, robot_uids='panda_stick', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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

_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_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

pseudo_render_intersection()[source]#

‘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

quat_to_z_euler(quats)[source]#
quat_to_zrot(quats)[source]#
SUPPORTED_ROBOTS = ['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

T_dynamic_friction = 3#
T_mass = 0.8#
T_static_friction = 3#
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

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

property _default_sim_config#

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

agent: mani_skill.agents.robots.PandaStick#
ee_starting_pos2D#
ee_starting_pos3D#
goal_offset#
goal_z_rot#
intersection_thresh = 0.9#
robot_init_qpos_noise = 0.02#
tee_spawnbox_xlength = 0.2#
tee_spawnbox_xoffset = -0.1#
tee_spawnbox_ylength = 0.3#
tee_spawnbox_yoffset = -0.1#
class mani_skill.envs.tasks.tabletop.RollBallEnv(*args, robot_uids='panda', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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.

_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_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

SUPPORTED_ROBOTS = ['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

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

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

property _default_sim_config#

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

agent: mani_skill.agents.robots.Panda#
ball_radius: float = 0.035#
goal_radius: float = 0.1#
reached_status: torch.Tensor#
robot_init_qpos_noise = 0.02#
class mani_skill.envs.tasks.tabletop.StackCubeEnv(*args, robot_uids='panda_wristcam', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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)

_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_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

SUPPORTED_ROBOTS = ['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

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

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

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#
robot_init_qpos_noise = 0.02#
class mani_skill.envs.tasks.tabletop.StackPyramidEnv(*args, robot_uids='panda_wristcam', robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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 = “haosulab/ManiSkill

_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) –

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 = ['none', 'sparse']#
SUPPORTED_ROBOTS = ['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

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

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

agent: mani_skill.agents.robots.Panda | mani_skill.agents.robots.Fetch#
robot_init_qpos_noise = 0.02#
class mani_skill.envs.tasks.tabletop.TurnFaucetEnv(*args, robot_uids='panda_wristcam', robot_init_qpos_noise=0.02, reconfiguration_freq=None, num_envs=1, **kwargs)[source]#

Bases: mani_skill.envs.sapien_env.BaseEnv

Superclass for ManiSkill environments.

Parameters:
  • 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.

  • 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)

  • reward_mode – reward mode to use. Must be one of (“normalized_dense”, “dense”, “sparse”, “none”). With “none” the reward returned is always 0

  • control_mode – control mode of the agent. “*” represents all registered controllers, and the action space will be a dict.

  • render_mode – render mode registered in @SUPPORTED_RENDER_MODES.

  • shader_dir (Optional[str]) –

    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”.

  • enable_shadow (bool) – whether to enable shadow for lights. Defaults to False.

  • sensor_configs (dict) – 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 the sensors documentation.

  • human_render_camera_configs (dict) – configurations of human rendering cameras to override any environment defaults. Similar usage as @sensor_configs.

  • viewer_camera_configs (dict) – configurations of the viewer camera in the GUI to override any environment defaults. Similar usage as @sensor_configs.

  • robot_uids (Union[str, BaseAgent, list[Union[str, BaseAgent]]]) – list of robots to instantiate and control in the environment.

  • sim_config (Union[SimConfig, dict]) – 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.

  • reconfiguration_freq (int) – 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.

  • sim_backend (str) – 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.

  • render_backend (str) –

    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.

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

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

_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_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) –

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 = ['sparse', 'none']#
SUPPORTED_ROBOTS = ['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

TRAIN_JSON#
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

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

property _default_sim_config#
agent: mani_skill.agents.robots.Panda | mani_skill.agents.robots.Fetch#
all_model_ids#
property current_angle#
robot_init_qpos_noise = 0.02#
train_info#
class mani_skill.envs.tasks.tabletop.TwoRobotPickCube(*args, robot_uids=('panda_wristcam', 'panda_wristcam'), robot_init_qpos_noise=0.02, **kwargs)[source]#

Bases: 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

_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_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

SUPPORTED_ROBOTS = [('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

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

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

property _default_sim_config#

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

agent: mani_skill.agents.multi_agent.MultiAgent[Tuple[mani_skill.agents.robots.panda.Panda, mani_skill.agents.robots.panda.Panda]]#
cube_half_size = 0.02#
goal_thresh = 0.025#
property left_agent: mani_skill.agents.robots.panda.Panda#
Return type:

mani_skill.agents.robots.panda.Panda

property right_agent: mani_skill.agents.robots.panda.Panda#
Return type:

mani_skill.agents.robots.panda.Panda

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

Bases: 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)

_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_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

SUPPORTED_ROBOTS = [('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

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

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

property _default_sim_config#

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

agent: mani_skill.agents.multi_agent.MultiAgent[Tuple[mani_skill.agents.robots.panda.Panda, mani_skill.agents.robots.panda.Panda]]#
goal_radius = 0.06#
property left_agent: mani_skill.agents.robots.panda.Panda#
Return type:

mani_skill.agents.robots.panda.Panda

property right_agent: mani_skill.agents.robots.panda.Panda#
Return type:

mani_skill.agents.robots.panda.Panda

robot_init_qpos_noise = 0.02#