env_wrapper
EnvironmentWrapper
Bases: Wrapper, Registerable
Base class for all environment wrappers in OmniGibson. In general, reset(), step(), and observation_spec() should be overwritten
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
OmniGibsonEnv
|
The environment to wrap. |
required |
Source code in OmniGibson/omnigibson/envs/env_wrapper.py
observation_spec()
By default, grabs the normal environment observation_spec
Returns:
| Type | Description |
|---|---|
dict
|
Observations from the environment |
reset(**kwargs)
By default, run the normal environment reset() function. Keyword arguments (e.g. env_indices
for vectorized per-env reset, seed, options) are forwarded to the wrapped environment so
the wrapper stays transparent to reset.
Returns:
| Type | Description |
|---|---|
dict
|
Environment observation space after reset occurs |
Source code in OmniGibson/omnigibson/envs/env_wrapper.py
step(action, n_render_iterations=1)
By default, run the normal environment step() function
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
tensor
|
action to take in environment |
required |
n_render_iterations
|
int
|
Number of rendering iterations to use before returning observations |
1
|
Returns: 4-tuple: - (dict) observations from the environment - (float) reward from the environment - (bool) whether the current episode is terminated - (bool) whether the current episode is truncated - (dict) misc information
Source code in OmniGibson/omnigibson/envs/env_wrapper.py
create_wrapper(env, wrapper_cfg=None)
Wraps environment @env with wrapper defined @wrapper_cfg
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
Environment
|
environment to wrap |
required |
wrapper_cfg
|
None or dict
|
Specified, configuration to wrap environment with If not specified, will default to env.wrapper_config |
None
|