SLAM in Unity
private void OnPointCloudChanged(ARPointCloudUpdatedEventArgs
eventArgs)
{
if ((pointCloud.positions.HasValue) &&
(
(
pointCloud.identifiers.HasValue) &&
pointCloud.confidenceValues.HasValue)){
NativeSlice<Vector3> positions = pointCloud.positions.Value;
NativeSlice<ulong> identifiers = pointCloud.identifiers.Value;
NativeSlice<float> confidence =
pointCloud.confidenceValues.Value;
if (positions.Length > 0)
{
logText.text = "Number of points: " + positions.Length +
"
\nFirst Point: x = " + positions[0].x + ", y = " +
positions[0].y + ", z = " + positions[0].z +
,\n Identifier = " + identifiers[0] + ", Confidence = " +
confidence[0];
"
}
}
}
}