[PROJECT] G-Lenght - Windows Mobile Development and Hacking General

Hi guys!
This morning during physical time at school, i was thinking about a new app that i don't ever seen on the network.
A tool that allow to measure lenght of object by g-sensor built-in our (yours XD i've an old Kaiser, my brother has an Omnia) ppc.
So, on the X Axis, we have the time, and on the Y axis we have the speed/velocity.
We need to calculate the space having the acceleration value (taken from g-sensor) and the time.
Suppose this:
You have to measure the lenght of a tennis court.
You start the application. There is a button, press it.
Now the ppc is recording every second, the acceleration on an axis (supposed to be the z axis), and he's saving it on memory.
If you are still, the value is 0, then you have the previus speed, if you are moving in one direction, it will increase its value, but when you walk at the same speed (costant) the value is 0 again (not worry, it's working perfectly).
When you stop the app, it will stop recording the values and calculate the distance.
There is anyone that would make this application, i'm good only at web design and graphics, but not at develope apps =)
I could also help you, or would be good if we can create a team ^^

Oh ! It's a great idea man

I have a hard time believing it'd be any more accurate than measuring with the GPS.
Meaning, not very accurate.
If you tilted the device (even slightly) your measurement could be WAY off.

it's possible to delete this error of tilting the device by using sin/cosin function.

It strikes me, however, that by using the GPS coupled with the accelerometer, you could calculate the height of trees to within the nearest mile or so...

but you cannot use gps for small object, for example, rooms, or desktop =)
and in this case you could set your phone on the dest and slide from the A side to the B side.

Baly23 said:
it's possible to delete this error of tilting the device by using sin/cosin function.
Click to expand...
Click to collapse
How so?
I don't claim to be a math wizard, but I don't see how the device can tell the difference between being accelerated through space and being tilted. This ambiguity is the very basis of the stationary "roller coaster" rides that put the track on a screen and tilt you around to make you think you're moving.

if your phone is on a table (not tilted) all the g-acceleration is on an axis.
If you tilt a bit the device, the g-acceleration is divided in 2 or 3 axis. let's try with an app that tell you the info and take a look

Baly23 said:
If you tilt a bit the device, the g-acceleration is divided in 2 or 3 axis.
Click to expand...
Click to collapse
Unless it's rotated AROUND the axes in question?
Again, I could be way off here, I'm just going from my understanding...

for rotating around an axes, you have to tilt the device!
For make an accurate measure, you have to don't rotate it xD
it's like start the chronometer when a race start, and stop it when you want, not at the end of the race XD
The chronometer could be good like 1/100 of second, but if you stop it after 3 or 4 seconds, doesn't have any sense

hi
it will not work because if you move at constant velocity the acceleration will be null, so the accelerometer will be inefficient. and the distance covered will not be counted.

gjeremie said:
hi
it will not work because if you move at constant velocity the acceleration will be null, so the accelerometer will be inefficient. and the distance covered will not be counted.
Click to expand...
Click to collapse
in italian is "Legge oraria del moto uniformemente accellerato"
it's a law of the uniform accelerate motion.
space = initial speed * time + 1/2 * acceleration * time^2
so, if acceleration = 0, all the second part of the law will be 0, but not the first!
if you are at 2m/s, and there is no acceleration, you will gain 2meters erery second, until you don't change the speed

Well, hey, if the math works out, I think it'd be a neat project.

gjeremie said:
hi
it will not work because if you move at constant velocity the acceleration will be null, so the accelerometer will be inefficient. and the distance covered will not be counted.
Click to expand...
Click to collapse
The real question is, "can the accelerometer be used to accurately determine speed (given a known starting state, i.e. zero velocity)". I don't know the answer to that question, but if it's "yes", then the project is feasible.

i don't know the exact sample rate of the g sensor, but if it takes value at 5Hz (5 times per second), could be good.
i'm quite sure that the value is at least 10Hz

http://www.maspware.com/products/gpsmeterpe/index.php
not exactely the same, but we have also a gps...

bbonzz said:
http://www.maspware.com/products/gpsmeterpe/index.php
not exactely the same, but we have also a gps...
Click to expand...
Click to collapse
yes, but it's gps!
You cannot measure indoor object smaller then 1 meter!
The error of the gps it's about +-1/m for x and y axis, you cannot use it to meausure 1m object... you have 100% of relative error!

I think I understand what he is getting at. What he is saying is that using the accelerometer, this app would start when the phone starts to move recording the velocity at that moment. If you swing your arm while walking to measure something it would constantly be changing velocity and both positively an negatively. Now all we have to do is record those velocities do a little math and we will have a ft/sec or in/sec, now factor in the time from start to finish and you have a measurement. GPS is nice for outside and large objects, it will get you within 5 to 10 feet. But this could be much more accurate than GPS and also used for smaller items such as rooms.
One thing I would recommend is that the time starts and stops automatically when the phone starts and stops. This would provide the most accuracy. Sure have a "Start to Measure" button but that would be more of an initiate button.
Excellent Idea! Any developers want a shot?

if you start the timer manually, and don't move your phone, it's ok, cause acceleration is 0 and initial speed is 0, so for the partial time, it doesn't move and it's ok

You are correct. So it really would not matter.

Related

[APP]Waterlevel 0.2 (Another waterlevel application!)

Well, there are already a couple of applications out there already, but i was playing with the SDK and just trying some stuff out in visual studio so i thought, why dont i just release it?
Its a first release, it does work, has some basic calibration and im trying to make a bit more visually appealing that just some bars
So,
version 0.2:
- Updated graphics of the "Circle" compass/meter. Now actually looks like a compass thingy
- Added the ability to actually save the calibration data, and to let you know its doing something and its done.
- Created an CAB Installer to install the addon.
- Made all pictures internal resources.
version 0.1:
shows an Water level for the X and Y Axis, an circle "meter" and an light meter. There arent any big bugs that i know off, but i didnt implement the "maximal" meter bars yet. That means the measure bars can go a bit beyond the container
Requirements:
You do need the Compact framework 2.0, it will (unfortunatly) not work without it! But seeing as everyone already has the lightsaber application i guess its not that much of an issue
Other:
If anyone has some suggestions or comments (bad or good..) just let me know..
Source:
I added the source code if anyone is interested. Its not some good code, and the calibration could be alot more detailed, but perhaps it helps someone
Oh, and if anyone reflects the application and starts to rant about how my code sucks, i didnt optimize it or plan ahead, i just started to code some
1. congrats and keep the good work! it is refreshing to see a newbie that brings something to the forum and don't start with a wining post.
2. i really hope you'll receive only positive feed back (not so common here ) and allow me to be the first one to say: no, i don't think yr code sucks
3. is the calibration function working?
4. can you explain what "lumens" are doing here. lumens is an international measure unit for light. are u trying to use the internal light sensor to measure the light? this could be a good idea and i'll be very interested.
Lumens is the light sensor =)
Awesome app, calibration works perfectly and saves the setting ok and that light sensor is a nice addon.
Would love to see this made into a .cab installation and perhaps make this app work with the AppToDate program for easy updates.
Look forward to future updates
This is going in my favourite apps
Ignore my double post
awesome it is! great app.
explain please what is with light measuring pls....only measuring or calibrating the automatic light level also?
thanks!!!
No, it measures the amount of light the light sensor receives. I will eventually add an cab installer, but seeing as its still in the "works" i am not bothering with it yet
The calibration works, its not as awesome as the BubbleLevel one yet. When you press the button let the diamond lay there for 3 seconds, and then it calibrates. I wont update the backlight.
The light sensor only shows the value, it doesnt update the backlight it self. I tried doing that, but i can only turn the backlight on very bright, very dim and off. Not somewhere in between
Calibration
Nice app! I like the light sensor also, i finally found out where the light sensor really is
It calibrates fine but does it actually saves it somewhere? the moment i close the app and start Teeter, still not calibrated.
So far non of the apps around here were able (for me) to save the calibration. Some people mentioned success though and since I have tried by now all available roms and on none the calibration works, i get this idea that there are several versions of the sensor (hardware) around...
Anyhow, good to see a new app like this and success with it!
No, the calibration it not saved yet, i will add that soon. The problem with the calibration data is that its reset on reboot. The only tool that i know of comes from a different telephone (Raphael or something) and does save the calibration. But not all roms work with this.
So the calibration from almost all applications will only work on the application itself
Wow, thats the best waterlevel prog here around! Nice graphics, but still very simple. And the lights measurment is very nice too!
Very good work! Thanks!
icon maybe?
I updated te first post with version 0.2. I added some more graphics (lightmeter still had to be done ) an saving of the calibration data for this app only.
@ KukurikU:
Well, i created a simple icon. I tend to like simple stuff that easily identifies a software app..
i put my diamond on a real level meter, bring the level meter to 0,0,0 and pressed "calibrate" and now i can use my diamond as a level meter.....until next reset..
Thanks Wiebbe, nice little app. Will be very useful with my missile launcher!
Accuracy is a little off, well a lot off, on vertical measurements, try to get it to read 90 degrees, could this be an issue with the G sensor itself?
uniqueboy said:
Accuracy is a little off, well a lot off, on vertical measurements, try to get it to read 90 degrees, could this be an issue with the G sensor itself?
Click to expand...
Click to collapse
hard to tell who is to blame. look at the experiment/calibrate method described in my previous post.
i found my diamond to be "off" by 1.4-2 degrees (am i lucky or what?!) and after calibration 0,0 it stayed this way after playing with it quite a bit.
edit: sorry, my bad, now i get it...you r right, on vertical about 7 degrees off... getting 97-96 degrees.
Well, its not that the accuracy is really off. The SDK returns a certain value and its kinda hard to precisely convert it
Ill see what i can do, working on a different way to calculate the angle now.
edit:
Its odd, when i place the diamond vertically against a flat surface (whick should be 90 degrees) the build in Angle says 98 (from the raw data) my calculated one says 92. so its hard to decide which one is correct
After some more testing, it seems that all other applications have the same "error". Bubblelevel says 97 degrees as well when i place it against an 90 degree angle object. Same goes for SpiritLevel. I made a new way to calculate it which seems to be more "accurate" with the angles. But it still wont be 100%! Well, the number of degrees isnt 100% accurate, the bar it self ofcourse does work properly!
Does the output from the G sensor give X,Y,Z or just X,Y ? That coul be a problem when measuring the vertical. If it's just X,Y then maybe when tipped past a certain threshold an error message should be given, or even an audible warning.
The SDK in rawdata form gives back the following:
Angle for X
Angle for Y
Tilt value for Y
Tilt value for X
Tilt value for Z
The angle values are really in degrees, the same as SpiritLevel. They output around the same values as i output.
The tilt values are something from 0 till 1000+, you can see these in BubbleLevel as well at the calibration. I used the angles before, but these arent very correct.
Ill see if i can get myself a watermeter and an setting where i create an real 90 degrees setting so i can calculate a bit what the real values should be
It could be my house is like 97 degrees sloping, but i doubt that ^^
dont forget that an angle of 97 is possible if you tilt it above the 90 degrees value..
I too live on a hill.

