I believe ARCore only currently supports vertical and horizontal plane tracking at the moment.
There is an open GitHub FR to add support for general plane detection, but in the meantime you might have to analyse the point-cloud yourself and fit planes.
I suspect this would be expensive and/or noisy without filtering to cardinal directions, which would explain why it's not yet be implemented.
That said, if you know for sure the plane you're looking for will always be 30 degrees compared to the floor, you could probably do something similar.
You should be able to retrieve the point-cloud using the static property PointCloud
from the Frame
object. This is how ARInterface does it for ARCore:
public override bool TryGetPointCloud(ref PointCloud pointCloud)
{
if (Session.Status != SessionStatus.Tracking)
return false;
// Fill in the data to draw the point cloud.
m_TempPointCloud.Clear();
Frame.PointCloud.CopyPoints(m_TempPointCloud);
if (m_TempPointCloud.Count == 0)
return false;
if (pointCloud.points == null)
pointCloud.points = new List<Vector3>();
pointCloud.points.Clear();
foreach (Vector3 point in m_TempPointCloud)
pointCloud.points.Add(point);
return true;
}
(full source)
Now you've got the point cloud, you need to fit your planes to it. This tutorial might give you some insight into how to go about this, it covers basic plane-fitting via 3 points and more robust multi-point plane fitting using RANSAC. You might also like to look at this answer and this answer.