Data Logger for iOS

I had coded this logger when the new gyro embedded iPods were released. Its only function is to collect time tagged raw sensor and (processed) motion data from the device. The collected data is recorded in a text file in binary format which can be later downloaded to the computer via itunes.

Here is some notes about the application itself and iOS inertial subsystem:

  1. This was coded on iOS 4.1. With 4.1, it was not possible to accurately control the frequency of the data. Although I used the push method as suggested in the iOS reference, still the delivery of the data by the system is somehow arbitrary.
  2. Unfortunately, the gyroscope and the device motion maximum frequency cannot exceed 72Hz on average. In fact, the data is not periodic at all either. The delay between the samples varies between 10 and 30 msecs.
  3. Even worse, if only the gyroscope data is recorded (without starting device motion update service: i.e. using only [motionManager startGyroUpdatesToQueue:opQ withHandler:gyroHandler]), then the gyroscope data frequency drops to 52Hz on average
  4. The gyroscope data obtained with the device motion class of iOS is somehow arbitrarily compensated for gyro biases. When the data collection starts, the device motion class collects data for 0.6 secs and assumes that the average of this initially collected data is the random gyro bias. Although this method will sure cause problems during in motion activation of inertial sensors, I found it quite an effective method for dealing with initial bias errors of gyroscopes for handheld devices. A similar method should have been implemented in sensor service class of android.
  5. The axis definition in the iOS reference manual (at least for the 4.1) is wrong. Apparently the donkeys working for the apple think that an accelerometer facing downward must sense '+g'. I did not check the iOS 4.2. It might be corrected in the new version. However, you had better be careful when designing your application.
  6. iOS does not provide any temperature information. Therefore, it is impossible to deal with temperature dependent errors with soft-compensation methods in applications. (I hope some day the apple engineers can realize that the temperature sensors are indispensible part of every inertial MEMS unit.)
  7. I had received a couple of emails asking for my opinion about whether the sensors in the iPod/iPhone are accurate enough to perform 6DoF navigation. Unfortunately, they are not. Without very strong and continuous aiding in the form of gps, compass, zero-velocity etc you should not expect to obtain usefull 6Dof navigation results. On the other hand, these sensors can still be used in relative motion or 3DoF algorithms.