Commit 08b37b47 authored by Sylvain Buche's avatar Sylvain Buche
Browse files

Add documentation comments for Geospatial and ARCore Cloud Anchors modules

parent 4c4c84e3
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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();

+6 −6
Original line number Diff line number Diff line
@@ -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,7 +140,7 @@ 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)
@@ -172,7 +172,7 @@ public class WorldAnalysisARFoundationModuleARCoreAnchor : WorldAnalysisARFounda
    }

    /// <summary>
    /// 
    /// Resolves cloud anchor promise
    /// </summary>
    /// <param name="promise"></param>
    /// <returns></returns>
+42 −32
Original line number Diff line number Diff line
@@ -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