{ "id": "61196", "key": "TIMOB-564", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-07-27T16:56:36.000+0000", "created": "2011-04-15T02:32:04.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "accelerometer", "ios", "iphone" ], "versions": [], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-07-27T16:56:36.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
Hi, I'm working on augmented reality, so I need to use\naccelerometer and compass features.
\nThe problem is the measurement accuracy. The measurement difference\nof the accelerometer with a little movement of the iPhone it's\nabout 2-3%, while in other application like AroundMe or iHandyLevel\nit seems to be more accurate. Is it possible to change/increase the\naccuracy on iPhone? Thanks a lot, Flavio
I have found a solution.
\nIf you need more accuracy, you can do as apple suggests:
var accelX = 0;
\nvar accelY = 0;
\nvar accelZ = 0;
\nvar kFilteringFactor = 0.1;
Ti.Accelerometer.addEventListener('update',function(e)
\n{
\naccelX = (e.x * kFilteringFactor) + (accelX * (1.0 - kFilteringFactor));\naccelY = (e.y * kFilteringFactor) + (accelY * (1.0 - kFilteringFactor));\naccelZ = (e.z * kFilteringFactor) + (accelZ * (1.0 - kFilteringFactor));\n\nts.text = e.timestamp;\nx.text = 'x: ' + accelX;\ny.text = 'y:' + accelY;\nz.text = 'z:' + accelZ;
\n
\n});
\nThis uses a low-value filtering factor to generate a value that\nuses 10 percent of the unfiltered acceleration data and 90 percent\nof the previously filtered value.
\n-> More accuracy but short-lived changes in motion.
Regards, Flavio