0

How to measure distance using ARCore?

I have seen this thread and still don't understand how or where to use the sample of code.

1 Answers1

0

I answered my own question buy doing this in the onDrawFrame() method

        anchors.add(hit.createAnchor());

          Pose pose1 = hit.getHitPose();
          Pose pose2 = hit.getHitPose();
          pose1 = anchors.get(0).getPose();
          pose2 = anchors.get(1).getPose();
          double distance = getDistance(pose1, pose2);
          String result = String.valueOf(distance);
          showResult(result);