ARKit: Is there a refined historical camera trajectory available after world mapping?

Hi,

I'm building an iOS LiDAR scanning app using ARWorldTrackingConfiguration with sceneReconstruction = .mesh.

During scanning I save the RGB image, ARFrame.camera.transform, intrinsics and per-frame scene depth. At the end of the scan I also have the final ARMeshAnchor mesh.

When I place the saved depth observations into the ARSession world using their original ARCamera.transform, they broadly form the same scene, but over a longer walk I can see several-centimetre discrepancies between observations of the same surfaces.

My question is very specific:

After ARKit has built its world map / reconstructed the environment, is there any public API that provides a globally refined or corrected historical pose for previously captured ARFrames, rather than the original ARCamera.transform recorded at each frame?

In other words, is there an API or ARKit data structure from which I can obtain something equivalent to:

frame timestamp → refined world-space camera transform

after the session has accumulated more information?

I am aware of ARWorldMap and worldMappingStatus, but I'm unclear whether the world map contains information that can be used to recover or refine the historical camera trajectory, or whether ARCamera.transform is the only historical pose available to an app.

I'm not looking for advice on implementing ICP or my own SLAM/registration. I just want to know whether ARKit already exposes a refined trajectory or the underlying information needed to obtain one.

Thanks.

Consider creating an ARAnchor at each frame.camera.transform during scanning, rather than relying on a raw transform. By backing placed content with an ARAnchor, ARKit will automatically update its transform as world map refinements and loop closures occur. If an object is placed using only a fixed transform, it won't benefit from these refinements and may appear to drift.

Thanks, that is helpful. I just want to clarify one point so I understand the API correctly.

If I create an ARAnchor using each frame's ARCamera.transform:

let anchor = ARAnchor(transform: frame.camera.transform)
session.add(anchor)

is it correct that:

  1. The anchor initially represents the camera's world-space position and orientation at that frame; and
  2. If ARKit subsequently performs world-map refinement or loop closure, ARKit may change that anchor's transform, effectively giving me a refined historical camera pose; and
  3. There is no separate public API that lets me request the refined historical ARCamera.transform directly — using an ARAnchor in this way is the mechanism available to an app if it needs access to those refined poses?

In other words, is the ARAnchor.transform after refinement effectively the public API for retrieving ARKit's updated version of that historical camera pose?

Thanks — I just want to make sure I have understood your recommendation correctly.

Just an update. I just tried the as an experiment and the camera-pose ARAnchors were not refined. So basically they stayed the same as the original camera poses. Am I missing something? Are you confident that this approach should work? Thanks

Hello JT3D,

your understanding is basically correct. However, conceptually it's worth differentiating that ARAnchor transforms denote a position in world space, i.e., virtual content should stay pinned to the same real-world spot.

Refinement corrects the whole coordinate frame, not one historical moment. Loop closure and world-map optimization adjust the estimated relationship between features and the world origin. ARKit propagates those corrections into all affected anchors so they remain consistent with the newly refined map. So anchors reflect "where this point in the world is, given our best current understanding," which is more like a present-tense estimate rather than a reconstruction of a trajectory.

Thanks for the reply. So based on what you are saying if we add an ARAnchor for a camera pose position and then later ARKit refines using Loop closure & word map optimisation, will this refinement adjust the original value of the ARAnchor or not? What I am seeing is that the value is not changing. Is this correct behaviour or not? Thanks

Yes, the world map is being optimized automatically under the hood without explicit anchor update notifications.

ARKit: Is there a refined historical camera trajectory available after world mapping?
 
 
Q