Hi, people

I'm trying to make one interesting thing, but got some troubles
realising it. The idea is to track [x,y,z] coord of the phone in our
coordinate system, callibrated from app start or button click.
What I mean is:
1. user run application, we fix point and angles
2. user rotate or move phone somehow
3. each moment we have phone's coordinates in our system

That's how I'm trying to do it:

1. Register listener for orientation change and acceleration, so I
have angles and acceleration in x;y;z - nice
2. Trying to rotate acceleration vector using 3 rotation matrixes with
angles(a,b,c) from orientation(not sure that's a good idea)
3. Removing gravitation from our system(vector is captured on
registering listeners, on app start)
4. Calculating dT (event.timestamp difference) and trying to integrate
acceleration just like that:

coordinates[coord] += speed[coord] * dt + a * dt * dt / 2;
speed[coord] += a * dt;

Where a - current acceleration on any axis(x,y,z)
speed - previous iteration speed value

The problem is that:

1. Rotation is done in a wrong way (can post code if needed)
2. Even when phone is hold on table there'r a's like 0.01-0.02 on each
axis, so that's not nice.. when I pick it numbers are going crazy :)

Could someone help me with that stuff?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to