Skip to content

allenact_plugins.manipulathor_plugin.manipulathor_environment#

[view_source]

A wrapper for engaging with the ManipulaTHOR environment.

rotation_distance#

rotation_distance(s1: Dict[str, float], s2: Dict[str, float])

[view_source]

Distance between rotations.

ManipulaTHOREnvironment#

class ManipulaTHOREnvironment(IThorEnvironment)

[view_source]

Wrapper for the manipulathor controller providing arm functionality and bookkeeping.

See here for comprehensive documentation on AI2-THOR.

Attributes

  • controller: The ai2thor controller.

ManipulaTHOREnvironment.__init__#

 | __init__(x_display: Optional[str] = None, docker_enabled: bool = False, local_thor_build: Optional[str] = None, visibility_distance: float = VISIBILITY_DISTANCE, fov: float = FOV, player_screen_width: int = 224, player_screen_height: int = 224, quality: str = "Very Low", restrict_to_initially_reachable_points: bool = False, make_agents_visible: bool = True, object_open_speed: float = 1.0, simplify_physics: bool = False, verbose: bool = False, env_args=None) -> None

[view_source]

Initializer.

Parameters

  • x_display : The x display into which to launch ai2thor (possibly necessarily if you are running on a server without an attached display).
  • docker_enabled : Whether or not to run thor in a docker container (useful on a server without an attached display so that you don't have to start an x display).
  • local_thor_build : The path to a local build of ai2thor. This is probably not necessary for your use case and can be safely ignored.
  • visibility_distance : The distance (in meters) at which objects, in the viewport of the agent, are considered visible by ai2thor and will have their "visible" flag be set to True in the metadata.
  • fov : The agent's camera's field of view.
  • width : The width resolution (in pixels) of the images returned by ai2thor.
  • height : The height resolution (in pixels) of the images returned by ai2thor.
  • quality : The quality at which to render. Possible quality settings can be found in ai2thor._quality_settings.QUALITY_SETTINGS.
  • restrict_to_initially_reachable_points : Whether or not to restrict the agent to locations in ai2thor that were found to be (initially) reachable by the agent (i.e. reachable by the agent after resetting the scene). This can be useful if you want to ensure there are only a fixed set of locations where the agent can go.
  • make_agents_visible : Whether or not the agent should be visible. Most noticable when there are multiple agents or when quality settings are high so that the agent casts a shadow.
  • object_open_speed : How quickly objects should be opened. High speeds mean faster simulation but also mean that opening objects have a lot of kinetic energy and can, possibly, knock other objects away.
  • simplify_physics : Whether or not to simplify physics when applicable. Currently this only simplies object interactions when opening drawers (when simplified, objects within a drawer do not slide around on their own when the drawer is opened or closed, instead they are effectively glued down).

ManipulaTHOREnvironment.start#

 | start(scene_name: Optional[str], move_mag: float = 0.25, **kwargs, ,) -> None

[view_source]

Starts the ai2thor controller if it was previously stopped.

After starting, reset will be called with the scene name and move magnitude.

Parameters

  • scene_name : The scene to load.
  • move_mag : The amount of distance the agent moves in a single MoveAhead step.
  • kwargs : additional kwargs, passed to reset.

ManipulaTHOREnvironment.object_in_hand#

 | object_in_hand()

[view_source]

Object metadata for the object in the agent's hand.

ManipulaTHOREnvironment.step#

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

[view_source]

Take a step in the ai2thor environment.