I’m currently transferring an Xcode project to Corona that requires full access to accelerometer data. Xcode, it seems, provides RAW accelerometer data, such that GRAVITY and instantaneous acceleration are combined in each X,Y, Z accel value. That is, with no movement, and the phone in a vertical or horizontal orientation, ONE of the readings will be close to “1.00”, because of the effect of gravity.
Most people probably don’t want this, being either interested in the direction of the GRAVITY vector (obtainable through low-pass filtering of the accel signals), or in the INSTANTANEAOUS CHANGE OF ACCELERATION data, being a HIGH PASS filtering to exclude the near-constant gravity signal.
CORONA seems to apply filtering to the accelerometer signals… the xGravity, yGravity, zGravity signals appear to have lag, so presumably a LOW PASS FILTER is being applied to raw accelerometer dat before being supplied to us.
On the other hand the “instantaneous” values xInstant, yInstant, zInstant are all centred around zero (z=0.00, y=0.00, z=0.00) if the device is not moved, indicating that the steady state values (e.g. GRAVITY, 1.00) is being removed before transmission to us. This is typically done with a HIGH PASS FILTER.
(Normally, I’d expect raw data to include the GRAVITY effect, giving you something like x=0.01, y=0.99, z=0.01, thereby indicating device orientation in the raw data. This does NOT seem to be what happens).
The xGravity values are not sufficient, as they have been filtered and therefore delays in the data are apparent (an effect of Low Pass filtering).
My question, given I would like to filter the raw data myself rather than have it done for me… can I access RAW ACCELEROMETER DATA directly through Corona, as I can through Xcode?
The CORONA docs are a little light in the technical details about exactly what is being provide by the accelerometer API.
Does anybody know… Can I access the raw accelerometer data without filtering applied to it first?</p>
Thanks and regards…