Giter Club home page Giter Club logo

motioncollector's Introduction

CI COV Swift License: MIT

About MotionCollector

This simple application records values coming from an iOS device's CoreMotion sensors (accelerometer, gyroscope, and magnetometer) and makes them available in a CSV formatted file in iCloud or iTunes (RIP). My goal in creating this app was to allow for quick data collection while moving with the device. After collection, the data would be processed with Apple's CoreML application for learning and (hopefully) future categorization of activity based on sensor data.

The code works with Xcode 11 and Swift 5. Should work without problems with earlier versions, but the current storyboard layout uses iOS 13 features. There would be minimal adjustments to make it work on older iOS versions.

Using

There are three views in this app:

  1. Main recording view with a Start/Stop button and movement buttons.
  2. Recording history list that shows active and past event recordings. Swipe on a row to (re)upload, share, or delete the recording.
  3. Settings view reachable from the main recording view via the gear icon.

Press Start to begin a new recording of sensor data. Move around.

When done, press Stop to quit data collect. If iCloud is enabled for the device, the app will attempt to copy the file to your iCloud Drive, in a folder called MotionCollector.

Each recording fie is named with the date/time when the recording started. They all have the suffix .csv so you should be able to open them in whatever editor or spreadsheet application you wish.

Drag right on a recording to see controls for uploading and sharing the recorded values as a CSV file. Drag left to reveal a trash can to touch to remove the recording.

Configuration

You can control which components are samples for data capture, the rate of data capture, and if the files are stored in an iCloud folder.

Data File Format

The file consists of lines of comma-separated values (CSV). The first line contains column labels for the rest of the rows.

  • Source -- indicates which sensor emitted the data.
  • A = accelerometer
  • D = device motion
  • G = gyroscope
  • M = magnetometer (compass)
  • Label -- indicates the current user activity, W = walking, T = turning
  • When -- timestamp of the record. These are given as number of seconds since 00:00:00 UTC 1 January, 1970 or the Unix epoch, though the resolution of the values is much finer than a second.

All sensors emit at minimum three values, one for each of the 3 axis that define the orientation of the device in the real world.

  • X -- X axis sensor value
  • Y -- Y axis sensor value
  • Z -- Z axis sensor value

For the device motion records (Source == 'D'), there are 9 values instead of 3.

  • X -- X axis rotation rate
  • Y -- Y axis rotation rate
  • Z -- Z axis rotation rate
  • UA_X -- X axis user acceleration
  • UA_Y -- Y axis user acceleration
  • UA_Z -- Z axis user acceleration
  • Pitch -- device rotation about the X axis
  • Roll -- device rotation about the Y axis
  • Yaw -- device rotation about the Z axis

See this page for a discussion of the pitch, roll, and yaw values and how they relate to the device.

motioncollector's People

Contributors

bradhowes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.