[TIMOB-564] Accuracy of compass and accelerometer
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-07-27T16:56:36.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | accelerometer, ios, iphone |
Reporter | flaz83 |
Assignee | Reggie Seagraves |
Created | 2011-04-15T02:32:04.000+0000 |
Updated | 2011-07-27T16:56:36.000+0000 |
Description
Hi, I'm working on augmented reality, so I need to use
accelerometer and compass features.
The problem is the measurement accuracy. The measurement difference
of the accelerometer with a little movement of the iPhone it's
about 2-3%, while in other application like AroundMe or iHandyLevel
it seems to be more accurate. Is it possible to change/increase the
accuracy on iPhone? Thanks a lot, Flavio
Comments
- flaz83 2011-04-15
I have found a solution.
If you need more accuracy, you can do as apple suggests:var accelX = 0;
var accelY = 0;
var accelZ = 0;
var kFilteringFactor = 0.1;Ti.Accelerometer.addEventListener('update',function(e)
{accelX = (e.x * kFilteringFactor) + (accelX * (1.0 - kFilteringFactor)); accelY = (e.y * kFilteringFactor) + (accelY * (1.0 - kFilteringFactor)); accelZ = (e.z * kFilteringFactor) + (accelZ * (1.0 - kFilteringFactor)); ts.text = e.timestamp; x.text = 'x: ' + accelX; y.text = 'y:' + accelY; z.text = 'z:' + accelZ;
});
This uses a low-value filtering factor to generate a value that uses 10 percent of the unfiltered acceleration data and 90 percent of the previously filtered value.
-> More accuracy but short-lived changes in motion.Regards, Flavio
- Vikramjeet Singh 2011-07-27 Bug: Invalid. Apple don't support this. Not possible. Asked Blaine