How can I restart WorldTracker in a ARSession

Hello, everyone!

I am creating an app to capture photos with depth and orientation information. For this purpose, I use ARKit and get the ARSession current frame every time the shutter button is pressed. I need to reset the world coordinate system every time a new photo is taken so that each photo will have a new world coordinate system. I have been using this code to do it:

    @objc func shutterButtonPressed() {
        self.shutterButton.isEnabled = false
        scnView.session.pause()
        scnView.scene.rootNode.enumerateChildNodes { (node, stop) in
                node.removeFromParentNode()
            }
        scnView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
        //sceneView.session.pause()
        var sampleFrame = scnView.session.currentFrame
        // so on...
        }
        
    }

The problem is that the world coordinate system is not reset. Could you help me to solve this problem? Thank you!

How can I restart WorldTracker in a ARSession
 
 
Q