I use in my app TLocationSensor on Android but I have a problem with Distance property. If I set 10 meters and I don't move OnLocationChange is fired.
What should I set and how to make it work ?
Probably the XE5's location sensor component does work - it is just the device incapable of providing Delphi accurate enough data under given circumstances.
You can take some mapping software like MapSoft Navigator and record a track for few hours. If that track would show the significant deviations, then it means the device thinks it is being sporadically moved. And it reports those movements to Delphi, which triggers the events.
See the data presumably gathered under open skies, even without reinforced concrete walls making reflections and distortions: https://gis.stackexchange.com/questions/12011
Related
I am biggener in android. I am trying to implement a fitness app that can keep track of the running speed and running distance in Android. How can i calculate the above mentioned things ?
In theory you could analyse windows of accelerometer data and count the number of peaks and the forces of those to determine running. Then, if the user has entered an average step distance, that could give an equation of distance.
Would be a lot easier using GPS as it provides the speed directly.
You might be interested in this library: https://github.com/mcharmas/Android-ReactiveLocation I recently added Activity Recognition, which can tell you whenever a user starts running. Might take a little while from one begins to run before the phone 'knows' that as being the activity, though.
I am working on an app that will leverage the geolocation to update the location of either vehicles or other "parked" items within a specific area, either large parking lot or other outdoor facility. I can build this app either as an HTML5 app and use phonegap to distribute it to both ios and android or I can build as an ios native app. My first question is in regards to which is more accurate the native ios geolocation services or the HTML5 (I am assuming browser) capabilities? My second question is, in order for me to get the most accurate reading, will I need to know the coordinates for the boundries of the area in question and then calculate position based on the users location in regards to the boundries? (is this triangulation?) Obviously I have never done anything like this so I am looking for guidance and logic not code. Also I really need to know how to get the greatest accuracy as I have mocked up this app using HTML5 and phone gap and I am not very happy with the level of accuracy. Thanks for your help.
The level of accuracy available to either a native app or HTML5 app is the same. It depends on which mechanism on the device you use to determine position as to the accuracy delivered to your app. The most accurate position that can be obtained is via GPS, as opposed to phone signal triangulation or a WiFi connection. The accuracy of the GPS position you receive isn't related to the mechanism you use to implement your app (native or HTML5) but a function of the hardware that the device is running (i.e. the GPS receiver), the geographical location, weather conditions, etc.
In answer to your second question, there's nothing you need to (or can) do in terms of implementing your app to improve the accuracy of the GPS position you receive. You can, however, choose to ignore readings which are outside of minimum level of accuracy (the data returned in the geolocation message contains an estimated level of accuracy).
I've implemented an app using Phonegap and during testing found the average accuracy of the GPS positions returned to be within 2 to 6 metres depending on the device.
If you're using Phonegap, make sure to use the "enableHighAccuracy" parameter when requesting a position to make sure a GPS fix is requested from the underlying OS. Beware though that even if you do this, inaccurate positions can still be returned so it's best to set up a filter to reject any that are too inaccurate.
Hope this helps.
I want to know current speed of car and make a passed path. I have an Android phone with accelerometer and gyroscope which sent me data. This is the data in phone system of coordinate that probably wouldn't the same as coordiante system of car.
How I can transform this accelerations and rotations to car system of coordinate?
The generic answer for your generic question is no. The acceleration measures the changes in the speed, so the best you could get from acceleration, is the speed variation.
To get the absolute speed you would have to have the initial speed and add it to the speed change:
v(t) = v0 + a*t
So, if you would have a car moving along a straight line, and your device was fixed to the car, you could get easly the speed changes (although measurements errors will add up and quickly lead to discrepancies)
In practice you will face many issues trying to implement it, namely:
You need the initial speed to be determinate based on the same referential as the acceleration. This would require some measurements and a lot of trignometry, as you would get both values from different sensores at different rates.
The car will not move in a straight line, so your acceleration referential will be constantly moving (a lot more of trignometry and calculus).
If the device is in the user hand, the device movements in relation to the car will increase even more the calculations (and accumulated errors).
Regards.
You need some sort of external reference (e.g. GPS is such a thing): If you just integrate the acceleration, the error will go indefinitely.
Because these sensors are not accurate enough. the error will quickly get out of control. (The linked answer is about position but the same holds for the velocity.)
In case of a car, you are better off with the GPS. If want to do something fancy, you could enforce the environmental constraints deduced from a map, that is, assume that the car goes on a road and not through buildings, etc. You will find more details on this in Chapter 5 of the PhD thesis entitled Pedestrian Localisation for Indoor Environments.
It looks like it's possible to do. I don't have an Android specific example but this forum has quite a lot of chat about it: http://www.edaboard.com/thread119232.html
It would be a lot easier if you used the Android Location class though. Specifically the getSpeed() method should give you what you need: http://developer.android.com/reference/android/location/Location.html
The Location class relies on a location provider though so your app will require appropriate permissions.
Both dont deliver anything if the car travels at the same constant speed for some time. The only way would be GPS which has a calculated speed with every location it provides.
After doing some asking around and reading, it sounds like you're lucky to get even within 10 meters of accuracy with a GPS on a mobile device (specifically Android).
I've seen a video that shows a home-made device reading out to several decimals. Is this only because of the data format from the chip? (aka, not really precise either?)
Is there any real working way that I can use an Android device to track real static positions within rooms in a building?
Ideally, I'd be able to mark a point in a room and come back to it later with virtually no drift.
The LocationProvider is different from each Android Device you are using. The SDK does not handle the calculation of your exact location but the phone does. But each device can have one or mare LocationProvider, thats why you need to set some Criterias when your picking a LocationProvider.
To get your exact position on the earth the GPS needs 3 points from 3 different satellites. Thats why the GPS works best in the open space. Regarding making a precise calculation on a static persion inside a building, this conflict with the whole scenario of the GPS-System. I'm not saying it's impossible to get a location inside a building but as with any other signals, obstacles that blocks the signal makes is weaker.
If you are inside a barn with thin walls this might work, but inside a 10 storage building your scenario seems quite impossible.
You can though force your phone to get the best LocationProvider and hopefully that will give you the most precise location. And yes, you can get inside 1-2m in precision outside.
I hope this helps a little. Enjoy your project.
I'm making an application that works as a compass..
I'm using the accelerometer and the magnetic field sensors to compute the azimuth angle through, sensor.getOrientation().
I'm searching for something that can improve the magnetic field sensor accuracy, since I'm getting it state of accuracy as UNRELIABLE!
Any one knows anything about this?I'm looking for something that can be either hardcoded or for instance just physically moving the phone until it gets calibrated!
This is not a final answer (I don't know anything for sure), but my understanding from online posts is that waving the phone around in a figure of 8 a few times while the compass is in use is supposed to trigger automatic recalibration. This is what the google maps app suggests, for example. I don't know whether this is dependent on application functionality (something in maps that detects the waving by accelerometer and triggers a recalibration), or something in the android stack, or something specific to per-phone implementations. Try it and see!
Eg discussion: http://androidforums.com/epic-4g-support-troubleshooting/217317-cant-get-compass-calibrate.html
This reference appears to suggest this per-axis / figure-8 rotation process is built-in functionality: http://m.eclipsim.com/gpsstatus/
And here another article that claims this is built-in functionality, and that you don't even need to be running a compass-consuming app for the recalibration to work: http://www.ichimusai.org/2009/06/20/how-to-calibrate-the-htc-magic-compass/
Just a few points
The figure 8 motion works sometimes and not others, I have no idea why, they really need to have some kind of code based way to check if the 8 motion worked (Assuming that the physical motion is actually required)
They also need a way to detect that calibration is required, I looked at the code for the accuracy output (the unreliable constant) and once they send it to you they will not send it again, so for instance if you calibrate but then come within a strong magnetic field it will not resend (not sure why they did that)
One not completely reliable way to detect ongoing issues is that you can also use the magnetic sensor output and do something like field=sqrt(x*x+y*y+z*z) and check that field falls between say 25 and 65 and then ask the user to calibrate if it does not.
The bottom line after testing 18 phones is that I would never depend on a Android based compass with the current crop of phones, accuracy would always be in question.
I have also found even if you are lucky and have a fairly reliable phone you can never be sure that it's calibrated without checking it against a real compass, which kind of defeats the purpose.
NOTE: On a lot of the mis-behaving phones we have found that the sensor writes a calibration file and a tmp file with the same name. If you delete those files and re-boot the phones the calibration file is recreated with zero'd values and the cold start and general calibration problems resolve themselves.
The bad news is that they are stored in /data/misc and require root privileges to get at (thanks Google & Sensor mfg!) so even though I suspect this would solve a lot of problems for a lot of developers it just is not viable from a marketplace app perspective.
I am developing for Android. I'm using Titanium Alloy as development tool with the Titanium Geolocation module.
I have only tested 2 devices [Galaxy Note and S4] against a commercial magnetic compass. Following a calibration process [tilt along the 3 axis] and using 2 different compass apps and the app I'm working on, the Android compass seems accurate enough for basic use ... correlation was good enough for my purpose anyway. I also found the device compass reading to be very sensitive to other magnetic and electrical field interference ... initial mistake I made was to use the compass feature whilst device was in a device protector with a magnetic closure facility [quite common on tabs] ... this interference is particularly strong. I thus need to suggest to users of my app to remove device protectors, keep device free of other electronics and then do standard calibration before initializing the app.
Another option is:
Go To sensors menu: #*0#*
Then if you see a red line in Magnetic Sensor section and a Need for Calibration you should recalibrate your compass.
How;
According those guys;
Turn the Samsung Galaxy Mini S5 around all of its axes until the red
line in the black circle changes color from red to blue. You can also
run through a motion that follows the shape of an 8. It may be that
several attempts are needed to calibrate the compass...