ARCloud Session
AR Cloud Session
script must be attached to the same object that has the AR Session Origin script.
AR Session Origin object's transform should not be modified. The reason is AR Cloud Session
provides a cloud anchor feature by changing AR Session Origin's transform to match the real-world coordinate.
ARCloudSession.instance.Init
Initialize gRPC and general component for ARCloudSession with credential
Declaration
public async Task Init(PositionGps referencePositionGps)
- referencePositionGps : GPS position information structure as follow
public struct PositionGps
{
public double Latitude;
public double Longitude;
public double Altitude;
}
ARCloudSession.instance.Init
Start localization process
Declaration
public void StartLocalize(LocalizeStrategy strategy)
- Strategies: Strategy of the localization Process. Default is
LAST_POINT_DIFF_MEDPRECISION
LAST_POINT_DIFF
LAST_POINT_DIFF_MEDPRECISION
LAST_POINT_DIFF_HIGHPRECISION
ARCloudSession.instance.CheckIsAreaAvailable
Check availability of Graffity service of the input location. Must use after AR Cloud Session
is initialized. The method calling emit exception which should be handled.
Declaration
public bool CheckIsAreaAvailable(PositionGps positionGps)
- referencePositionGps : GPS position information structure as follow
public struct PositionGps
{
public double Latitude;
public double Longitude;
public double Altitude;
}
Example
try
{
bool isAreaAvailable = ARCloudSession.instance.CheckIsAreaAvailable(
new PositionGps
{
Latitude = 13.729508407345941,
Longitude = 100.53591335616113,
Altitude = 0.0
});
Debug.Log($"Check Available Area success: {isAreaAvailable}");
}
catch (Exception e)
{
Debug.Log("Check Available Area fail");
}
ARCloudSession.instance.CheckIsAreaAvailableAsync
Async version of #ARCloudSession.instance.CheckIsAreaAvailable
.
Declaration
public async Task<bool> CheckIsAreaAvailableAsync(PositionGps positionGps)
- referencePositionGps : GPS position information structure as follow
public struct PositionGps
{
public double Latitude;
public double Longitude;
public double Altitude;
}
Example
try
{
bool isAreaAvailable = await ARCloudSession.instance.CheckIsAreaAvailableAsync(
new PositionGps
{
Latitude = 13.729508407345941,
Longitude = 100.53591335616113,
Altitude = 0.0
});
Debug.Log($"Check Available Area success: {isAreaAvailable}");
}
catch (Exception e)
{
Debug.Log("Check Available Area fail");
}