title: ARKit Continuously get Camera Real World Position
body: <p>This is the first time I am creating an ARKit app, and also not very familiar with iOS development, however I am trying to achieve something relitively simple...</p>
  
  <p>All the the app needs to do is get the world position of the phone and send it continously to a rest api.</p>
  
  <p>I am using the default ARKit project in Xcode, and am able to get the phone's position with the following function in ViewController.swift:</p>
  
  <pre><code>func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) {
  
          if let planeAnchor = anchor as? ARPlaneAnchor {
  
              let plane = SCNPlane(width: CGFloat(planeAnchor.extent.x), height: CGFloat(planeAnchor.extent.z))
              plane.firstMaterial?.diffuse.contents = UIColor(white: 1, alpha: 0.75)
  
              let planeNode = SCNNode(geometry: plane)
              planeNode.position = SCNVector3Make(planeAnchor.center.x, planeAnchor.center.x, planeAnchor.center.z)
              planeNode.eulerAngles.x = -.pi / 2
  
              node.addChildNode(planeNode)
          }
  
  
          guard let pointOfView = sceneView.pointOfView else { return }
          let transform = pointOfView.transform
          let orientation = SCNVector3(-transform.m31, -transform.m32, transform.m33)
          let location = SCNVector3(transform.m41, transform.m42, transform.m43)
          let currentPositionOfCamera = SCNVector3(orientation.x + location.x, orientation.y + location.y, orientation.z + location.z)
          print(currentPositionOfCamera)
  
  
      }
  </code></pre>
  
  <p>this function works as expected, in renders a plane in the view and prints the position, <strong>but only once</strong></p>
  
  <p>I need to get the phone's position as it is moved, I tried to add:
  updateAtTime time: NSTimeInterval
  to the function definition, but after doing this even the plane was not rendered any longer.</p>
  
  <p>How can I continuously get the phone's position vector?</p>
  
  <p>TIA</p>