Giter Club home page Giter Club logo

arkit-data-logger's Introduction

ARKit Data Logger

This is a simple application to capture ARKit motion estimation (Visual-Inertial Odometry) results on iOS devices for offline use. I want to play around with data from Apple's Visual-Inertial Odometry (VIO) solution with ARKit framework in Swift 5.0 for iPhone Xs.

ARKit Data Logger

For more details, see the ARKit documentation here.

Usage Notes

The txt files are produced automatically after pressing Stop button. This Xcode project is written under Xcode Version 10.2.1 (10E1001) for iOS 12.2. It doesn't currently check for sensor availability before logging.

Reference Frames and Device Attitude

In the global (inertial or reference) frame in ARKit, the Y-axis (up) matches the direction of gravity as detected by the device's motion sensing hardware; that is, the vector (0,-1,0) points downward. For the Z-axis, ARKit chooses a basis vector (0,0,-1) pointing in the direction the device camera faces and perpendicular to the gravity axis. ARKit chooses a X-axis based on the Z- and Y-axes using the right hand rule. The ARKit (camera) body frame's X-axis always points along the long axis of the device (down). Y-axis points right, and the Z-axis points out the front of the device (toward the user). For more details, see the ARConfiguration WorldAlignment documentation here and here.

Output Format

I have chosen the following output formats, but they are easy to modify if you find something else more convenient.

  • ARKit 6-DoF Camera Pose (ARKit_camera_pose.txt): timestamp, r_11, r_12, r_13, t_x, r_21, r_22, r_23, t_y, r_31, r_32, r_33, t_z \n
  • ARKit 3D Point Cloud (ARKit_point_cloud.txt): position_x, position_y, position_z, color_Y, color_Cb, color_Cr \n

Note that ARKit_camera_pose.txt contains a N x 12 table, where N is the number of frames of this sequence. Row i represents the i'th pose of the camera coordinate system via a 3x4 transformation matrix similar to KITTI dataset pose format. The matrices are stored in row aligned order (the first entries correspond to the first row), and take a point in the i'th coordinate system and project it into the first (=0th) coordinate system. Hence, the translational part (3x1 vector of column 4) corresponds to the pose of the camera coordinate system in the i'th frame with respect to the first (=0th) frame.

Offline Matlab Visualization

The ability to experiment with different algorithms to process the ARKit (VIO) motion estimation results is the reason that I created this project in the first place. I have included an example script that you can use to parse and visualize the data that comes from ARKit Data Logger. Look under the Visualization directory to check it out. You can run the script by typing the following in your terminal:

run main_script.m

Here's one of the figures produced by the Matlab script:

Data visualization

arkit-data-logger's People

Contributors

pyojinkim avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.