diff --git a/Runtime/Scripts/WorldAnalysisARFoundationModule.cs b/Runtime/Scripts/WorldAnalysisARFoundationModule.cs index 4b9d7451782fd9382d271ed0f9280a20c4c8b260..70740465a1def6bfe12eaf378fd7fb85dc1507ff 100644 --- a/Runtime/Scripts/WorldAnalysisARFoundationModule.cs +++ b/Runtime/Scripts/WorldAnalysisARFoundationModule.cs @@ -30,13 +30,14 @@ public interface WorldAnalysisARFoundationModule public bool AddTrackable(ETSI.ARF.OpenAPI.WorldStorage.Trackable trackable); /// <summary> - /// + /// Get the pose of the trackable from its uuid /// </summary> - /// <param name="uuid"></param> + /// <param name="uuid">id of the trackable</param> + /// <returns>null or trackableInfo with last updated values</returns> public TrackableInfo GetPoseTrackable(Guid uuid); /// <summary> - /// Initialize capability object with the features of the + /// Initialize capability object with the features of the module /// </summary> public ETSI.ARF.OpenAPI.WorldAnalysis.Capability GetSupportedCapability(); diff --git a/Runtime/Scripts/WorldAnalysisARFoundationModuleARCoreAnchor.cs b/Runtime/Scripts/WorldAnalysisARFoundationModuleARCoreAnchor.cs index 69af489726a40c3e368d7a8dd6fe0abd3098d607..ff1c4c6f9619ebca6e90b6ebea9ccadb2480aeaa 100644 --- a/Runtime/Scripts/WorldAnalysisARFoundationModuleARCoreAnchor.cs +++ b/Runtime/Scripts/WorldAnalysisARFoundationModuleARCoreAnchor.cs @@ -74,9 +74,9 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda } /// <summary> - /// + /// Initialize capability object with the features of the arcore cloud anchor module /// </summary> - /// <returns></returns> + /// <returns>a Capability object</returns> public ETSI.ARF.OpenAPI.WorldAnalysis.Capability GetSupportedCapability() { ETSI.ARF.OpenAPI.WorldAnalysis.Capability capabilityARCoreAnchor = new ETSI.ARF.OpenAPI.WorldAnalysis.Capability(); @@ -92,7 +92,7 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda } /// <summary> - /// + /// Update arcore cloud anchors informations /// </summary> /// <param name="eventArgs"></param> private void OnTrackedCloudAnchorChanged(ARAnchorsChangedEventArgs eventArgs) @@ -140,10 +140,10 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda } /// <summary> - /// + /// Create a new ARCore Cloud anchor using ARCore API id /// </summary> /// <param name="trackable"></param> - private async void AddNewARCoreCloudAnchor(ETSI.ARF.OpenAPI.WorldStorage.Trackable trackable ) + private async void AddNewARCoreCloudAnchor(ETSI.ARF.OpenAPI.WorldStorage.Trackable trackable) { while (ARSession.state == ARSessionState.CheckingAvailability || ARSession.state == ARSessionState.None ||ARSession.state == ARSessionState.SessionInitializing) { @@ -172,7 +172,7 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda } /// <summary> - /// + /// Resolves cloud anchor promise /// </summary> /// <param name="promise"></param> /// <returns></returns> diff --git a/Runtime/Scripts/WorldAnalysisARFoundationModuleGeospatial.cs b/Runtime/Scripts/WorldAnalysisARFoundationModuleGeospatial.cs index d57391e0cb9d54ab695a37dba67d4848d0cc67a3..bd8e03431180bc31bf83d1e52b374cb425d67c5a 100644 --- a/Runtime/Scripts/WorldAnalysisARFoundationModuleGeospatial.cs +++ b/Runtime/Scripts/WorldAnalysisARFoundationModuleGeospatial.cs @@ -15,16 +15,26 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati /// </summary> private ARAnchorManager m_anchorManager; + /// <summary> + /// Earth manager + /// </summary> private AREarthManager m_arEarthManager; + /// <summary> + /// List of geospatial anchors with tracking infos + /// </summary> private Dictionary<string, TrackableInfo> m_trackedGeospatialAnchors = new Dictionary<string, TrackableInfo>(); - private bool geospatialSupported = true; - + /// <summary> /// Correspondance between local trackable and etsi uuid /// </summary> private Dictionary<string, string> m_localIdToEtsiId = new Dictionary<string, string>(); + /// <summary> + /// Check if ARCore Geospatial is supported on the device + /// </summary> + private bool geospatialSupported = true; + /// <summary> /// Initialize ARCore geospatial anchors tracking module /// </summary> @@ -43,10 +53,10 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati } /// <summary> - /// + /// Get the pose of the trackable from its uuid /// </summary> - /// <param name="uuid"></param> - /// <returns></returns> + /// <param name="uuid">id of the trackable</param> + /// <returns>null or trackableInfo with last updated values</returns> public TrackableInfo GetPoseTrackable(Guid uuid) { if (m_trackedGeospatialAnchors.ContainsKey(uuid.ToString())) @@ -60,10 +70,10 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati } /// <summary> - /// + /// Need to be a geopose /// </summary> /// <param name="trackable"></param> - /// <returns></returns> + /// <returns>geopose or not (does not check is solved)</returns> public bool AddTrackable(ETSI.ARF.OpenAPI.WorldStorage.Trackable trackable) { if (!geospatialSupported) return false; @@ -77,7 +87,30 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati return true; } + /// <summary> + /// Initialize capability object with the features of the geospatial module + /// </summary> + /// <returns>null if ARCore Geospatial is not supported on the device, or a Capability object</returns> + public ETSI.ARF.OpenAPI.WorldAnalysis.Capability GetSupportedCapability() + { + if (!geospatialSupported) return null; + ETSI.ARF.OpenAPI.WorldAnalysis.Capability capabilityGeospatialAnchor = new ETSI.ARF.OpenAPI.WorldAnalysis.Capability(); + capabilityGeospatialAnchor.TrackableType = ETSI.ARF.OpenAPI.WorldAnalysis.TrackableType.GEOPOSE; + ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructure encodingInformation = new ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructure(); + encodingInformation.DataFormat = ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructureDataFormat.ARCORE; + encodingInformation.Version = "1.01"; + capabilityGeospatialAnchor.EncodingInformation = encodingInformation; + capabilityGeospatialAnchor.Framerate = 30; // Not particularly specified on ARKit and ARCore + capabilityGeospatialAnchor.Latency = 0; // Not particularly specified on ARKit and ARCore + capabilityGeospatialAnchor.Accuracy = 1; // Not particularly specified on ARKit and ARCore + return capabilityGeospatialAnchor; + } + + /// <summary> + /// Creates a new ARCore Geospatial anchor using informations from a geopose trackable object + /// </summary> + /// <param name="trackable"></param> public async void CreateGeosptialAnchor(ETSI.ARF.OpenAPI.WorldStorage.Trackable trackable) { if (geospatialSupported) @@ -88,7 +121,6 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati } if (m_arEarthManager.IsGeospatialModeSupported(GeospatialMode.Enabled) != FeatureSupported.Supported) { - Debug.Log("Support : " + m_arEarthManager.IsGeospatialModeSupported(GeospatialMode.Enabled)); geospatialSupported = false; } else @@ -111,31 +143,10 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati } } - - /// <summary> - /// - /// </summary> - /// <returns></returns> - public ETSI.ARF.OpenAPI.WorldAnalysis.Capability GetSupportedCapability() //s'occuper de ça (fonction doc) - { - if (!geospatialSupported) return null; - - ETSI.ARF.OpenAPI.WorldAnalysis.Capability capabilityGeospatialAnchor = new ETSI.ARF.OpenAPI.WorldAnalysis.Capability(); - capabilityGeospatialAnchor.TrackableType = ETSI.ARF.OpenAPI.WorldAnalysis.TrackableType.GEOPOSE; - ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructure encodingInformation = new ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructure(); - encodingInformation.DataFormat = ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructureDataFormat.ARCORE; - encodingInformation.Version = "1.01"; - capabilityGeospatialAnchor.EncodingInformation = encodingInformation; - capabilityGeospatialAnchor.Framerate = 30; // Not particularly specified on ARKit and ARCore - capabilityGeospatialAnchor.Latency = 0; // Not particularly specified on ARKit and ARCore - capabilityGeospatialAnchor.Accuracy = 1; // Not particularly specified on ARKit and ARCore - return capabilityGeospatialAnchor; - } - /// <summary> - /// + /// Update geospatial anchors informations /// </summary> - /// <param name="eventArgs"></param> + /// <param name="eventArgs">Event arguments for the <see cref="ARAnchorManager.anchorsChanged"/> event</param> private void OnTrackedGeospatialAnchorChanged(ARAnchorsChangedEventArgs eventArgs) { foreach (var trackedGeospatialAnchor in eventArgs.updated) @@ -181,5 +192,4 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati } } } - #endif \ No newline at end of file