allenact_plugins.robothor_plugin.robothor_environment
#
RoboThorEnvironment
#
class RoboThorEnvironment()
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]
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
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
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
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
Return agent position, rotation and horizon.
RoboThorEnvironment.reset
#
| reset(scene_name: str = None, filtered_objects: Optional[List[str]] = None) -> None
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]]
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]]
Teleports the agent to a random reachable location in the scene.
RoboThorEnvironment.currently_reachable_points
#
| @property
| currently_reachable_points() -> List[Dict[str, float]]
List of {"x": x, "y": y, "z": z} locations in the scene that are currently reachable.
RoboThorEnvironment.scene_name
#
| @property
| scene_name() -> str
Current ai2thor scene.
RoboThorEnvironment.current_frame
#
| @property
| current_frame() -> np.ndarray
Returns rgb image corresponding to the agent's egocentric view.
RoboThorEnvironment.current_depth
#
| @property
| current_depth() -> np.ndarray
Returns depth image corresponding to the agent's egocentric view.
RoboThorEnvironment.current_frames
#
| @property
| current_frames() -> List[np.ndarray]
Returns rgb images corresponding to the agents' egocentric views.
RoboThorEnvironment.current_depths
#
| @property
| current_depths() -> List[np.ndarray]
Returns depth images corresponding to the agents' egocentric views.
RoboThorEnvironment.last_event
#
| @property
| last_event() -> ai2thor.server.Event
Last event returned by the controller.
RoboThorEnvironment.last_action
#
| @property
| last_action() -> str
Last action, as a string, taken by the agent.
RoboThorEnvironment.last_action_success
#
| @property
| last_action_success() -> bool
Was the last action taken by the agent a success?
RoboThorEnvironment.last_action_return
#
| @property
| last_action_return() -> Any
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
Take a step in the ai2thor environment.
RoboThorEnvironment.stop
#
| stop()
Stops the ai2thor controller.
RoboThorEnvironment.all_objects
#
| all_objects() -> List[Dict[str, Any]]
Return all object metadata.
RoboThorEnvironment.all_objects_with_properties
#
| all_objects_with_properties(properties: Dict[str, Any]) -> List[Dict[str, Any]]
Find all objects with the given properties.
RoboThorEnvironment.visible_objects
#
| visible_objects() -> List[Dict[str, Any]]
Return all visible objects.
RoboThorCachedEnvironment
#
class RoboThorCachedEnvironment()
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]]
Return agent position, rotation and horizon.
RoboThorCachedEnvironment.reset
#
| reset(scene_name: str = None) -> None
Resets scene to a known initial state.
RoboThorCachedEnvironment.currently_reachable_points
#
| @property
| currently_reachable_points() -> List[Dict[str, float]]
List of {"x": x, "y": y, "z": z} locations in the scene that are currently reachable.
RoboThorCachedEnvironment.scene_name
#
| @property
| scene_name() -> str
Current ai2thor scene.
RoboThorCachedEnvironment.current_frame
#
| @property
| current_frame() -> np.ndarray
Returns rgb image corresponding to the agent's egocentric view.
RoboThorCachedEnvironment.current_depth
#
| @property
| current_depth() -> np.ndarray
Returns depth image corresponding to the agent's egocentric view.
RoboThorCachedEnvironment.last_event
#
| @property
| last_event() -> ai2thor.server.Event
Last event returned by the controller.
RoboThorCachedEnvironment.last_action
#
| @property
| last_action() -> str
Last action, as a string, taken by the agent.
RoboThorCachedEnvironment.last_action_success
#
| @property
| last_action_success() -> bool
In the cached environment, all actions succeed.
RoboThorCachedEnvironment.last_action_return
#
| @property
| last_action_return() -> Any
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
Take a step in the ai2thor environment.
RoboThorCachedEnvironment.stop
#
| stop()
Stops the ai2thor controller.
RoboThorCachedEnvironment.all_objects
#
| all_objects() -> List[Dict[str, Any]]
Return all object metadata.
RoboThorCachedEnvironment.all_objects_with_properties
#
| all_objects_with_properties(properties: Dict[str, Any]) -> List[Dict[str, Any]]
Find all objects with the given properties.
RoboThorCachedEnvironment.visible_objects
#
| visible_objects() -> List[Dict[str, Any]]
Return all visible objects.