Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case to verify getting attributes works #193

Merged
merged 5 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0f4ac2b7cec772b84421a5878a15b15d

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5e79f83f891f8357c2bcce6585177cfc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5e79f83f891f8357c2bcce6585177cfc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8869dd21295ee0ce7997530856a4ccd1

Large diffs are not rendered by default.

Git LFS file not shown

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"m_buildTarget":"StandaloneLinux64","m_SettingsHash":"9e657822b4417684a383df4b1a9268b6","m_CatalogLocations":[{"m_Keys":["AddressablesMainContentCatalogRemoteHash"],"m_InternalId":"{UnityEngine.AddressableAssets.Addressables.RuntimePath}/StandaloneLinux64/catalog_2024.12.02.19.53.16.hash","m_Provider":"UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider","m_Dependencies":[],"m_ResourceType":{"m_AssemblyName":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","m_ClassName":"System.String"},"SerializedData":[7,76,85,110,105,116,121,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,114,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,75,85,110,105,116,121,69,110,103,105,110,101,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,109,101,110,116,46,82,101,115,111,117,114,99,101,80,114,111,118,105,100,101,114,115,46,80,114,111,118,105,100,101,114,76,111,97,100,82,101,113,117,101,115,116,79,112,116,105,111,110,115,50,0,0,0,123,0,34,0,109,0,95,0,73,0,103,0,110,0,111,0,114,0,101,0,70,0,97,0,105,0,108,0,117,0,114,0,101,0,115,0,34,0,58,0,116,0,114,0,117,0,101,0,125,0]},{"m_Keys":["AddressablesMainContentCatalogCacheHash"],"m_InternalId":"{UnityEngine.Application.persistentDataPath}/com.unity.addressables/catalog_2024.12.02.19.53.16.hash","m_Provider":"UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider","m_Dependencies":[],"m_ResourceType":{"m_AssemblyName":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","m_ClassName":"System.String"},"SerializedData":[7,76,85,110,105,116,121,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,114,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,75,85,110,105,116,121,69,110,103,105,110,101,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,109,101,110,116,46,82,101,115,111,117,114,99,101,80,114,111,118,105,100,101,114,115,46,80,114,111,118,105,100,101,114,76,111,97,100,82,101,113,117,101,115,116,79,112,116,105,111,110,115,50,0,0,0,123,0,34,0,109,0,95,0,73,0,103,0,110,0,111,0,114,0,101,0,70,0,97,0,105,0,108,0,117,0,114,0,101,0,115,0,34,0,58,0,116,0,114,0,117,0,101,0,125,0]},{"m_Keys":["AddressablesMainContentCatalog"],"m_InternalId":"{UnityEngine.AddressableAssets.Addressables.RuntimePath}/catalog.json","m_Provider":"UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider","m_Dependencies":["AddressablesMainContentCatalogRemoteHash","AddressablesMainContentCatalogCacheHash"],"m_ResourceType":{"m_AssemblyName":"Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_ClassName":"UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData"},"SerializedData":[7,76,85,110,105,116,121,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,114,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,75,85,110,105,116,121,69,110,103,105,110,101,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,109,101,110,116,46,82,101,115,111,117,114,99,101,80,114,111,118,105,100,101,114,115,46,80,114,111,118,105,100,101,114,76,111,97,100,82,101,113,117,101,115,116,79,112,116,105,111,110,115,50,0,0,0,123,0,34,0,109,0,95,0,73,0,103,0,110,0,111,0,114,0,101,0,70,0,97,0,105,0,108,0,117,0,114,0,101,0,115,0,34,0,58,0,116,0,114,0,117,0,101,0,125,0]}],"m_ProfileEvents":false,"m_LogResourceManagerExceptions":true,"m_ExtraInitializationData":[],"m_DisableCatalogUpdateOnStart":false,"m_IsLocalCatalogInBundle":false,"m_CertificateHandlerType":{"m_AssemblyName":"","m_ClassName":""},"m_AddressablesVersion":"1.21.21","m_maxConcurrentWebRequests":500,"m_CatalogRequestsTimeout":0}
{"m_buildTarget":"StandaloneLinux64","m_SettingsHash":"c29247998f15cb584dcedbd6b7dbb10e","m_CatalogLocations":[{"m_Keys":["AddressablesMainContentCatalogRemoteHash"],"m_InternalId":"{UnityEngine.AddressableAssets.Addressables.RuntimePath}/StandaloneLinux64/catalog_2024.12.11.21.17.12.hash","m_Provider":"UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider","m_Dependencies":[],"m_ResourceType":{"m_AssemblyName":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","m_ClassName":"System.String"},"SerializedData":[7,76,85,110,105,116,121,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,114,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,75,85,110,105,116,121,69,110,103,105,110,101,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,109,101,110,116,46,82,101,115,111,117,114,99,101,80,114,111,118,105,100,101,114,115,46,80,114,111,118,105,100,101,114,76,111,97,100,82,101,113,117,101,115,116,79,112,116,105,111,110,115,50,0,0,0,123,0,34,0,109,0,95,0,73,0,103,0,110,0,111,0,114,0,101,0,70,0,97,0,105,0,108,0,117,0,114,0,101,0,115,0,34,0,58,0,116,0,114,0,117,0,101,0,125,0]},{"m_Keys":["AddressablesMainContentCatalogCacheHash"],"m_InternalId":"{UnityEngine.Application.persistentDataPath}/com.unity.addressables/catalog_2024.12.11.21.17.12.hash","m_Provider":"UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider","m_Dependencies":[],"m_ResourceType":{"m_AssemblyName":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","m_ClassName":"System.String"},"SerializedData":[7,76,85,110,105,116,121,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,114,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,75,85,110,105,116,121,69,110,103,105,110,101,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,109,101,110,116,46,82,101,115,111,117,114,99,101,80,114,111,118,105,100,101,114,115,46,80,114,111,118,105,100,101,114,76,111,97,100,82,101,113,117,101,115,116,79,112,116,105,111,110,115,50,0,0,0,123,0,34,0,109,0,95,0,73,0,103,0,110,0,111,0,114,0,101,0,70,0,97,0,105,0,108,0,117,0,114,0,101,0,115,0,34,0,58,0,116,0,114,0,117,0,101,0,125,0]},{"m_Keys":["AddressablesMainContentCatalog"],"m_InternalId":"{UnityEngine.AddressableAssets.Addressables.RuntimePath}/catalog.json","m_Provider":"UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider","m_Dependencies":["AddressablesMainContentCatalogRemoteHash","AddressablesMainContentCatalogCacheHash"],"m_ResourceType":{"m_AssemblyName":"Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_ClassName":"UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData"},"SerializedData":[7,76,85,110,105,116,121,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,114,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,75,85,110,105,116,121,69,110,103,105,110,101,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,109,101,110,116,46,82,101,115,111,117,114,99,101,80,114,111,118,105,100,101,114,115,46,80,114,111,118,105,100,101,114,76,111,97,100,82,101,113,117,101,115,116,79,112,116,105,111,110,115,50,0,0,0,123,0,34,0,109,0,95,0,73,0,103,0,110,0,111,0,114,0,101,0,70,0,97,0,105,0,108,0,117,0,114,0,101,0,115,0,34,0,58,0,116,0,114,0,117,0,101,0,125,0]}],"m_ProfileEvents":false,"m_LogResourceManagerExceptions":true,"m_ExtraInitializationData":[],"m_DisableCatalogUpdateOnStart":false,"m_IsLocalCatalogInBundle":false,"m_CertificateHandlerType":{"m_AssemblyName":"","m_ClassName":""},"m_AddressablesVersion":"1.21.21","m_maxConcurrentWebRequests":500,"m_CatalogRequestsTimeout":0}
2 changes: 1 addition & 1 deletion template/Bathing/BathingPlayer_Data/boot.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ wait-for-native-debugger=0
hdr-display-enabled=0
gc-max-time-slice=3
force-d3d11-bitblt-model=
build-guid=9f0f37de82dd4dc2becf90b3587d600f
build-guid=243e74699b9e4166a4265f3019aed64d
Binary file modified template/Bathing/BathingPlayer_Data/globalgamemanagers
Binary file not shown.
Binary file modified template/Bathing/BathingPlayer_Data/level0
Binary file not shown.
Binary file modified template/Bathing/BathingPlayer_Data/resources.assets
Binary file not shown.
Binary file modified template/Bathing/BathingPlayer_Data/sharedassets0.assets
Binary file not shown.
39 changes: 39 additions & 0 deletions tests/test_bathing_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,45 @@ def test_instance_camera(bathing_env: BathingEnv):
print(rgb.shape)
assert(rgb.shape[0] > 0)

def test_access_attrs(bathing_env: BathingEnv):
"""
Test that all of the following can be gotten without error:
# _gripper_id: int = 2215820
# _robot_id: int = 221582
# _camera_id: int = 654321
# _sponge_id: int = 91846
# _bed_id: int = 758554
# _drawer_id: int = 758666
# _person_id: int = 573920
# _randomizer_id: int = 777
"""

gripper = bathing_env.get_gripper()
robot = bathing_env.get_robot()
camera = bathing_env.get_camera()
sponge = bathing_env.get_sponge()
bed = bathing_env.GetAttr(758554)
drawer = bathing_env.GetAttr(758666)
person = bathing_env.GetAttr(573920)
person_randomizer = bathing_env.get_person_randomizer()

assert gripper
assert robot
assert camera
assert sponge
assert bed
assert drawer
assert person
assert person_randomizer

# Also test that the camera can be read from.
for _ in range(3):
camera.GetRGB(512, 512)
bathing_env.step()
rgb = np.frombuffer(camera.data["rgb"], dtype=np.uint8)
print(rgb.shape)
assert(rgb.shape[0] > 0)

def test_sponge_force():
"""
Test for the sponge force. Teleports the sponge to the right thigh and reads the force.
Expand Down
Loading