software for the gym

Hey Guys..
i think this software probably doesn't exist.. but i thought let's give it a try
I recently swapped gyms and in the gym i'm now at, when i'm working out, my pulls and pushes aren't counted.. also the distance i pull/push isnt checked like in my former gym.. so i can't watch my technique..
Then i thought.. maybe there's an app wich uses the g-sensor too register the movement of the device and displays them usefull for working out, when i attach my phone to the weights..
Anyone's come across such software??
Thankyou
Well the accelerometer in the phone can only track acceleration (and direction, due to gravity), not absolute movement or distance. To do that, you need a reference point and potentially other sensors (e.g. the Nintendo Wii's IR bar, and the additional angular rate sensors in the MotionPlus accessory).
If you had a set speed, you could calculate distance based on time (which it'd know by the angle of the phone, assuming you attached it to yourself / the weights in a fixed position), but your speed's probably going to vary enough to make the output useless.
hmm.. too bad..
Thanks for the response!!

Working on a Track app for motorcycles

Hi all,
I'm relatively new to the WinMo programming, but so far I've been able to capture and process the Gsensor data, but I can't seem to understand how to use the GPS data.
I want an app that will record the GPS position along with all of the Gsensor data so that I can record the route and have data for each point that contains lean angle, acceleration, deceleration, etc. I figure I'll have to have the Gsensor fill in for some of the GPS data and vice-versa.
Why you ask?
Well, let's say you put it in a suspension test mode. You could accelerate gradually and brake. Hopefully the gsensor could catch the dive and bobble of the bike and give you some feedback. Knowing how far you are leaning in some turns is nice. You could possible detect and calculate if you are sliding at all. Perhaps you could even calculate the power output if you included the weight. You could make a mode that would yell at you if you get the front wheel too far off the ground, etc. I think there are all kinds of fun things to do. I know there are expensive and half solutions out there, but having an opensource solution would be nifty.
I'm a relative noob with C# and I'm using SharpDevelop. If anyone has any suggestions for things to implement or can help me acquire and use the GPS data I'd appreciate it.
If this sounds like a dumb idea I can always abandon it too.
Thanks guys.
lol, actually I think its a cool idea to be able to log what your doing. And maybe a top speed via the GPS. I think that would be a really cool app to have when I ride.
gliscameria said:
Hi all,
I'm relatively new to the WinMo programming, but so far I've been able to capture and process the Gsensor data, but I can't seem to understand how to use the GPS data.
I want an app that will record the GPS position along with all of the Gsensor data so that I can record the route and have data for each point that contains lean angle, acceleration, deceleration, etc. I figure I'll have to have the Gsensor fill in for some of the GPS data and vice-versa.
Why you ask?
Well, let's say you put it in a suspension test mode. You could accelerate gradually and brake. Hopefully the gsensor could catch the dive and bobble of the bike and give you some feedback. Knowing how far you are leaning in some turns is nice. You could possible detect and calculate if you are sliding at all. Perhaps you could even calculate the power output if you included the weight. You could make a mode that would yell at you if you get the front wheel too far off the ground, etc. I think there are all kinds of fun things to do. I know there are expensive and half solutions out there, but having an opensource solution would be nifty.
I'm a relative noob with C# and I'm using SharpDevelop. If anyone has any suggestions for things to implement or can help me acquire and use the GPS data I'd appreciate it.
If this sounds like a dumb idea I can always abandon it too.
Thanks guys.
Click to expand...
Click to collapse
I don't think its a "practical" idea, not dumb, but for learning how to code and stuff, its a great idea. I'm assuming you enjoy riding at the track, so that'd keep you motivated to continue the app development.
There are already similar apps, but I don't know if they will detect lean angle and brake dive.
That's the first thing I thought of when I saw this app:
http://forum.xda-developers.com/showthread.php?t=424423
I haven't played with it, but maybe it could give you something to start with.
Check this out too
http://www.racechrono.com/
The newest SpeedoHealer has a top speed recall on it, and its only $100 for the whole system. Much less than having to buy a WM phone just to record top speeds.
Most of us need one of those anyway, but if you could make your app work in conjunction with that system.. could be very useful.
Especially for the initial calibration. Get the correct GPS speed from the phone, and then get on the SH website from the phone for the correct calibration code! Or find a way to integrate the SH code program thing into your app. so you don't have to get online for the code. That would be very useful for gearing changes at bike nights when the dyno is unavailable.
But you could load some track maps in it, have the thing record acc/dec at which points at each corner. Then you could see where you started braking at, and decide if you need to brake sooner and softer, or later and harder.
Maybe if (lets hope not) you go down, you could see how much decel. at what angle caused the loss of control.
Think you could set it up to calibrate the 2 axis independantly?
set the side to side while on a stand, then remove the stand and calibrate the front to back when loaded with the rider at static sag, cuz its going to change from when its on the stand and the stand is the only way you're going to get anything close to accurate verticle calibration, but the front to back will be off with the back wheel raised.
Where you thinking of mounting the phone to the bar/tripple clamps?
or under the tail?
I think I'd be afraid of losing such an expensive piece of equipment if it was mounted upfront. But you can't see anything on the screen under the tail.
Unless you didn't want it to display anything, just collect data.
Not that you'd be able to do much screen touching with gloves on anyway.
Better use large buttons! lol
Do you think you could setup the light sensor to determine if a headlight bulb is getting old? I don't know if the sensor will work when flooded with that much direct light.
Well anyway, just a few ideas for ya.
I don't ride at the track, but I'd like to test the app out when you get a working beta going.
I'm sure it could have its uses on the street.
And I know the speedo is off on my 08 Busa.
KYT said:
Well anyway, just a few ideas for ya.
I don't ride at the track, but I'd like to test the app out when you get a working beta going.
I'm sure it could have its uses on the street.
And I know the speedo is off on my 08 Busa.
Click to expand...
Click to collapse
Thanks for the input. Until I can find some help on the GPS aspect of it I'm kinda idling.
I'm thinking...
When you start the app you will have to have it mounted and be on the bike. There will be a calibrate button which you will press when you are centered. From there on out you can pick a mode.
Your busa better not have any chrome on it. =/
Keep it up!
Very cool idea! I actually experimented with an analog 'curve counter' mounted to my motorcycle several years ago. Built a box with a steel ball inside that rode along a curved piece of metal and made contact closure with a terminal on each end - different viscosities of oil provided the dampening to keep it from bouncing around. This was coupled to an electronic counter that I built from a kit. It was kinda cool, but a pain to get mounted.
I don't have the experience to lend for application development, but I would certainly be willing to test any versions of the app you would like.
FYI - right now I use Run.GPS for tracking but would love to have lean angle and acceleration/deceleration data to go along with it. The only glitch with lean angle is that I assume the centrifugal force during cornering would prevent the accelerometer from reading the true lean angle...maybe some calculations could compensate.
go for it!
my hayabusa, my tp2 and I would be happy to be in your test team ;-)
and BTW, I am a veteran C# developer, so let me know if I can help.
(experienced in C#, but not in Win-Mo or HTC hardware)

Gyro stability

Hi,
I'm a proud S2 owner but I'm note sure for how long. It seems the gyro in my device is very unstable. For example, if I use Google Maps and I turn on the sensor, the map will rotate if I only the tilt the device upwards (and this shouldn't cause a map rotation).
I've also tested some other apps using the gyro (STLView by ModuleWorks https://market.android.com/details?id=moduleWorks.STLView or some artificial horizon apps) and they all share this instability.
I have an EEE-Pad as well, and there those apps are really great.
So the question really is, is it just my device or can anyone else reproduce these issues?
Thanks,
Mark
I have the same issue.
pub00515 said:
Hi,
I'm a proud S2 owner but I'm note sure for how long. It seems the gyro in my device is very unstable. For example, if I use Google Maps and I turn on the sensor, the map will rotate if I only the tilt the device upwards (and this shouldn't cause a map rotation).
I've also tested some other apps using the gyro (STLView by ModuleWorks https://market.android.com/details?id=moduleWorks.STLView or some artificial horizon apps) and they all share this instability.
I have an EEE-Pad as well, and there those apps are really great.
So the question really is, is it just my device or can anyone else reproduce these issues?
Thanks,
Mark
Click to expand...
Click to collapse
I tested it on my sgs2 with maps and I don't seem to have the issues that you are experiencing. I even downloaded STLView and did not have this "instability" problem. Perhaps your handset is faulty?
Another possible reason is that you might have been trying to use your sgs2 in the bermuda triangle. It has been documented that the bermuda triangle wrecks havoc on electronics.
Are you sure maps use gyro ? I guess they use primarily compass and G-sensor, while of course, gyros can help too.
Did you try to calibrate the gyro sensor?
Yupp, tried calibration, didn't help.
@info5i2002
Pretty far from bermuda
In STLView, did you enable the gyro button (the button on the left side)? What happens if you tilt the phone by 90° (hold it over your head facing towards you) - does the heading swing around?
When I hold the phone level (in landscape orientation), and I tilt the phone up and down, I can clearly see the axis swing from left to right.
pub00515 said:
Yupp, tried calibration, didn't help.
@info5i2002
Pretty far from bermuda
In STLView, did you enable the gyro button (the button on the left side)? What happens if you tilt the phone by 90° (hold it over your head facing towards you) - does the heading swing around?
When I hold the phone level (in landscape orientation), and I tilt the phone up and down, I can clearly see the axis swing from left to right.
Click to expand...
Click to collapse
Yeap, tried it in landscape and tilted it up and down and it seems to move only up and down only.
If the device is in a case/cover which has Magnetic Lock then the issue is normal.
issue is NOT gyro related, what's described here is unstable accelerometer and/or compass readout. i guess it's mainly due to missing magnetic calibration (try to do the "8" pattern with the phone, AND turn the phone twice around each axis). if the problem persists, than it's maybe within technological limits (and everyone faces it, although the people here are more upset about it). also possible is magnetic interference due to huge amounts metal etc...
Yes .. people often confuse accelerometer (G-sensor), electronic gyroscopes, and compass. All do different things, but all can be used in applications like maps.
I also noticed that the magnetometer of my s2 is kind of imprecise.
I have continuously swinging head indication, of about +/- 15 degrees. Moreover, the correspondance from phone orientation and indication is not linear. I get higher sensitivity towards one direction and lower towards the opposite direction...
However what I did notice, is that the magnetometer, responsible for the compass, is very sensitive not only to nearby magnets, but even to metal objects at considerable distance. So perhaps it is all just this sensor beind a tad too sensitive.
Sent from my GT-I9100 using XDA App
Hi,
I've done a few more tests - I placed a strong magnet next to my Eee-pad and I had no deflection when I moved the magnet. So in this case, the app is correctly using the device's gyro and accelerometer. I then performed te same test with my S2 and bingo, I had a strong deflection as I moved the magnet. This is plain silly, as the sensor I'm using in my own app doesn't rely on the compass, instead it relies on the rotation vector sensor as provided by the SDK. Now the question is, who was sloppy? Does Gingerbread perhaps not support the gyro fully or did Samsung not implement the sensor correctly? As I wrote, the same code works perfectly on my Honeycomb tablet so it's not a programming error per se.
Regards
Mark
Yes, there definitely must be something wrong with the gyro and/or the magnetometer.
Some time ago I opened a specific thread on this subject in this forum, got many "reads" but no replies whatsoever...
So strange nobody did actually notice it so far.
pub00515 said:
Hi,
I've done a few more tests - I placed a strong magnet next to my Eee-pad and I had no deflection when I moved the magnet. So in this case, the app is correctly using the device's gyro and accelerometer. I then performed te same test with my S2 and bingo, I had a strong deflection as I moved the magnet. This is plain silly, as the sensor I'm using in my own app doesn't rely on the compass, instead it relies on the rotation vector sensor as provided by the SDK. Now the question is, who was sloppy? Does Gingerbread perhaps not support the gyro fully or did Samsung not implement the sensor correctly? As I wrote, the same code works perfectly on my Honeycomb tablet so it's not a programming error per se.
Regards
Mark
Click to expand...
Click to collapse
Now that's interesting. Could be !
My compass works a bit weird. I put it on table, let it show the north. Then I rotate the device 180 degrees .. and the north shifts like 5 degrees. It can be worse, but calibrating (waving the 8 pattern) helps .. but I can't get the error under 5 degrees no matter what.
Btw. it's common that that electronic compasses are much more sensitive to metal objects, that's not Samsung's mistake. But the sensors should not be linked.
Edit: I downloaded some sensors monitoring application. And gyroscopic sensor itself for sure is not sensitive to magnetic fields and works as it should, same for accelerometer. But then there are some IMHO virtual sensors: linear acceleration and rotation. They seem to be synthesized from more sensors, and the rotation does react on magnet.
So perhaps if someone has a different phone running Gingerbread with a gyro on board, we can see if the issue exists there as well (best would be to try it with STLView, as I know what API calls are made)
Thanks,
Mark
Dr.Sid said:
My compass works a bit weird. I put it on table, let it show the north. Then I rotate the device 180 degrees .. and the north shifts like 5 degrees. It can be worse, but calibrating (waving the 8 pattern) helps .. but I can't get the error under 5 degrees no matter what.
Click to expand...
Click to collapse
Mine does the same. Actually I can get even 15 degrees deviation. I noticed that it seems to depend on the location I am, despite apparently there should be no magnetic objects nearby. I am pretty sure that if if you try rotaring your phone at constant angular speed in the horizontal plane (with it horizontal on a table for instance) with a "compass" app running you will notice that the indicaton on the screen speeds up considerably when the phone is pointing to the north, and slows down when is pointing to the south.
Which Gingerbread version are you guys running?
I'm still waiting for the 2.3.4 update.
It would be interesting if someone could try this with 2.3.4, perhaps it works with the update?
Thanks...
Mark
pub00515 said:
So perhaps if someone has a different phone running Gingerbread with a gyro on board, we can see if the issue exists there as well (best would be to try it with STLView, as I know what API calls are made)
Thanks,
Mark
Click to expand...
Click to collapse
hi mark,
again, what you (we) experience here has nothing, i repeat nothing, to do with the GYRO. what you mean is the accelero- and magnetometer! a gyro knows nothing about it's current position (it only detects deviations, read about a coriolis vibratory gyro for more details about the mems gyro the sgs2 is using)
most programs i know are not using the gyro for positional information, for example google maps, google sky... they are all using the magnetometer in combination with the accelerometer ONLY!
regards,
markus
Hi Markus,
thanks for the heads-up, but I think I have a pretty good idea of what's going on:
Why?
Well, for starters, I'm a software developer in a technical field and I'm also the author of STLView mentioned above. Secondly, the same app running under Honeycomb with an Asus EeePad is working perfectly, and it is using the gyro there. Yes gyro and no, not magnetometer.
The problem with the S2 as I see it, is:
either Gingerbread or Samsung have failed to implement the rotation_vector sensor, as provided by the official API, correctly. On the S2, it is using the acceleration sensor combined with the magnetometer, which is just plain silly, as the magnetometer is too unstable for correct rotation rate measurement. On the EeePad, the same virtual sensor is using the accelerometer and the gyro in combination (gyro for rotation rate and the accelerometer to eliminate gyro drift). What you get is a very accurate sensor reading, which is just not possible on the S2 as of now.
Hopefully, either Samsung or Google are going to fix this flaw, but I think the problem is more on Samsung's side as they are the ones who actually know what physical sensors are available. That's also why it would be interesting to find out if other devices running Gingerbread that have a gyro on board are also experiencing the same problems.
By the way, I'm also a pilot so I think I have a pretty good understanding of what a gyro is and what it measures, thank you very much. Next time, remember: "Halbwissen ist gefährlich"
Regards
Mark
pub00515 said:
Hi Markus,
thanks for the heads-up, but I think I have a pretty good idea of what's going on:
Why?
Well, for starters, I'm a software developer in a technical field and I'm also the author of STLView mentioned above. Secondly, the same app running under Honeycomb with an Asus EeePad is working perfectly, and it is using the gyro there. Yes gyro and no, not magnetometer.
The problem with the S2 as I see it, is:
either Gingerbread or Samsung have failed to implement the rotation_vector sensor, as provided by the official API, correctly. On the S2, it is using the acceleration sensor combined with the magnetometer, which is just plain silly, as the magnetometer is too unstable for correct rotation rate measurement. On the EeePad, the same virtual sensor is using the accelerometer and the gyro in combination (gyro for rotation rate and the accelerometer to eliminate gyro drift). What you get is a very accurate sensor reading, which is just not possible on the S2 as of now.
Hopefully, either Samsung or Google are going to fix this flaw, but I think the problem is more on Samsung's side as they are the ones who actually know what physical sensors are available. That's also why it would be interesting to find out if other devices running Gingerbread that have a gyro on board are also experiencing the same problems.
By the way, I'm also a pilot so I think I have a pretty good understanding of what a gyro is and what it measures, thank you very much. Next time, remember: "Halbwissen ist gefährlich"
Regards
Mark
Click to expand...
Click to collapse
hi mark,
sorry - i didn't meant to be rude...
nor did i know your background; the thing nowadays is, a hell lot of people are talking technical nonsense all the time, which is quite frustrating...
i have to admit as i'm no software developer i didn't know the thing with the rotation_vector, what's sure for me was that the actual situation is caused from the accel/mag sensor, simply because of its behavior. that it would be way better to use the gyro as well for all this applications is absolutely true.
so let's hope either samsung or google will provide a fix, as you said!
glück ab, gut land!
markus

Strange Compass behavior in GPS Status app

anyone can check wether their compass work properly in GPS status app ?
my compass always moving in clockwise direction and even when i put my nexus on the table, the compass still moving clockwise, tried to calibrate compass and accelerometer, the compass still always rotating..
can anyone check if this is a bug in the app itself or my magnetic sensor has trouble ?
Yeah I noticed that yesterday with a compass app.
Sent from my MB612 using xda app-developers app
so this is a known fault ?
I know for sure that the GPS status app performs an automated compass calibration so long as you move the phone/tablet correctly.
What I am not completely sure is whether you need to perform this procedure every time you re-start the app, or whether it caches the result for subsequent uses. (I had an experience in the mountains with three different compass apps that had me questioning the use of battery-powered technology)
In any event, fire up the app and rotate the tablet twice around each of it's three axes (X, Y, Z). Be careful that you don't drop the tablet! (I notice that when I do it I am trying to keep my hands away from the touchscreen, and so the grip I have isn't very solid)
If N is not in the correct place (allowing for local declination offsets), then maybe you have bad hardware or maybe your table your tablet is sitting on has a big piece of metal under it.
Spinning compass sounds like broken hardware, the Bermuda Triangle, or just noise (nearby power mains can cause a 60 Hz mag field wobble if they carry unbalanced currents - I use to work in a joint where everybody in one section of the building had CRTs that wobbled all the time). I think the GPS status app has an adjustable sensor filter, does it not (Menu-> GPS & Sensors -> Sensor Filtering - try medium or strong filtering maybe?
good luck
bftb0 said:
I know for sure that the GPS status app performs an automated compass calibration so long as you move the phone/tablet correctly.
What I am not completely sure is whether you need to perform this procedure every time you re-start the app, or whether it caches the result for subsequent uses. (I had an experience in the mountains with three different compass apps that had me questioning the use of battery-powered technology)
In any event, fire up the app and rotate the tablet twice around each of it's three axes (X, Y, Z). Be careful that you don't drop the tablet! (I notice that when I do it I am trying to keep my hands away from the touchscreen, and so the grip I have isn't very solid)
If N is not in the correct place (allowing for local declination offsets), then maybe you have bad hardware or maybe your table your tablet is sitting on has a big piece of metal under it.
Spinning compass sounds like broken hardware, the Bermuda Triangle, or just noise (nearby power mains can cause a 60 Hz mag field wobble if they carry unbalanced currents - I use to work in a joint where everybody in one section of the building had CRTs that wobbled all the time). I think the GPS status app has an adjustable sensor filter, does it not (Menu-> GPS & Sensors -> Sensor Filtering - try medium or strong filtering maybe?
good luck
Click to expand...
Click to collapse
i already done the calibration , in fact i done it in 2 different places, one in the coffee shop which i awkwardly spin the tablet around, haha. but the compass still rotating steadily in clockwise direction , tried to calibrate again in my home with no avail.
And yes, i set my sensor filtering to medium, but this setting look like only affecting gps, not the magnetic sensor.
can you try installing GPS status app ?
https://play.google.com/store/apps/details?id=com.eclipsim.gpsstatus2&hl=en
and see if your compass is steadily moving or can point to the right direction when you put it on a table.
Working OK. Tried 3 different apps w/ compass
- GPS Status (eclipsim)
- Analog Compass (Dieter Roth)
- GPS Essentials (mictale)
Working fine here. Try taking your Nexus 7 out of the case, if it's in one. Run the app, hold the N7 FIRMLY (or do this over carpet, soft surface) and rotate in all directions. I usually draw a figure 8 in the horizontal and vertical directions.
Easy on the phone, harder on the Nexus 7 since it's larger.
Odd that it's rotating. My wifes old Aria I use for geocaching I left on top of a Nook Color case and screwed up its compass and it just gets stuck.. It'll rotate through about 270 degrees then get completely stuck the other 90. I've degaussed it a few times and that helped a little, as it mostly rotates now, but it's still not accurate. It might be 15-20 degrees off, as it still 'sticks' here and there.
PSA: The Nexus 7 compass is pretty funky period. I remembered this as I was testing just now. The compass will randomly for no reason go off about 90 degrees and rotating it around figure 8's will sometimes fix it, but most often just spinning it in place clockwise and counter-clockwise and it'll suddenly pop back to proper alignment. Don't depend on the N7's compass in a L&D Situation
Does the compass rotate when you are moving? If it only has a GPS input then if you are stationary it cannot resolve direction to any accuracy.
peterk-1 said:
Does the compass rotate when you are moving? If it only has a GPS input then if you are stationary it cannot resolve direction to any accuracy.
Click to expand...
Click to collapse
The Nexus 7 has a compass, so unless whatever app he's using has been told (or defaults to) GPS for the heading, it should be using the real compass.
khaytsus said:
The Nexus 7 has a compass, so unless whatever app he's using has been told (or defaults to) GPS for the heading, it should be using the real compass.
Click to expand...
Click to collapse
That's the point I was making. It is not know what sensors are being used. I would expect the app to use the x,y,z readings from the position sensor ( The "angle" the device is being held at) and the geomagnetic sensor but it may also use the GPS receiver to derive a direction of motion. The algorithm that pulls these readings together is the clever bit and the weight it gives to each sensor reading when it is outside expected values is the unknown / interesting bit.
bftb0 said:
Working OK. Tried 3 different apps w/ compass
- GPS Status (eclipsim)
- Analog Compass (Dieter Roth)
- GPS Essentials (mictale)
Click to expand...
Click to collapse
hmm, it seems like in a rare case, the compass can point at the right direction, but mostly keep rotating..
khaytsus said:
Working fine here. Try taking your Nexus 7 out of the case, if it's in one. Run the app, hold the N7 FIRMLY (or do this over carpet, soft surface) and rotate in all directions. I usually draw a figure 8 in the horizontal and vertical directions.
Easy on the phone, harder on the Nexus 7 since it's larger.
Odd that it's rotating. My wifes old Aria I use for geocaching I left on top of a Nook Color case and screwed up its compass and it just gets stuck.. It'll rotate through about 270 degrees then get completely stuck the other 90. I've degaussed it a few times and that helped a little, as it mostly rotates now, but it's still not accurate. It might be 15-20 degrees off, as it still 'sticks' here and there.
PSA: The Nexus 7 compass is pretty funky period. I remembered this as I was testing just now. The compass will randomly for no reason go off about 90 degrees and rotating it around figure 8's will sometimes fix it, but most often just spinning it in place clockwise and counter-clockwise and it'll suddenly pop back to proper alignment. Don't depend on the N7's compass in a L&D Situation
Click to expand...
Click to collapse
yeah i already tried to take off the case and check the compass, but still got the rotating compass, i even tried different roms, was in stock rom and now using CleanRom.
i wouldn't trust my electronics in a life and death situation, except if i didnt have anything better
peterk-1 said:
Does the compass rotate when you are moving? If it only has a GPS input then if you are stationary it cannot resolve direction to any accuracy.
Click to expand...
Click to collapse
even when i put it on the table, the compass keep moving
peterk-1 said:
That's the point I was making. It is not know what sensors are being used. I would expect the app to use the x,y,z readings from the position sensor ( The "angle" the device is being held at) and the geomagnetic sensor but it may also use the GPS receiver to derive a direction of motion. The algorithm that pulls these readings together is the clever bit and the weight it gives to each sensor reading when it is outside expected values is the unknown / interesting bit.
Click to expand...
Click to collapse
it doesnt matter wether the GPS is locking or not, the compass keep rotating
i'm trying to make a video of this behavior, maybe i'll make it tomorrow, it's already night time , and my room's light is not bright enough..
hopefully, i'll update the OP tomorrow, with video
I'm having the same issue on the N7 I just got, it happens in any ROM I've tried so far (stock, CM 10.1, Paranoid Android 2.99, SmoothROM v4.3, etc) - when I use the GPS Status app to calibrate the compass as required it will get the accurate North heading as it should, but then the compass itself just kinda drifts in a clockwise direction a few degrees every second, and that's with the N7 immobile itself and not in motion.
I'm guessing it's just an issue with the hardware since it happens with any ROM I've tested so far, but I haven't tried any other compass apps so I suppose I should, but the apps are just pulling info from the compass hardware so, if that's just defective or not working right then yes the on-screen display is going to keep right on moving.
Also, the calibration(s) I'm doing isn't sticking: the N7 either forgets it immediately or again there's something defective about it because when I do a calibration and close the app and restart it, it's not showing the correct directional orientation that I just calibrated it to
Weird behavior, certainly. This isn't a life or death thing since I know where I'm at here in Vegas at any time, but considering how amazing the N7 is overall, little things like this just irk the hell out of me (and apparently other owners as well).
Always the Compass
I got my hands on a 2nd hand N7 32G-WiFi, and any ROM (even stock 5.1.1 up to custom 7.1.1) displays the same non working compass with GPS Status (and other apps), the compass is stuck pointing to North and/or then jumping around as I rotate the tablet . GPS alone is working.
Interestingly there's now a "diagnose sensors" tab in GPS Status, and there the "Orientation" and "Rotation Vector" readings are coherent: I can read the angle to which the tablet is pointing (respect to north) and it correctly senses it. Same goes for the Rotation Vector, once the "calibration pattern" is done (move anytime the table 1-2 time around the 3 main axis), the readings settle down and are repeatable:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
(image cut to reduce size) In this case the tablet was on the table pointing north and not being moved.
So, the sensors inside the tablet are operating correctly! Still I don't understand why Google Maps (blue triangle) and/or Nokia Here wego (green arrow), and any other, cannot simply access these sensor readings. Are there other emulated "software sensors"? Do they wrongly correlate other readings inside the apps?
Interestingly I flashed this ROM lineage-11-20170221-UNOFFICIAL-grouper and there GPS Status compass display is correct! Same goes for Here wego, but Google Maps is still a miss.. clearly it's using other (hidden) sensor APIs and doing it wrong.
Some old apps, like "Check My Android" under the "Compass" sensor they are displaying directly the "Orientation" hardware sensor, no wonder if they work :good:
I'm going to use it as navigator inside the car, so I'll stick with Lineage 11 and hope app support will last long.. but I'm literally dying of curiosity on how and were are these sensor being interpreted from the apps/os.
I'd really like to get in touch with some developers, at least to pass the word and get to know a little more about the physical sensor subsystem inside android (I get the feeling on KK some "advanced emulated" sensor are not available, hence the app does a fallback on simply raw sensor values).
I understand that you always need to compensate raw sensor values, the simple compass might work ok when the tablet is flat on a surface, but then it must be adjusted if it's being held by the user plus if it's in portrait mode or landscape - with the only basic assumption that.. the screen is pointing the user
If I find something I'll report back, I really hope to discover something
(Found this old thread, using it instead of opening a new one)

Resources