Package: dji.sdk.flightcontroller Description:
This class provides compass status information and compass calibration methods. Products with multiple compasses (like the Phantom 4) have their compass state fused into one compass class for simplicity. Class Members:
Represents the heading, in degrees. True North is 0 degrees, positive heading is East of North, and negative heading is West of North. Heading bounds are [-180, 180]. Return:
float A double value of the heading, in degrees.
true if the compass has an error. If
true, the compass needs calibration.
true if the compass is currently calibrating.
CompassCalibrationState getCalibrationState () Description:
Shows the calibration status. Return:
void startCalibration (@Nullable final CompletionCallback callback) Description:
Starts compass calibration. Make sure there are no magnets or metal objects near the compass. Input Parameters:
@Nullable final CompletionCallback callback Completion callback. See DJIBaseComponent for more information about the callback and what is recommended be done with it.
void stopCalibration (@Nullable CompletionCallback callback) Description:
Stops compass calibration. Input Parameters:
@Nullable CompletionCallback callback Completion callback. See DJIBaseComponent for more information about the callback and what is recommended be done with it.
void setCalibrationStateCallback (@Nullable CompassCalibrationState.Callback callback) Description:
Sets the callback for compass calibration. Input Parameters:
enum CompassCalibrationState Description:
An enum class representing compass calibration. Enum Members:
NOT_CALIBRATING Normal state. Compass not in calibration. HORIZONTAL Compass horizontal calibration. The user should hold the aircraft horizontally and rotate it 360 degrees. VERTICAL Compass vertical calibration. The user should hold the aircraft vertically, with the nose pointed towards the ground, and rotate the aircraft 360 degrees. SUCCESSFUL Compass calibration succeeded. FAILED Compass calibration failed. Make sure there are no magnets or metal objects near the compass and retry. UNKNOWN Compass calibration status unknown. Class Members: