Working of SensorTest

3 views
Skip to first unread message

Gautam

unread,
Nov 22, 2008, 5:28:50 PM11/22/08
to OpenIntents
Hi,
I've been using the sample code in SensorTest to build a small project
and it works very well.

Somewhere during my testing, the logic seemed to work very well for
Tilts.
So I imagined that it was exclusively for Tilts (like a Left Tilt
using Roll), but after reading some more docs and testing, I realized
that its working for Moves as well (like a Left Swing etc.)

I've got some doubts:
1. So what is the code in Sensor Test supposed to detect? Tilts?
Moves? or Both?

2. As its recognizing Tilts, is that so because they can be measured
using the data from accelerometer?
Initially I thought that Tilts would work just with the Orientation
Sensor (but after reading some docs, I realised I'm wrong and
Accelerometer can be used to detect Tilts)

3. Is there a simple way to detect whether it was a Tilt or a Move?

Thanks,
Gautam

Peli

unread,
Nov 23, 2008, 6:05:03 AM11/23/08
to OpenIntents
I guess one can do some heuristics to tell a tilt apart from a move.
But be aware that in the end there are physical restrictions to tell
them apart in all cases.

Imagine you sit in a moving theater (like the ones they have in Disney
land) where a rocket is being simulated. On the screen you see the
cockpit of the rocket that is being launched, and you are pushed back
into your seat. Maybe the whole cinema is moving and acceleration
forward, but more probably it is just tilting back. How can you tell
the difference? Probably using a gyroscope and a compass, but things
get more involved there.

I assume that the G1 does not have a three-axis gyroscope included and
the orientation sensor value is really a combination of the compass
and the accelerometer values. If this is the case, there is no easy
way to tell tilt apart from move in general.

As for what exactly SensorTest is doing, I guess you have to ask in
the Android Developer's forum. It is taken from the API demos. All I
did was add support for the OpenIntents SensorSimulator for it.

Peli

Gautam

unread,
Nov 23, 2008, 12:43:32 PM11/23/08
to OpenIntents
Thanks Peli for your response and the example.

I've posted my query at the Android Developers forum now.

Gautam

Gautam

unread,
Nov 23, 2008, 12:44:44 PM11/23/08
to OpenIntents
Reference: Thread continued on Android Developer forums [http://
groups.google.com/group/android-developers/browse_thread/thread/
75e2647089f98a44]
Reply all
Reply to author
Forward
0 new messages