allenai / ai2thor

An open-source platform for Visual AI.
http://ai2thor.allenai.org
Apache License 2.0
1.09k stars 210 forks source link

Adds LightManager Actions and Classes #1134

Closed winthos closed 2 months ago

winthos commented 1 year ago
event = controller.step(action="GetLights")
event.metadata["actionReturn"]

Here is an example of a scene's light parameters returned via the GetLights action:

  {
    "id": "scene|Spot|0",
    "type": "Spot",
    "position": {
      "x": 0.029,
      "y": 2.489,
      "z": -1.734
    },
    "rotation": {
      "axis": {
        "x": 1.00000012,
        "y": 0.0,
        "z": 0.0
      },
      "degrees": 89.99999,
      "x": null,
      "y": null,
      "z": null
    },
    "enabled": true,
    "controllerSimObjIds": [
      "LightSwitch|+02.33|+01.31|-00.16"
    ],
    "parentSimObjObjectId": null,
    "spotAngle": 85.3615952,
    "intensity": 1.37,
    "range": 6.62,
    "rgb": {
      "r": 1.0,
      "g": 0.9133874,
      "b": 0.5514706,
      "a": 1.0
    },
    "indirectMultiplier": 1.0,
    "cullingMaskOff": [],
    "shadow": {
      "type": "Hard",
      "strength": 1.0,
      "normalBias": 0.4,
      "bias": 0.05,
      "nearPlane": 0.2,
      "resolution": "FromQualitySettings"
    }
  },
  {
    "id": "scene|Point|0",
    "type": "Point",
    "position": {
      "x": 0.852,
      "y": 1.091,
      "z": -0.891
    },
    "rotation": {
      "axis": {
        "x": 1.0,
        "y": 0.0,
        "z": 0.0
      },
      "degrees": 0.0,
      "x": null,
      "y": null,
      "z": null
    },
    "enabled": true,
    "controllerSimObjIds": null,
    "parentSimObjObjectId": null,
    "spotAngle": 0.0,
    "intensity": 0.66,
    "range": 3.0,
    "rgb": {
      "r": 0.75,
      "g": 0.9068965,
      "b": 1.0,
      "a": 1.0
    },
    "indirectMultiplier": 1.0,
    "cullingMaskOff": [],
    "shadow": {
      "type": "None",
      "strength": 1.0,
      "normalBias": 0.4,
      "bias": 0.05,
      "nearPlane": 0.2,
      "resolution": "FromQualitySettings"
    }
  },
  {
    "id": "scene|Spot|1",
    "type": "Spot",
    "position": {
      "x": 0.599999964,
      "y": 2.349,
      "z": -1.58099985
    },
    "rotation": {
      "axis": {
        "x": 1.00000012,
        "y": 0.0,
        "z": 0.0
      },
      "degrees": 89.99999,
      "x": null,
      "y": null,
      "z": null
    },
    "enabled": true,
    "controllerSimObjIds": [
      "LightSwitch|+02.33|+01.31|-00.16"
    ],
    "parentSimObjObjectId": null,
    "spotAngle": 74.0,
    "intensity": 1.0,
    "range": 5.0,
    "rgb": {
      "r": 1.0,
      "g": 0.910344839,
      "b": 0.75,
      "a": 1.0
    },
    "indirectMultiplier": 1.0,
    "cullingMaskOff": [],
    "shadow": {
      "type": "None",
      "strength": 1.0,
      "normalBias": 0.4,
      "bias": 0.05,
      "nearPlane": 0.2,
      "resolution": "FromQualitySettings"
    }
  }

Details of each LightParameter member

//light objects not associated with a sim object
scene|<Light Type>|<Light Instance>

//light objects that are children of some sim object
<SimObject.name>|<Light Type>|<Light Instance>
winthos commented 1 year ago

@mattdeitke I believe with the new syntax for light object naming, and the expanded LightParameters class, we may need to do something to update the ProcTHOR scenes right?

Lucaweihs commented 2 months ago

Closing this for now, may come back to it in the future.