DJICompass

@interface DJICompass : NSObject

This class contains important status for the compass of the product, and provides methods to calibrate the compass. Products with multiple compasses (like the Phantom 4) will have their compass state fused into one compass class for simplicity.

  • Represents the heading in degrees. True North is 0 degrees, positive heading is East of North, negative heading is West of North and heading bounds are [-180, 180].

    Declaration

    Objective-C

    @property (readonly, nonatomic) double heading;
  • YES if the compass has an error. If YES, the compass needs calibration.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL hasError;
  • YES if the compass is currently calibrating.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL isCalibrating;
  • Shows the calibration status.

    Declaration

    Objective-C

    @property (readonly, nonatomic) DJICompassCalibrationStatus calibrationStatus;
  • Starts compass calibration. Make sure there are no magnets or metal objects near the compass.

    Declaration

    Objective-C

    - (void)startCalibrationWithCompletion:(DJICompletionBlock)completion;
  • Stops compass calibration.

    Declaration

    Objective-C

    - (void)stopCalibrationWithCompletion:(DJICompletionBlock)completion;