Compass for android (orientation in 3D space)

by mboehmer » Mon, 29 Dec 2008 18:19:14 GMT

Sponsored Links

mobile phones usually show the point of the compass, when people are
on the move (estimation of a vector from gps track). The API says,
that android is also able to get the point of the compass. How is this
done? Is this done by software (estimating the vector) or has the G1
an build-in magnetic hardware compass? If not, does anyone know, if it
is possible to connect a magnetic compass via USB or bluetooth?

I am interested in the orientation of the phone in 3D space, while the
user is standing still. Does anyone know, how wikitude (http:// does this?

Best regards


Compass for android (orientation in 3D space)

by DSmith » Mon, 29 Dec 2008 23:44:16 GMT

 The easiest way is to use SENSOR_ORIENTATION ( 
SensorManager.html#SENSOR_ORIENTATION).  It does all the necessary
calculations on the magnetometer and accelerometer values, throws in
some low-pass filtering, and spits out azimuth, pitch, and roll.  The
calculations aren't perfect - you'll see some strange things at the
branch cuts, like the az spinning backwards through the entire range
when you raise the phone over your head, but it's pretty good for most
practical uses.

Sponsored Links

Other Threads

1. pvplayer_engine_test: not found

Hi all,
I am running opencore test following opencore readme, but it keeps reminding me
pvplayer_engine_test: not found
anybody know why?


2. How to enable ALSA on Android?


   I am porting Android to a real hardware device. I have written an ALSA
driver and it works well. But I don't know how to add it to Android. Can you
give me some suggestions? Thanks very much.( I can not endure the muted
world any more[?])



3. align title in center

4. why returns "Couldn't get connection factory client" when access gmap on emulator

5. can not visit maps on emulator because of "Couldn't get connection factory client"

6. Customers Unable to Download Upgrades

7. Where I can put some pictures to display in GALLERY app on emulator or real device?