MARS Logger records synchronized camera, ARKit pose, camera calibration, and
Core Motion data on an iPhone. The primary MarsLogger target is now a native
SwiftUI application built around one authoritative ARSession.
The repository now has one application target: the native Swift/ARKit
MarsLogger app. The retired CPU, Core Image, OpenCV, and Objective-C
RosyWriter paths are available in repository history if a comparison is needed.
Each capture is stored under Documents/MarsLogger/<ISO-8601 timestamp>/:
camera.mov H.264 frames sourced from ARFrame.capturedImage
frames.csv pose, intrinsics, resolution, tracking state, and timestamps
imu.csv acceleration, rotation rate, gravity, attitude, and timestamps
ARKit frame timestamps and Core Motion timestamps both use device-uptime clock semantics. Each CSV also includes an estimated Unix timestamp using the boot-time offset measured when the writer is created.
The Swift migration does not run an AVCaptureSession beside ARKit. ARKit owns
the camera, and video is encoded directly from each ARFrame.capturedImage.
That keeps image, camera transform, intrinsics, tracking state, and frame time
attached to the same source frame while avoiding camera-session contention.
Requirements:
- Xcode 16 or later
- iOS 15 or later
- A physical ARKit-capable iPhone or iPad
Open MarsLogger.xcodeproj, select the MarsLogger scheme, choose your
development team and a physical device, then run.
- Grant camera and motion permission.
- Wait for tracking state to become
normal. - Tap Record.
- Move through the capture area.
- Tap Stop.
- Tap Share Last Capture to export the video and both CSV files.
- Matrices are written in the column-major order returned by simd/ARKit.
- Translation is in meters in ARKit's right-handed world coordinate system.
- Rotation rate is radians per second.
- User acceleration and gravity use Core Motion's
gunits. - Locale-independent decimal formatting is used.
- Tracking limitations are recorded explicitly instead of silently dropping frames.
Captures remain in the app's Documents directory until the user exports or deletes them. The application contains no account, analytics, network upload, or background transmission path.
GPL-3.0. See LICENSE and the original Apple sample terms in LICENSE.txt.