mani_skill.utils.wrappers.action_repeat#

Classes#

ActionRepeatWrapper

Wraps a gymnasium.Env to allow a modular transformation of the step() and reset() methods.

Module Contents#

class mani_skill.utils.wrappers.action_repeat.ActionRepeatWrapper(env, repeat)[source]#

Bases: gymnasium.Wrapper

Wraps a gymnasium.Env to allow a modular transformation of the step() and reset() methods.

This class is the base class of all wrappers to change the behavior of the underlying environment. Wrappers that inherit from this class can modify the action_space, observation_space and metadata attributes, without changing the underlying environment’s attributes. Moreover, the behavior of the step() and reset() methods can be changed by these wrappers.

Some attributes (spec, render_mode, np_random) will point back to the wrapper’s environment (i.e. to the corresponding attributes of env).

Note

If you inherit from Wrapper, don’t forget to call super().__init__(env)

Parameters:
_update_dict_values(from_dict, to_dict, not_dones)[source]#

Recursively updates the values of a dictionary with the values from another dictionary but only for the envs that are not done. This allows us to update the observation and info dictionaries with new values only for the environments that are not done. If a sub-env becomes done, its future step data will be discarded since not_dones will be false for this sub-environment. Therefore the final observation/info will come from the true last step of the sub-env.

Parameters:
  • from_dict (dict) –

  • to_dict (dict) –

  • not_dones (mani_skill.utils.structs.types.Array) –

step(action)[source]#

Uses the step() of the env that can be overwritten to change the returned data.

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

mani_skill.envs.sapien_env.BaseEnv

property num_envs[source]#
repeat[source]#