Trajectory, Pose estimation

Is there a method to extract the iphone position and orientation? Or to get the trajectory of the iphone during the room scan?