What should I do if the compass on two or more different devices give me different headings? I tried to calibrate the compass on devices but anyway sometimes they show me differents headings.
Since the iPhone compass "works just like a magnetic-needle compass":
The accuracy of digital compass headings can be affected by magnetic or other environmental interference, including interference caused by proximity to the magnets contained in the iPhone earbuds. The compass may need to be calibrated from time to time (Apple: iPhone and iPad: Calibrating Compass).
You have several options for fixing the compass:
Follow the directions! Move the device in a figure eight motion. However, this looks like it isn't working for you.
"[d]isregard the message to calibrate". Some areas have more magnetic interference than others, like in a car because of its dashboard. You can just leave it alone because "[t]he device will eventually recalibrate after several turns. Note that it may need to periodically recalibrate while you are driving, depending on the level of magnetic interference present."
Reboot (Not the "Slide to Power Off" reboot). Hold the power button and home button until the Apple logo appears.
I'm pretty sure those are your options. There may be more, so I'll do more research.
If you just want to see which compass is wrong, get a real compass and compare it to the headings on the two iPhones. Which ever one it matches up with, the other phone is wrong. If you don't have a real compass, you can follow this tutorial to make a homemade one (which is more fun)!
Hope this helps!
Well, if 2 iOS devices give you 2 different readings then at least one of them has uncalibrated hardware. So is this a hardware question? I don't think there is much to do in terms of the program, especially if you have no idea what the exact skew is.
Related
while in graduate school for biomedical eng I developed a device we called a "vein finder". It was a simple device that was good enough for our eng school to patent.
I think it would be very very easy to use the iphone camera to develop an iphone app whereby MD's/ nurses/EMT's could use the app to easily identify peripherial veins that are not visible to the naked eye. This would be invaluable in starting IV's and giving bedside medications. The vein finder was esp helpful for patients in shock who had poor venous filling and therefore didn't have veins that "popped into view" with a tourniquet.
It would require using the iphone light at specific wavelengths... anybody have any idea if that is possible?
I don't think you have any control over the flash light that illuminates images. You can only turn it on and off. I also doubt you would be able to get the specific wavelengths you need.
My suggestion would be to look into building a peripheral light device which plugs in to the headphone jack for power and has the necessary functions for emitting light at different wavelengths. That way, you would be able to get the exact result you require.
You may also need to look into the camera itself, as it may not have the ability to capture the light at the wavelengths you may require. Hope that Helps!
Do you mean overlaying veins over the picture on the camera? It would be easy if the veins are always in the same place... What would your imagined procedure be for using this app?
EDIT: You can not manipulate the iPhone light for different frequencies; you can only turn it on and off. You would need to get a separate external light for that.
To work around the fact that you can't set the wavelength of the built in light, you should use an external light along with the iOS device.
Apologies for massive necro!
The LED light of the iPhone is not the problem - most white light sources contain IR or near-IR (in fact they are made up from the entire visible spectrum). Daylight works very well too.
The problem is the receiver. Most camera lenses, including smartphones, have an IR filter - thus cutting out the useful part of the spectrum. All we need is a digital camera with IR filter removed, that has a viewfinder (where you'll see the veins).
Yeah, I'm currently wondering about this.
In my use case the devices will be 50cm to 10m apart and I'd like it to be accurate to at least 10 cm. (Therefore GPS is not an option)
2 Ways spring to mind:
Sound: I asked about this in the dev forums and I'm in contact with laanlabs, about the code of their sonar ruler.
Picture on one device + Camera on the other: Seems easier to set up, since my user case involves the user facing one device at 90 degrees anyway. But it would be more work for the user to face the camero into the direction and it would not react to a change in distance.
Now the question: Is anyone aware of any code that does something like this already? Possibly a non-iPhone general c-Project?
Method with camera: we already know size for each device. You take a picture of device, calculate it's height/width to determine type of device (iPhone/iPod or iPad), than calculate a distance.
For example - if device is iPhone you know, that its size is 115x58 mm. On picture it NxM pixels. Now you can calculate the distance. (If N & M smaller hence distance is larger)
If you were to use the sound method one approach would be to have device A emit a sound, device B would then be listening for this at all times and on detection echo back a secondary sound. This would give you a round-trip time from which you could calculate distance - don't forget to compensate for latency between detection re-emission as well.
I am not sure about but this is what i found from one of the answers in this previous SO question How to measure distance between two iphone devices using bluetooth?
Using bluetooth for localization is a very well known research field . The short answer is: you can't. Signal strength isn't a good indicator of distance between two connected bluetooth devices, because it is too much subject to environment condition (is there a person between the devices? How is the owner holding his/her device? Is there a wall? Are there any RF reflecting surfaces?). Using bluetooth you can at best obtain a distance resolution of few meters, but you can't calculate the direction, not even roughly.
You may obtain better results by using multiple bluetooth devices and triangulating the various signal strength, but even in this case it's hard to be more accurate than few meters in your estimates.
I need to create an iPhone simple view that, based on the location of the user in the world, points the person to a never-changing Long/Lat location.
Is it possible to know this from the iPhone API?
Any examples?
This is possible on the current (3GS) iPhone, but not on earlier versions (which did not have a compass). The APIs that you'll need to use are in the CoreLocation.framework.
Search the app store for "mecca" and you'll turn up many, many applications that do exactly what you're asking about. You'll also find several applications that let you drop a pin anywhere on the map and have the app point you to it.
I've recently written code that does almost exactly what you describe.
Here's what you ned to do:
Calculate a heading from your current location to your target location. You should use "great circle" calculations, so they show a correct heading even when the destination is over the horizon. I found code (in Javascript) at this link to show me how to do this:
http://www.movable-type.co.uk/scripts/latlong.html
You want the section titled "bearing"
That code uses javascript library routines like "math.sin(x)" You can pretty much just delete the "math." part, and the trig functions work as is.
That will give you your bearing in radians.
You then need to get your compass heading (if on a 3Gs phone), convert it to radians, and use the compass heading to correct for the orientation of the phone. If you're running on a 3G, you can skip the compass heading and show the bearing based on North being at the top of the phone, and let the user orient their phone towards North themselves.
Duncan C
I know that it's mostly "approximate".
But, I must know the EXACT location of the phone, regardless of battery life or whatever.
I need the exact location of the phone! Is it possible?
It depends on what you mean by exact!
Any location technology will have a level of accuracy and much of this depends on the hardware your using. Mil spec GPS will cost a lot more than the chipset in your iPhone and use a lot more power too.
The best I've managed to get using the browser with iPhone 3GS GPS in wide open space is +/-17m
Usually its best to design you application around this for example most turn by turn sat-nav assumes you must be on a road and correct the location for this.
Uncertainty principle says no.
Define 'exact' and then we'll tell you. If it doesn't move and you've got a month, then better than a millimeter is probably possible (they track earthquake faults this way). But if it's moving, or doesn't have a good view of the sky, then it's not going to work nearly so well. And the math to do long-term averaging is pretty heavy going.
From the point of view of fundamental physics this question is meaningless. No physical measurement can ever be EXACT. There is ALWAYS a tolerance. Even if you went back to your national datum point and surveyed your position back to the point in question there will be errors in the measurements taken that will result in a non exact position.
If you then put your device on the ground - where on the device are you measuring to - the top left corner, the intersection of the diagonals across the device, the antenna position...?
"Regardless of battery life" - are you implying that the position measurement must occur in the absence of power?
Look into fine GPS location in the location API's(on Android)...that's the most "exact" you're gonna get. If you get a good GPS lock it'll probably be <10 meters. I just tested while in my house and got <5 meters.
I saw at least 6 apps in AppStore that take photos when detect motion (i.e. a kind of Spy stuff). Does anybody know what is a general way to do such thing using iPhone SDK?
I guess their apps take photos each X seconds and compare current image with previous to determine if there any difference (read "motion"). Any better ideas?
Thank you!
You could probably also use the microphone to detect noise. That's actually how many security system motion detectors work - but they listen in on ultrasonic sound waves. The success of this greatly depends on the iPhone's mic sensitivity and what sort of API access you have to the signal. If the mic's not sensitive enough, listening for regular human-hearing-range noise might be good enough for your needs (although this isn't "true" motion-detection).
As for images - look into using some sort of string-edit-distance algorithm, but for images. Something that takes a picture every X amount of time, and compares it to the previous image taken. If the images are too different (edit distance too big), then the alarm sounds. This will account for slow changes in daylight, and will probably work better than taking a single reference image at the beginning of the surveillance period and then comparing all other images to that.
If you combine these two methods (image and sound), it may get you what you need.
You could have the phone detect light changes meaning using the sensor at the top front of the phone. I just don't know how you would access that part of the phone
I think you've about got it figured out- the phone probably keeps images where the delta between image B and image A is over some predefined threshold.
You'd have to find an image library written in Objective-C in order to do the analysis.
I have this application. I wrote a library for Delphi 10 years ago but the analysis is the same.
The point is to make a matrix from whole the screen, e.g. 25x25, and then make an average color for each cell. After that, compare the R,G,B,H,S,V of average color from one picture to another and, if the difference is more than set, you have motion.
In my application I use fragment shader to show motion in real time. Any question, feel free to ask ;)