AI2-THOR Documentation

repository·main·Indexed 23 days ago

https://github.com/allenai/ai2thor

A near photo-realistic, interactable framework for embodied AI agents designed for research in navigation, manipulation, and common sense reasoning. It includes three primary interaction frameworks: iTHOR for common sense reasoning, ManipulaTHOR for robotic arm manipulation, and RoboTHOR for Sim2Real research. The framework provides tools for managing environments, agents, and objects, with support for Unity 3D rendering, Docker, and Google Colab.

Tokens
8.7K
Snippets
13
Records
55
Agent score
83%

What's inside AI2-THOR

  1. Overview of AI2-THOR Environments

    main

    AI2-THOR provides three primary interaction frameworks:

    • iTHOR: A high-level interaction framework for research in embodied common sense reasoning.
    • ManipulaTHOR: A mid-level interaction framework for visual manipulation of objects using a robotic arm.
    • RoboTHOR: A framework for Sim2Real research using simulated scene counterparts of the physical world.
  2. How the Agent Hand and physics-based pickup work

    main

    AI2-THOR 1.0 replaced the abstract inventory system with a physical Agent Hand.

    • World Space Manipulation: When an object is picked up, it moves to the Hand in world space. This means holding large objects (like a baseball bat) can physically restrict the Agent's ability to move through narrow spaces.
    • Visibility Obstruction: Held objects realistically block the Agent's view. The size of the object affects visibility; for example, holding a basketball may block the view of smaller objects on a desk.
  3. How visibility and interactability are determined

    main

    In AI2-THOR 1.0, visibility and interactability are decoupled to allow for more realistic scenarios (e.g., seeing through glass but being unable to touch what is behind it).

    • Visibility: An object is considered visible if the Agent's camera can draw a line to any part of the object's form (previously, it required a line to the center of the object).
    • Interactability: An object is interactable only if it is both visible and reachable.
    • Transparency: Some objects (e.g., glass shower doors, glass cups) have a Transparent property. The Agent can see through these objects, but they still obstruct physical interaction with objects behind them.

    Debug Mode Colors:

    • Magenta: Visible and Interactable.
    • Yellow: Visible, but NOT Interactable (e.g., blocked by a transparent object or out of reach).
  4. Understand the difference between Pickupable and Moveable objects

    main

    In AI2-THOR, objects are categorized by how they interact with physics and agent actions:

    • Pickupable objects: Small objects that can be picked up by the agent's hand. They possess an objectOrientedBoundingBox metadata value that remains constant regardless of rotation.
    • Moveable objects: Larger objects (e.g., Chair, Table, Sofa, Microwave, Toaster) that are not explicitly attached to the scene structure. They cannot be picked up by the agent, but they can be manipulated using physics-based actions like PushObject and PullObject.

    All Sim Objects possess an axisAlignedBoundingBox metadata value, which represents a world-axis-oriented box encompassing the object. Note that this box's volume may change if the object rotates because it aligns with world axes rather than local object axes.

  5. Use ManipulaTHOR for robotic arm manipulation

    main

    ManipulaTHOR is a specialized environment within AI2-THOR designed for visual manipulation using a robotic arm. It introduces several actions specifically for arm-based interaction:

    • MoveArm: Uses inverse kinematics to move the position of the grasper.
    • MoveArmBase: Adjusts the height of the arm by moving the base up and down.
    • PickupObject: Uses the grasper to pick up SimObjects.
    • ReleaseObject: Drops objects currently held by the grasper.
    • SetHandSphereRadius: Adjusts the radius of the arm's grasper.
    • MoveContinuous: Enables continuous movement that detects collisions while moving through the scene.
    • RotateContinuous: Enables continuous rotation that detects collisions while rotating within the scene.
  6. Contextual interactions in AI2-THOR 2.0

    main

    In AI2-THOR 2.0, certain state changes occur automatically based on the environment and object interactions without requiring explicit agent actions. These are known as Contextual Interactions.

    Examples include:

    • Breaking: Breakable objects may break if dropped with sufficient force.
    • Cleaning: Dirty dishwater becomes clean when moved under running water.
    • Cooking: Potatoes are cooked when moved over an active stove burner.
    • Filling: Fillable objects are filled with water when moved under a running water source.
    • Extinguishing: Lit candles are put out if placed in water.
  7. Receptacle functionality and movement

    main

    Receptacles in AI2-THOR 1.0 have improved fidelity and physics:

    • Placement Fidelity: Objects can be placed anywhere across the entire surface of a receptacle with unrestricted rotation (previously limited to specific points/rotations).
    • Moveable Receptacles: If a receptacle can be picked up (e.g., a bowl), any objects contained within it move collectively with the receptacle (e.g., picking up a bowl with an egg inside).
    • Animated Open/Close: Openable receptacles (like cabinets) now feature animated opening and closing. These animations are physics-aware; if an object (like a chair) blocks the opening path, the animation will attempt to push the obstructing object out of the way.
  8. Object Location Randomization

    main

    Each scene supports randomizing object locations within valid receptacles.

    • Seeding: Randomization can be seeded to ensure reproducible scene states.
    • Constraints: Objects are placed based on their receptacle restrictions (e.g., a tomato can spawn in a Microwave or Fridge, but not in a Drawer).
    • Limitations: Large objects like Fridges or Sofas currently cannot be randomized.
  9. Use WebGL Templates and the HideNSeek demo

    main

    AI2-THOR includes WebGL templates (located in unity/Assets/WebGLTemplates) that can be used as a starting point for custom interfaces or crowdsourcing tasks.

    To run the HideNSeek demo template:

    1. Open the AI2-THOR project in Unity.
    2. Select the WebGL Template named HideNSeek (unity/Assets/WebGLTemplates/HideNSeek).
    3. In the Unity Build menu, switch the target platform to WebGL/HTML5 and build.
    4. Once the local server launches, ensure your URL includes the required GET parameters for objects: http://localhost:<port>?object=Tomato&variation=0

    Supported object values (case-sensitive):

    • Tomato
    • Bread
    • Plunger
    • Cup
    • Knife

    Note: Always leave variation=0.

  10. Access AI2-THOR documentation and resources

    main

    AI2-THOR provides specialized documentation for its different environments and development paths:

    • iTHOR Documentation: For the standard iTHOR environment.
    • ManipulaTHOR Documentation: For the ManipulaTHOR environment focused on object manipulation.
    • RoboTHOR Documentation: For the RoboTHOR environment.
    • AI2-THOR Colab: A repository to run AI2-THOR in the cloud via Google Colab.
    • AllenAct: An Embodied AI Framework that provides first-class support for AI2-THOR.
    • Unity Development: Notes for developers editing the AI2-THOR backend in Unity.
    • WebGL Development: Documentation for packaging AI2-THOR for the web (useful for annotation tasks).

    You can also interact with a live demo in your browser at the official AI2-THOR demo site.