Thursday, July 14, 2011

[android-developers] Re: Clarification on orientation angles (azimuth, pitch, roll)?

Unfortunately, it is not written well enough to consider it real
'clarification', but the official word from Google attempting to
clarify what 'orientation' really means and how it is measured is Dan
Morrill's blog "One Good Turn Deserves Another", reproduced at
http://www.anwelldigital.com/tag/dan-morrill.

But the way it is written really leaves a lot to be desired: Dan seems
to have forgotten, if he ever knew, about the famous "alias vs. alibi"
problem in coordinates (geometric coordinates are displacements, and
displacements are always by nature relative) when he writes completely
meaningless things like "the sensor data's coordinate system never
changes".

Nor does his first example really help, since he talks about an arrow
that always points in the direction of gravity, which is clearly
impossible if the phone is being held such that the screen is
perpendicular to the vector that is the force of gravity.

That said, if you read it carefully and look at both figures, I think
you will see that what he MEANT was that the sensor coordinate system
for the accelerometer (which obviously is a sensor) always has the +Z
direction going out the screen, and -Y direction going down, as
indicated by the force of gravity itself (otherwise the phrase 'top
and side of the device' would have no meaning).

Finally, I have to wonder: how are you doing these turns? I would have
thought you would let the user physically turn the phone and keep
receiving updates for the values from SensorManager.getOrientation().
In that case, the angles are well defined by the API docs, and you
really don't care what order he does the turns in: you just keep
getting the values until you get something close to what you want/
expect. Just don't confuse the two different coordinate systems: 1)
the "reference coordinate system" and 2) the "world-coordinate
system". Best to stick with just the reference coordinate system whose
values get stuffed into the 2nd parameter in getOrientation(): for the
first parameter, just use the current RotationMatrix and don't even
look at the values.

On Jul 13, 10:13 am, Hans Müller <heiligermuel...@googlemail.com>
wrote:
> Hi,
>
> I think need some clarification on these orientation angles. Say my
> android phone is lying flat on the table, with the top pointing
> exactly to magnetic north, which, as far as I have understood,
> corresponds to 0 degrees azimuth (clockwise rotation round Z axis
> pointing out of the screen), 0 degrees roll (rotation around Y axis
> pointing out of the top of the device) and 0 degrees pitch
> (counterclockwise rotation around X axis pointing out of the left side
> of the device).
>
> Now I want to change its orientation, so that it, after I have turned
> it, its orientation corresponds to A degrees azimuth, R degrees roll
> and P degrees of pitch. In /which order/ do I have to turn?
>
>  I tried the order azimuth, pitch, roll and got some crazy results.
>
> I also saw there is another coordinate system with the z and x axis
> inversed (athttp://developer.android.com/reference/android/hardware/SensorManager...
> at "getOrientation"). Do I have to use this one?
>
> Please don't point me to the "getRotationMatrix"-methods, as I want to
> really understand what's going on (which I think is a little obscured
> here). In which order are the rotations performed to get this matrix?
>
> Thanks!

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate