After installing AI2-THOR, we can initialize a controller, which will allow us to execute actions in the environment.
from ai2thor.controller import Controller
controller = Controller(
agentMode="default",
visibilityDistance=1.5,
scene="FloorPlan212",
# step sizes
gridSize=0.25,
snapToGrid=True,
rotateStepDegrees=90,
# image modalities
renderDepthImage=False,
renderInstanceSegmentation=False,
# camera properties
width=300,
height=300,
fieldOfView=90
)
The type of agent that will interact with the scene. For iTHOR, stick with
Used to set the maximum goal distance in meters between the agent and an object. This affects each object's
The name of which scene to initialize. Valid iTHOR scenes are listed here. If unspecified and the
The amount, in meters, that the agent moves after calling a move action (e.g.,
Determines whether the agent’s position is snapped to a grid point after any movement action (e.g.,
The default amount, in degrees, that the agent rotates after calling a rotate action (i.e.,
When
When
The number of horizontal sampled pixels for each frame. This affects every rendered image frame (e.g.,
The number of vertical sampled pixels for each frame. This affects every rendered image frame (e.g.,
Changes the camera's optical field of view, in degrees. Valid values are in the domain . The default field of view when
Any
controller.reset(scene="FloorPlan319", rotateStepDegrees=30)
The values will default to what they were upon the most recent reset or initialization. For instance, if you initialized with
By default, AI2-THOR executes high-level actions that provide a response from the environment after the action completes execution. For instance, if the agent successfully executes an
However, we also provide the ability to observe intermediate results, which is discussed in this section.
controller.step("PausePhysicsAutoSim")
The amount of time in seconds to advance the physics simulation. Valid values are in .
Unpausing auto-simulation while objects are still in motion (i.e.,
To capture the entire movement of an object, do not unpause physics with this action until all objects return
controller.step("UnpausePhysicsAutoSim")