Skip to content

allenact_plugins.robothor_plugin.robothor_environment#

[view_source]

RoboThorEnvironment#

class RoboThorEnvironment()

[view_source]

Wrapper for the robo2thor controller providing additional functionality and bookkeeping.

See here for comprehensive documentation on RoboTHOR.

Attributes

  • controller: The AI2-THOR controller.
  • config: The AI2-THOR controller configuration

RoboThorEnvironment.initialize_grid_dimensions#

 | initialize_grid_dimensions(reachable_points: Collection[Dict[str, float]]) -> Tuple[int, int, int, int]

[view_source]

Computes bounding box for reachable points quantized with the current gridSize.

RoboThorEnvironment.distance_from_point_to_object_type#

 | distance_from_point_to_object_type(point: Dict[str, float], object_type: str, allowed_error: float) -> float

[view_source]

Minimal geodesic distance from a point to an object of the given type.

It might return -1.0 for unreachable targets.

RoboThorEnvironment.distance_to_object_type#

 | distance_to_object_type(object_type: str, agent_id: int = 0) -> float

[view_source]

Minimal geodesic distance to object of given type from agent's current location.

It might return -1.0 for unreachable targets.

RoboThorEnvironment.distance_to_point#

 | distance_to_point(target: Dict[str, float], agent_id: int = 0) -> float

[view_source]

Minimal geodesic distance to end point from agent's current location.

It might return -1.0 for unreachable targets.

RoboThorEnvironment.agent_state#

 | agent_state(agent_id: int = 0) -> Dict

[view_source]

Return agent position, rotation and horizon.

RoboThorEnvironment.reset#

 | reset(scene_name: str = None, filtered_objects: Optional[List[str]] = None) -> None

[view_source]

Resets scene to a known initial state.

RoboThorEnvironment.random_reachable_state#

 | random_reachable_state(seed: Optional[int] = None) -> Dict[str, Union[Dict[str, float], float]]

[view_source]

Returns a random reachable location in the scene.

RoboThorEnvironment.randomize_agent_location#

 | randomize_agent_location(seed: int = None, partial_position: Optional[Dict[str, float]] = None, agent_id: int = 0) -> Dict[str, Union[Dict[str, float], float]]

[view_source]

Teleports the agent to a random reachable location in the scene.

RoboThorEnvironment.currently_reachable_points#

 | @property
 | currently_reachable_points() -> List[Dict[str, float]]

[view_source]

List of {"x": x, "y": y, "z": z} locations in the scene that are currently reachable.

RoboThorEnvironment.scene_name#

 | @property
 | scene_name() -> str

[view_source]

Current ai2thor scene.

RoboThorEnvironment.current_frame#

 | @property
 | current_frame() -> np.ndarray

[view_source]

Returns rgb image corresponding to the agent's egocentric view.

RoboThorEnvironment.current_depth#

 | @property
 | current_depth() -> np.ndarray

[view_source]

Returns depth image corresponding to the agent's egocentric view.

RoboThorEnvironment.current_frames#

 | @property
 | current_frames() -> List[np.ndarray]

[view_source]

Returns rgb images corresponding to the agents' egocentric views.

RoboThorEnvironment.current_depths#

 | @property
 | current_depths() -> List[np.ndarray]

[view_source]

Returns depth images corresponding to the agents' egocentric views.

RoboThorEnvironment.last_event#

 | @property
 | last_event() -> ai2thor.server.Event

[view_source]

Last event returned by the controller.

RoboThorEnvironment.last_action#

 | @property
 | last_action() -> str

[view_source]

Last action, as a string, taken by the agent.

RoboThorEnvironment.last_action_success#

 | @property
 | last_action_success() -> bool

[view_source]

Was the last action taken by the agent a success?

RoboThorEnvironment.last_action_return#

 | @property
 | last_action_return() -> Any

[view_source]

Get the value returned by the last action (if applicable).

For an example of an action that returns a value, see "GetReachablePositions".

RoboThorEnvironment.step#

 | step(action_dict: Optional[Dict[str, Union[str, int, float, Dict]]] = None, **kwargs: Union[str, int, float, Dict], ,) -> ai2thor.server.Event

[view_source]

Take a step in the ai2thor environment.

RoboThorEnvironment.stop#

 | stop()

[view_source]

Stops the ai2thor controller.

RoboThorEnvironment.all_objects#

 | all_objects() -> List[Dict[str, Any]]

[view_source]

Return all object metadata.

RoboThorEnvironment.all_objects_with_properties#

 | all_objects_with_properties(properties: Dict[str, Any]) -> List[Dict[str, Any]]

[view_source]

Find all objects with the given properties.

RoboThorEnvironment.visible_objects#

 | visible_objects() -> List[Dict[str, Any]]

[view_source]

Return all visible objects.

RoboThorCachedEnvironment#

class RoboThorCachedEnvironment()

[view_source]

Wrapper for the robo2thor controller providing additional functionality and bookkeeping.

See here for comprehensive documentation on RoboTHOR.

Attributes

  • controller: The AI2THOR controller.
  • config: The AI2THOR controller configuration

RoboThorCachedEnvironment.agent_state#

 | agent_state() -> Dict[str, Union[Dict[str, float], float]]

[view_source]

Return agent position, rotation and horizon.

RoboThorCachedEnvironment.reset#

 | reset(scene_name: str = None) -> None

[view_source]

Resets scene to a known initial state.

RoboThorCachedEnvironment.currently_reachable_points#

 | @property
 | currently_reachable_points() -> List[Dict[str, float]]

[view_source]

List of {"x": x, "y": y, "z": z} locations in the scene that are currently reachable.

RoboThorCachedEnvironment.scene_name#

 | @property
 | scene_name() -> str

[view_source]

Current ai2thor scene.

RoboThorCachedEnvironment.current_frame#

 | @property
 | current_frame() -> np.ndarray

[view_source]

Returns rgb image corresponding to the agent's egocentric view.

RoboThorCachedEnvironment.current_depth#

 | @property
 | current_depth() -> np.ndarray

[view_source]

Returns depth image corresponding to the agent's egocentric view.

RoboThorCachedEnvironment.last_event#

 | @property
 | last_event() -> ai2thor.server.Event

[view_source]

Last event returned by the controller.

RoboThorCachedEnvironment.last_action#

 | @property
 | last_action() -> str

[view_source]

Last action, as a string, taken by the agent.

RoboThorCachedEnvironment.last_action_success#

 | @property
 | last_action_success() -> bool

[view_source]

In the cached environment, all actions succeed.

RoboThorCachedEnvironment.last_action_return#

 | @property
 | last_action_return() -> Any

[view_source]

Get the value returned by the last action (if applicable).

For an example of an action that returns a value, see "GetReachablePositions".

RoboThorCachedEnvironment.step#

 | step(action_dict: Dict[str, Union[str, int, float]]) -> ai2thor.server.Event

[view_source]

Take a step in the ai2thor environment.

RoboThorCachedEnvironment.stop#

 | stop()

[view_source]

Stops the ai2thor controller.

RoboThorCachedEnvironment.all_objects#

 | all_objects() -> List[Dict[str, Any]]

[view_source]

Return all object metadata.

RoboThorCachedEnvironment.all_objects_with_properties#

 | all_objects_with_properties(properties: Dict[str, Any]) -> List[Dict[str, Any]]

[view_source]

Find all objects with the given properties.

RoboThorCachedEnvironment.visible_objects#

 | visible_objects() -> List[Dict[str, Any]]

[view_source]

Return all visible objects.