Skip to content
Snippets Groups Projects
Commit 08b37b47 authored by Sylvain Buche's avatar Sylvain Buche
Browse files

Add documentation comments for Geospatial and ARCore Cloud Anchors modules

parent 4c4c84e3
No related branches found
No related tags found
1 merge request!2WA now supports multiple trackable modules, add module mesh for iOS,...
...@@ -30,13 +30,14 @@ public interface WorldAnalysisARFoundationModule ...@@ -30,13 +30,14 @@ public interface WorldAnalysisARFoundationModule
public bool AddTrackable(ETSI.ARF.OpenAPI.WorldStorage.Trackable trackable); public bool AddTrackable(ETSI.ARF.OpenAPI.WorldStorage.Trackable trackable);
/// <summary> /// <summary>
/// /// Get the pose of the trackable from its uuid
/// </summary> /// </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); public TrackableInfo GetPoseTrackable(Guid uuid);
/// <summary> /// <summary>
/// Initialize capability object with the features of the /// Initialize capability object with the features of the module
/// </summary> /// </summary>
public ETSI.ARF.OpenAPI.WorldAnalysis.Capability GetSupportedCapability(); public ETSI.ARF.OpenAPI.WorldAnalysis.Capability GetSupportedCapability();
......
...@@ -74,9 +74,9 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda ...@@ -74,9 +74,9 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda
} }
/// <summary> /// <summary>
/// /// Initialize capability object with the features of the arcore cloud anchor module
/// </summary> /// </summary>
/// <returns></returns> /// <returns>a Capability object</returns>
public ETSI.ARF.OpenAPI.WorldAnalysis.Capability GetSupportedCapability() public ETSI.ARF.OpenAPI.WorldAnalysis.Capability GetSupportedCapability()
{ {
ETSI.ARF.OpenAPI.WorldAnalysis.Capability capabilityARCoreAnchor = new ETSI.ARF.OpenAPI.WorldAnalysis.Capability(); ETSI.ARF.OpenAPI.WorldAnalysis.Capability capabilityARCoreAnchor = new ETSI.ARF.OpenAPI.WorldAnalysis.Capability();
...@@ -92,7 +92,7 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda ...@@ -92,7 +92,7 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda
} }
/// <summary> /// <summary>
/// /// Update arcore cloud anchors informations
/// </summary> /// </summary>
/// <param name="eventArgs"></param> /// <param name="eventArgs"></param>
private void OnTrackedCloudAnchorChanged(ARAnchorsChangedEventArgs eventArgs) private void OnTrackedCloudAnchorChanged(ARAnchorsChangedEventArgs eventArgs)
...@@ -140,10 +140,10 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda ...@@ -140,10 +140,10 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda
} }
/// <summary> /// <summary>
/// /// Create a new ARCore Cloud anchor using ARCore API id
/// </summary> /// </summary>
/// <param name="trackable"></param> /// <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) while (ARSession.state == ARSessionState.CheckingAvailability || ARSession.state == ARSessionState.None ||ARSession.state == ARSessionState.SessionInitializing)
{ {
...@@ -172,7 +172,7 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda ...@@ -172,7 +172,7 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda
} }
/// <summary> /// <summary>
/// /// Resolves cloud anchor promise
/// </summary> /// </summary>
/// <param name="promise"></param> /// <param name="promise"></param>
/// <returns></returns> /// <returns></returns>
......
...@@ -15,16 +15,26 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati ...@@ -15,16 +15,26 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati
/// </summary> /// </summary>
private ARAnchorManager m_anchorManager; private ARAnchorManager m_anchorManager;
/// <summary>
/// Earth manager
/// </summary>
private AREarthManager m_arEarthManager; private AREarthManager m_arEarthManager;
/// <summary>
/// List of geospatial anchors with tracking infos
/// </summary>
private Dictionary<string, TrackableInfo> m_trackedGeospatialAnchors = new Dictionary<string, TrackableInfo>(); private Dictionary<string, TrackableInfo> m_trackedGeospatialAnchors = new Dictionary<string, TrackableInfo>();
private bool geospatialSupported = true; /// <summary>
/// Correspondance between local trackable and etsi uuid /// Correspondance between local trackable and etsi uuid
/// </summary> /// </summary>
private Dictionary<string, string> m_localIdToEtsiId = new Dictionary<string, string>(); 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> /// <summary>
/// Initialize ARCore geospatial anchors tracking module /// Initialize ARCore geospatial anchors tracking module
/// </summary> /// </summary>
...@@ -43,10 +53,10 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati ...@@ -43,10 +53,10 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati
} }
/// <summary> /// <summary>
/// /// Get the pose of the trackable from its uuid
/// </summary> /// </summary>
/// <param name="uuid"></param> /// <param name="uuid">id of the trackable</param>
/// <returns></returns> /// <returns>null or trackableInfo with last updated values</returns>
public TrackableInfo GetPoseTrackable(Guid uuid) public TrackableInfo GetPoseTrackable(Guid uuid)
{ {
if (m_trackedGeospatialAnchors.ContainsKey(uuid.ToString())) if (m_trackedGeospatialAnchors.ContainsKey(uuid.ToString()))
...@@ -60,10 +70,10 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati ...@@ -60,10 +70,10 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati
} }
/// <summary> /// <summary>
/// /// Need to be a geopose
/// </summary> /// </summary>
/// <param name="trackable"></param> /// <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) public bool AddTrackable(ETSI.ARF.OpenAPI.WorldStorage.Trackable trackable)
{ {
if (!geospatialSupported) return false; if (!geospatialSupported) return false;
...@@ -77,7 +87,30 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati ...@@ -77,7 +87,30 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati
return true; 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) public async void CreateGeosptialAnchor(ETSI.ARF.OpenAPI.WorldStorage.Trackable trackable)
{ {
if (geospatialSupported) if (geospatialSupported)
...@@ -88,7 +121,6 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati ...@@ -88,7 +121,6 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati
} }
if (m_arEarthManager.IsGeospatialModeSupported(GeospatialMode.Enabled) != FeatureSupported.Supported) if (m_arEarthManager.IsGeospatialModeSupported(GeospatialMode.Enabled) != FeatureSupported.Supported)
{ {
Debug.Log("Support : " + m_arEarthManager.IsGeospatialModeSupported(GeospatialMode.Enabled));
geospatialSupported = false; geospatialSupported = false;
} }
else else
...@@ -111,31 +143,10 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati ...@@ -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> /// <summary>
/// /// Update geospatial anchors informations
/// </summary> /// </summary>
/// <param name="eventArgs"></param> /// <param name="eventArgs">Event arguments for the <see cref="ARAnchorManager.anchorsChanged"/> event</param>
private void OnTrackedGeospatialAnchorChanged(ARAnchorsChangedEventArgs eventArgs) private void OnTrackedGeospatialAnchorChanged(ARAnchorsChangedEventArgs eventArgs)
{ {
foreach (var trackedGeospatialAnchor in eventArgs.updated) foreach (var trackedGeospatialAnchor in eventArgs.updated)
...@@ -181,5 +192,4 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati ...@@ -181,5 +192,4 @@ public class WorldAnalysisARFoundationModuleGeospatial : WorldAnalysisARFoundati
} }
} }
} }
#endif #endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment