From 0c2943143e5752bc8f00e96d64b5c6471d128cf3 Mon Sep 17 00:00:00 2001 From: jlacoche <jeremy.lacoche@orange.com> Date: Tue, 25 Jun 2024 13:54:03 +0200 Subject: [PATCH] Update readme, update factory with local_arfoundation name instead of just local, add hhi server --- Assets/Resources/HHIServer.asset | 19 ++++++ Assets/Resources/HHIServer.asset.meta | 8 +++ Assets/Resources/localhost.asset | 19 ++++++ Assets/Resources/localhost.asset.meta | 8 +++ Assets/Scenes/ExampleServerMaintenance.unity | 66 +++++++++++++------ Assets/Scripts/WorldAnalysisFactory.cs | 4 +- ...orld-analysis-arfoundation-wrapper-package | 2 +- README.md | 18 ++++- 8 files changed, 120 insertions(+), 24 deletions(-) create mode 100644 Assets/Resources/HHIServer.asset create mode 100644 Assets/Resources/HHIServer.asset.meta create mode 100644 Assets/Resources/localhost.asset create mode 100644 Assets/Resources/localhost.asset.meta diff --git a/Assets/Resources/HHIServer.asset b/Assets/Resources/HHIServer.asset new file mode 100644 index 0000000..f60af36 --- /dev/null +++ b/Assets/Resources/HHIServer.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e4b7be4c33f68d0418c3b4e1a7053d91, type: 3} + m_Name: HHIServer + m_EditorClassIdentifier: + serverName: HHI + company: HHI + basePath: https://etsi.hhi.fraunhofer.de + port: 443 + currentUser: {fileID: 11400000, guid: 220ed7f6ba8f6404e8bee0e9057e2ffd, type: 2} diff --git a/Assets/Resources/HHIServer.asset.meta b/Assets/Resources/HHIServer.asset.meta new file mode 100644 index 0000000..50ab2fc --- /dev/null +++ b/Assets/Resources/HHIServer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c1d7543b3d89e1543a49016de1a81d8f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/localhost.asset b/Assets/Resources/localhost.asset new file mode 100644 index 0000000..5bdc0b8 --- /dev/null +++ b/Assets/Resources/localhost.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e4b7be4c33f68d0418c3b4e1a7053d91, type: 3} + m_Name: localhost + m_EditorClassIdentifier: + serverName: localhost + company: + basePath: http://localhost + port: 8888 + currentUser: {fileID: 11400000, guid: 220ed7f6ba8f6404e8bee0e9057e2ffd, type: 2} diff --git a/Assets/Resources/localhost.asset.meta b/Assets/Resources/localhost.asset.meta new file mode 100644 index 0000000..7ee2357 --- /dev/null +++ b/Assets/Resources/localhost.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d247b856d3b63a449bbf946eae403a98 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/ExampleServerMaintenance.unity b/Assets/Scenes/ExampleServerMaintenance.unity index 76c06e1..747d09a 100644 --- a/Assets/Scenes/ExampleServerMaintenance.unity +++ b/Assets/Scenes/ExampleServerMaintenance.unity @@ -38,7 +38,6 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -104,7 +103,7 @@ NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -117,7 +116,7 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 maxJobWorkers: 0 preserveTilesOutsideBounds: 0 debug: @@ -151,13 +150,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 13101072} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 789254998} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &13101074 MonoBehaviour: @@ -260,7 +259,6 @@ MonoBehaviour: m_Interactions: m_SingletonActionBindings: [] m_Flags: 0 - m_HasMigratedActions: 1 --- !u!114 &13101075 MonoBehaviour: m_ObjectHideFlags: 0 @@ -315,9 +313,17 @@ Camera: m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -373,13 +379,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 221176651} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 925320705} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &221176653 MonoBehaviour: @@ -423,7 +429,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 02da7adcc65f4694684d71e61d88070b, type: 3} m_Name: m_EditorClassIdentifier: - worldStorageServer: {fileID: 11400000, guid: cc5c5acfb44773a4ba9decc291b718d2, type: 2} + worldStorageServer: {fileID: 11400000, guid: d247b856d3b63a449bbf946eae403a98, type: 2} --- !u!4 &236535456 Transform: m_ObjectHideFlags: 0 @@ -431,13 +437,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 236535454} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 925320705} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &239863669 GameObject: @@ -470,7 +476,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 536335897} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -652,6 +657,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 334744955} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -659,7 +665,6 @@ Transform: m_Children: - {fileID: 789254998} m_Father: {fileID: 0} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &536335896 GameObject: @@ -685,6 +690,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 536335896} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0.15, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -694,7 +700,6 @@ Transform: - {fileID: 201947612} - {fileID: 1465986225} m_Father: {fileID: 1236265746} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &536335898 MonoBehaviour: @@ -708,7 +713,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: bf6020f04d76d124a8056e1ca114fb3b, type: 3} m_Name: m_EditorClassIdentifier: - _ARFNodeUUID: + _ARFNodeUUID: 6ca20738-d1dd-4210-9983-eda9f150bea7 _ValiditySubscription: 100000 --- !u!1 &789254997 GameObject: @@ -733,6 +738,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 789254997} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -740,7 +746,6 @@ Transform: m_Children: - {fileID: 13101073} m_Father: {fileID: 334744957} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &925320704 GameObject: @@ -765,6 +770,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 925320704} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -773,7 +779,6 @@ Transform: - {fileID: 221176652} - {fileID: 236535456} m_Father: {fileID: 0} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1210990015 GameObject: @@ -827,13 +832,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1210990015} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1236265745 GameObject: @@ -858,6 +863,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1236265745} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -865,7 +871,6 @@ Transform: m_Children: - {fileID: 536335897} m_Father: {fileID: 0} - m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1405320275 GameObject: @@ -937,13 +942,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1405320275} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1465986224 GameObject: @@ -971,13 +976,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1465986224} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0.6, z: 0.25} m_LocalScale: {x: 0.8, y: 1.5, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 536335897} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &1465986226 BoxCollider: @@ -987,9 +992,17 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1465986224} m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 m_IsTrigger: 0 + m_ProvidesContacts: 0 m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} --- !u!23 &1465986227 @@ -1047,6 +1060,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 536335897} m_Modifications: - target: {fileID: 5799561996261335259, guid: b69957b197a55024f8014f6751c0a7a9, type: 3} @@ -1110,4 +1124,16 @@ PrefabInstance: value: WireCube objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: b69957b197a55024f8014f6751c0a7a9, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1210990018} + - {fileID: 334744957} + - {fileID: 1405320278} + - {fileID: 925320705} + - {fileID: 1236265746} diff --git a/Assets/Scripts/WorldAnalysisFactory.cs b/Assets/Scripts/WorldAnalysisFactory.cs index 4f795ee..7cd80fe 100644 --- a/Assets/Scripts/WorldAnalysisFactory.cs +++ b/Assets/Scripts/WorldAnalysisFactory.cs @@ -8,13 +8,13 @@ public class WorldAnalysisFactory [System.Serializable] public enum WorldAnalysisType { - LOCAL, + LOCAL_ARFOUNDATION, REST } public static WorldAnalysisInterface CreateWorldAnalysis(WorldAnalysisType type, GameObject obj) { - if (type == WorldAnalysisType.LOCAL) + if (type == WorldAnalysisType.LOCAL_ARFOUNDATION) { return obj.AddComponent<WorldAnalysisARFoundation>(); } diff --git a/Packages/unity-world-analysis-arfoundation-wrapper-package b/Packages/unity-world-analysis-arfoundation-wrapper-package index 933e9f8..af6828c 160000 --- a/Packages/unity-world-analysis-arfoundation-wrapper-package +++ b/Packages/unity-world-analysis-arfoundation-wrapper-package @@ -1 +1 @@ -Subproject commit 933e9f8d9e4f288cc248b78bf90a06b407bd6bf2 +Subproject commit af6828c50e1f75316a4297ed60d6eeb90af0875d diff --git a/README.md b/README.md index ffabe3d..8a96da5 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,22 @@ or clone the repos updating the submodules directly: Once it's done, you can open your project from the Unity Hub, the project was developed with Unity 2021.3 -## Test Scene +## World Analysis + +The WA is responsible to compute the poses of the AR Scene nodes in reference to the real world at runtime. + +Two types of WA are available. +* LOCAL_ARFOUNDATION corresponds to WA that runs locally based on Unity ARFoundation (ARKit on iOS and ARCore on Android) +* REST corresponds to a remote WA (HHI or b<>com SolAR solution for instance). + +To choose a given one use the WorldAnalysisInstance script on the ARFWorldAnalysis GameObject. + +For a local WA, the information about the WS to retrieve Relocalization Information in a WorldStorageServer ScriptableObject assigned to the WorldStorageInfo script on the ARFWorldStorageInfo GameObject. This ScriptableObject specifies the URL of the WS server. + +A GameObject of the Unity Scene graph can be associated with a node (Trackable or WorldAnchor) of the World Storage with the AnchorTrackableReferenceNode script. You just have to associate the script with a given GameObject and specify the WS uuid of the corresponding Trackable or WorldAnchor. + + +## Test Scene glTF This repo is used to demonstrate and to show the usage of the different World Analysis wrappers. @@ -38,3 +53,4 @@ A First Unity Scene can be found here: The scene loads a GLTF file situated in the Unity persistent data path (streaming assets path in editor mode). Any node with the following pattern name: ws:"uuid" will correspond to an Anchor or Trackable in the World Storage and then will be updated by the loaded World Analysis wrapper. +# \ No newline at end of file -- GitLab