habitat.core.env.Env class

Fundamental environment class for habitat.

All the information needed for working on embodied task with simulator is abstracted inside Env. Acts as a base for other derived environment classes. Env consists of three major components: dataset (episodes), simulator (sim) and task and connects all the three components together.

Methods

def close(self) -> None
def get_metrics(self) -> embodied_task.Metrics
def reconfigure(self, config: DictConfig)
def render(self, mode = 'rgb') -> numpy.ndarray
def reset(self) -> simulator.Observations
Resets the environments and returns the initial observations.
def seed(self, seed: int) -> None
def step(self, action: typing.Union[int, str, typing.Dict[str, typing.Any]], **kwargs) -> simulator.Observations
Perform an action in the environment and return observations.

Special methods

def __enter__(self)
def __exit__(self, exc_type, exc_val, exc_tb)
def __init__(self, config: DictConfig, dataset = None)
Constructor

Properties

current_episode: dataset.Episode get set
episode_iterator: typing.Iterator[dataset.Episode] get set
episode_over: bool get
episode_start_time: typing.Optional[float] get
episodes: typing.List[dataset.Episode] get set
sim: simulator.Simulator get
task: embodied_task.EmbodiedTask get

Data

observation_space: gym.spaces.dict.Dict = None
SpaceDict object corresponding to sensor in sim and task.
action_space: gym.spaces.dict.Dict = None
gym.space object corresponding to valid actions.
number_of_episodes: typing.Optional[int] = None

Method documentation

def habitat.core.env.Env.reset(self) -> simulator.Observations

Resets the environments and returns the initial observations.

Returns initial observations from the environment.

def habitat.core.env.Env.step(self, action: typing.Union[int, str, typing.Dict[str, typing.Any]], **kwargs) -> simulator.Observations

Perform an action in the environment and return observations.

Parameters
action action (belonging to action_space) to be performed inside the environment. Action is a name or index of allowed task’s action and action arguments (belonging to action’s action_space) to support parametrized and continuous actions.
kwargs
Returns observations after taking action in environment.

def habitat.core.env.Env.__init__(self, config: DictConfig, dataset = None)

Constructor

Parameters
config config for the environment. Should contain id for simulator and task_name which are passed into make_sim and make_task.
dataset reference to dataset for task instance level information. Can be defined as None in which case _episodes should be populated from outside.