mani_skill.utils.wrappers.flatten#

Classes#

FlattenActionSpaceWrapper

Flattens the action space. The original action space must be spaces.Dict

FlattenObservationWrapper

Flattens the observations into a single vector

FlattenRGBDObservationWrapper

Flattens the rgbd mode observations into a dictionary with two keys, "rgbd" and "state"

Module Contents#

class mani_skill.utils.wrappers.flatten.FlattenActionSpaceWrapper(env)[source]#

Bases: gymnasium.ActionWrapper

Flattens the action space. The original action space must be spaces.Dict

action(action)[source]#

Returns a modified action before step() is called.

Parameters:

action – The original step() actions

Returns:

The modified actions

_orig_single_action_space[source]#
property base_env: mani_skill.envs.sapien_env.BaseEnv[source]#
Return type:

mani_skill.envs.sapien_env.BaseEnv

single_action_space[source]#
class mani_skill.utils.wrappers.flatten.FlattenObservationWrapper(env)[source]#

Bases: gymnasium.ObservationWrapper

Flattens the observations into a single vector

observation(observation)[source]#

Returns a modified observation.

Parameters:

observation – The env observation

Returns:

The modified observation

property base_env: mani_skill.envs.sapien_env.BaseEnv[source]#
Return type:

mani_skill.envs.sapien_env.BaseEnv

class mani_skill.utils.wrappers.flatten.FlattenRGBDObservationWrapper(env, rgb=True, depth=True, state=True, sep_depth=True)[source]#

Bases: gymnasium.ObservationWrapper

Flattens the rgbd mode observations into a dictionary with two keys, “rgbd” and “state”

Parameters:
  • rgb (bool) – Whether to include rgb images in the observation

  • depth (bool) – Whether to include depth images in the observation

  • state (bool) – Whether to include state data in the observation

  • sep_depth (bool) – Whether to separate depth and rgb images in the observation. Default is True.

Note that the returned observations will have a “rgb” or “depth” key depending on the rgb/depth bool flags, and will always have a “state” key. If sep_depth is False, rgb and depth will be merged into a single “rgbd” key.

observation(observation)[source]#

Returns a modified observation.

Parameters:

observation (dict) – The env observation

Returns:

The modified observation

base_env: mani_skill.envs.sapien_env.BaseEnv[source]#
include_depth = True[source]#
include_rgb = True[source]#
include_state = True[source]#
sep_depth = True[source]#