Search code examples
androidarcore

Android ArCore: PointCloud point coordinates relative to a floor plane?


When comparing a PointCloud point to a floor plane (user tapped on it to select it from the plane discovery controller), how do you calculate the height of the point from the floor plane?

The floor has a pose with a ty() that is the height distance from world coordinates, and the point cloud is supposedly in world coordinates, so is it as simple as (point.y - floor.pose.ty())? Or do you have to get the inverse transform from the floor.pose.inverse() and then transform the point to get it into floor coordinates before you do the y subtraction?


Solution

  • Compared results and yes you do have to transform the pointcloud point to floor plane coordinates before comparing distance...only thing I can think of is that sometimes ArCore thinks the floor plan is not parallel to world coordinates so it's actually at an angle so some of the distance comparisons are off...