Hello,
I have tried the function GetMagnetometer in order to get the Magnetometer values.
It's look nice, nevertheless I would like to know how I can get the corrected values "CLHeading" & "CMCalibratedMagneticField".
According to the Apple docs - we have:
// This delegate method is invoked when the location manager has heading data.
- (void)locationManager: (CLLocationManager *)manager didUpdateHeading: (CLHeading *)heading {
// Update the labels with the raw x, y, and z values.
self.xLabel.text = [NSString stringWithFormat: @"%.1f", heading.x];
self.yLabel.text = [NSString stringWithFormat: @"%.1f", heading.y];
self.zLabel.text = [NSString stringWithFormat: @"%.1f", heading.z];
}
Could you advice me (may be with Inline objective C Code) in order to get these values (CLHeading [x|y|z] and CMCalibratedMagneticField).
Thanks.
I have tried the function GetMagnetometer in order to get the Magnetometer values.
It's look nice, nevertheless I would like to know how I can get the corrected values "CLHeading" & "CMCalibratedMagneticField".
According to the Apple docs - we have:
- CMMagnetometer : Raw readings from the magnetometer
- CMDeviceMotion (CMCalibratedMagneticField*) magneticField : Magnetometer readings corrected for device bias (onboard magnetic fields)
- LHeading [x|y|z] : Magnetometer readings corrected for device bias and filtered to eliminate local external magnetic fields (as detected by device movement - if the field moves with the device, ignore it; otherwise measure it).
// This delegate method is invoked when the location manager has heading data.
- (void)locationManager: (CLLocationManager *)manager didUpdateHeading: (CLHeading *)heading {
// Update the labels with the raw x, y, and z values.
self.xLabel.text = [NSString stringWithFormat: @"%.1f", heading.x];
self.yLabel.text = [NSString stringWithFormat: @"%.1f", heading.y];
self.zLabel.text = [NSString stringWithFormat: @"%.1f", heading.z];
}
Could you advice me (may be with Inline objective C Code) in order to get these values (CLHeading [x|y|z] and CMCalibratedMagneticField).
Thanks.