I use CoreMotion to get the ccompass header, and I noticed some problems with the compass header.
My initial initialization is CoreMotion. I got a CMMotionManager object, locationManager, which is an instance of CMMotionManager.
// initialize CoreMotion motionManager = [CMMotionManager new]; [motionManager setDeviceMotionUpdateInterval:1.0/30.0]; [motionManager setShowsDeviceMovementDisplay:YES]; [self.motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXTrueNorthZVertical];
Location data is updated every 1 / 30.0 seconds.
For debugging purposes, I have a UILabel that shows me the current compass header updated at every update interval. While the application starts, I always need to do magic 8 to calibrate the compass.
After calibrating the compass, the heading for north and south is correct for almost 2-5 seconds.
Immediately after a couple of seconds, the compass goes wild and the corners jump. Basically, his swimming is about 10-20 degrees from the starting position in both directions. Admitted to get a tougher result. After 30-60 seconds, each time the south and north intersect or show east and west.
At the WWDC 2011 session, they talked about how they calculate each sensor with another to compensate for these problems. Is there something that I missed when configuring CoreMotion that I have such huge problems with accurate course results?
I checked the compass now with 3 devices (2 iPhone 4 and iPhone 4) inside and outside the buildings. I was in the fields, in small towns and large cities. This happens all the time. Apple's compass application example is almost accurate with 90% accuracy in my tests. Unfortunately, Apple does not open it.
Thanks for reading.
iphone augmented-reality core-motion compass-geolocation
Dasfuxx
source share