Skip to content

Commit

Permalink
Merge nanna
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroHG committed Aug 18, 2022
2 parents 7c7741c + 7f79e43 commit d63f276
Show file tree
Hide file tree
Showing 310 changed files with 30,103 additions and 19,068 deletions.
6 changes: 6 additions & 0 deletions ai2thor/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,12 @@ def __init__(
DeprecationWarning,
)

if "agentControllerType" in self.initialization_parameters:
raise ValueError(
"`agentControllerType` is no longer an allowed initialization parameter."
" Use `agentMode` instead."
)

# Let's set the scene for them!
if scene is None:
scenes_in_build = self.scenes_in_build
Expand Down
45 changes: 22 additions & 23 deletions ai2thor/tests/test_unity.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# import pytest
import copy
import glob
import json
import os
import string
import random
import re
import copy
import json
import string
import time
import shutil

import pytest
import warnings

import jsonschema
import numpy as np
import pytest
from PIL import ImageChops, ImageFilter, Image

from ai2thor.controller import Controller
from ai2thor.build import TEST_OUTPUT_DIRECTORY
from ai2thor.tests.constants import TESTS_DATA_DIR, TEST_SCENE
Expand Down Expand Up @@ -65,7 +68,6 @@ def build_controller(**args):

_wsgi_controller = build_controller(server_class=WsgiServer)
_fifo_controller = build_controller(server_class=FifoServer)
_stochastic_controller = build_controller(agentControllerType="stochastic", agentMode="stochastic")


def skip_reset(controller):
Expand Down Expand Up @@ -101,10 +103,6 @@ def wsgi_controller():
return reset_controller(_wsgi_controller)


@pytest.fixture
def stochastic_controller():
return reset_controller(_stochastic_controller)


@pytest.fixture
def fifo_controller():
Expand All @@ -113,7 +111,6 @@ def fifo_controller():

fifo_wsgi = [_fifo_controller, _wsgi_controller]
fifo = [_fifo_controller]
fifo_wsgi_stoch = [_fifo_controller, _wsgi_controller, _stochastic_controller]

BASE_FP28_POSITION = dict(x=-1.5, z=-1.5, y=0.901,)
BASE_FP28_LOCATION = dict(
Expand All @@ -129,12 +126,12 @@ def teleport_to_base_location(controller: Controller):


def setup_function(function):
for c in fifo_wsgi_stoch:
for c in fifo_wsgi:
reset_controller(c)


def teardown_module(module):
for c in fifo_wsgi_stoch:
for c in fifo_wsgi:
c.stop()


Expand Down Expand Up @@ -212,16 +209,18 @@ def images_far(image1, image2, min_mean_pixel_diff=10):
return np.mean(np.abs(image1 - image2).flatten()) >= min_mean_pixel_diff


def test_stochastic_controller(stochastic_controller):
stochastic_controller.reset(TEST_SCENE)
assert stochastic_controller.last_event.metadata["lastActionSuccess"]
def test_agent_controller_type_no_longer_accepted(fifo_controller):
with pytest.raises(ValueError):
build_controller(
server_class=FifoServer,
agentControllerType="physics",
agentMode="default",
)

def test_stochastic_mismatch(fifo_controller):
try:
c = fifo_controller.reset(agentControllerType="stochastic", agentMode="default")
except RuntimeError as e:
error_message = str(e)
assert error_message and error_message.startswith("Invalid combination of agentControllerType=stochastic and agentMode=default")
# TODO: We should make ServerAction type actions fail when passed
# invalid arguments.
# with pytest.raises(Exception):
# fifo_controller.reset(agentControllerType="physics", agentMode="default")


# Issue #514 found that the thirdPartyCamera image code was causing multi-agents to end
Expand Down Expand Up @@ -414,7 +413,7 @@ def test_target_invocation_exception(controller):
], "errorMessage should not be empty when OpenObject(x > 1)."


@pytest.mark.parametrize("controller", fifo_wsgi_stoch)
@pytest.mark.parametrize("controller", fifo_wsgi)
def test_lookup(controller):

e = controller.step(dict(action="RotateLook", rotation=0, horizon=0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1535580852871982}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: 0, y: 0.5, z: 0, w: 0.8660254}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4813235644591848}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: 60, z: 0}
--- !u!33 &33239305448877584
MeshFilter:
m_ObjectHideFlags: 0
Expand All @@ -460,6 +460,7 @@ MeshRenderer:
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
Expand All @@ -484,6 +485,7 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &1541778761531560
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1179,14 +1181,14 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1929500409171200}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: 0, y: 0.5, z: 0, w: 0.8660254}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3872635461632317640}
m_Father: {fileID: 4053384041885298}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: 60, z: 0}
--- !u!33 &33705040564637236
MeshFilter:
m_ObjectHideFlags: 0
Expand All @@ -1210,6 +1212,7 @@ MeshRenderer:
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
Expand All @@ -1234,6 +1237,7 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &64223658091179340
MeshCollider:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1278,17 +1282,17 @@ PrefabInstance:
- target: {fileID: 7854311495974567868, guid: 441e6140366414031a8350c12f99deb9,
type: 3}
propertyPath: m_LocalPosition.x
value: -0.026725737
value: -0.023
objectReference: {fileID: 0}
- target: {fileID: 7854311495974567868, guid: 441e6140366414031a8350c12f99deb9,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.2879
value: 0.333
objectReference: {fileID: 0}
- target: {fileID: 7854311495974567868, guid: 441e6140366414031a8350c12f99deb9,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.0018902691
value: 0.005
objectReference: {fileID: 0}
- target: {fileID: 7854311495974567868, guid: 441e6140366414031a8350c12f99deb9,
type: 3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ Material:
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 0.75, y: 1.25}
m_Scale: {x: 1.5, y: 2.5}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 7dc937f9ade8842b7925339b306c1b3c, type: 3}
m_Scale: {x: 0.75, y: 1.25}
m_Scale: {x: 1.5, y: 2.5}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
Expand Down Expand Up @@ -75,3 +75,4 @@ Material:
m_Colors:
- _Color: {r: 0.8897059, g: 0.8897059, b: 0.8897059, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
Original file line number Diff line number Diff line change
Expand Up @@ -4,124 +4,75 @@
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: bathroomTilesPattern
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 2
serializedVersion: 3
m_TexEnvs:
- first:
name: _BumpMap
second:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Scale: {x: 7, y: 13}
m_Offset: {x: -0.02, y: 0.7}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 0a15556ffcdc94bdf9caf9a1ae534385, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Scale: {x: 7, y: 13}
m_Offset: {x: -0.02, y: 0.7}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.774
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.774
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
Loading

0 comments on commit d63f276

Please sign in to comment.