mani_skill.utils.wrappers.flatten#
Classes#
Flattens the action space. The original action space must be spaces.Dict |
|
Flattens the observations into a single vector |
|
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.ActionWrapperFlattens 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
- property base_env: mani_skill.envs.sapien_env.BaseEnv[source]#
- Return type:
- class mani_skill.utils.wrappers.flatten.FlattenObservationWrapper(env)[source]#
Bases:
gymnasium.ObservationWrapperFlattens the observations into a single vector
- observation(observation)[source]#
Returns a modified observation.
- Parameters:
observation – The
envobservation- Returns:
The modified observation
- property base_env: mani_skill.envs.sapien_env.BaseEnv[source]#
- Return type:
- class mani_skill.utils.wrappers.flatten.FlattenRGBDObservationWrapper(env, rgb=True, depth=True, state=True, sep_depth=True)[source]#
Bases:
gymnasium.ObservationWrapperFlattens 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.