DJI Mobile SDK Documentation

      class GimbalState

      @EXClassNullAway
      class GimbalState
      Package:dji.common.gimbal
      Description:

      This class provides the current state of the gimbal.

      Class Members:

      Information

      method getYawRelativeToAircraftHeading
      float getYawRelativeToAircraftHeading()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.YAW_ANGLE_WITH_AIRCRAFT_IN_DEGREE
      Description:

      This function will return the angle between gimbal and the drone heading.

      Return:
      floatA float value of yaw angle.


      Members

      Attitude
      method
      method getAttitudeInDegrees
      Attitude getAttitudeInDegrees()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.ATTITUDE_IN_DEGREES
      Description:

      The current gimbal attitude in degrees. Roll, pitch and yaw are 0 if the gimbal is level with the aircraft and points in the forward direction of North Pole.

      Return:
      AttitudeAn Attitude instance.
      Roll fine-tune
      method
      method getRollFineTuneInDegrees
      float getRollFineTuneInDegrees()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.ROLL_FINE_TUNE_IN_DEGREES
      Description:

      Returns the gimbal's roll fine-tuned value. The range for the fine-tuned value is [-10, 10] degrees. If the fine-tune value is negative, the gimbal will be fine- tuned to the specified number of degrees in the counterclockwise direction.

      Return:
      floatA float value.
      Pitch Fine Tune
      method
      method getPitchFineTuneInDegrees
      float getPitchFineTuneInDegrees()
      Package:dji.common.gimbal
      Description:

      Returns the gimbal's pitch fine-tuned value. The range for the fine-tuned value is [-10, 10] degrees. If the fine-tune value is negative, the gimbal will be fine-tuned to the specified number of degrees in the downward direction. It is only supported by Spark.

      Return:
      floatA float value.
      Fine Tuned Yaw
      method
      method getYawFineTuneInDegrees
      float getYawFineTuneInDegrees()
      Package:dji.common.gimbal
      Description:

      Returns the gimbal's yaw fine-tuned value. The range for the fine-tuned value is [-10, 10] degrees. If the fine-tune value is negative, the gimbal will be fine-tuned to the specified number of degrees in the port (left) direction. Only supported by DJI Mavic Air.

      Return:
      floatA float value.
      Work Mode
      method
      method getMode
      GimbalMode getMode()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.MODE
      Description:

      Returns the gimbal's current work mode.

      Return:
      GimbalModeA GimbalMode enum value.
      Check Mobile Device Mounted
      method
      method isMobileDeviceMounted
      boolean isMobileDeviceMounted()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.IS_MOBILE_DEVICE_MOUNTED
      Description:

      true if the mobile device is mounted on the gimbal.

      Return:
      booleanA boolean value.
      Check Motor Overloaded
      method
      method isMotorOverloaded
      boolean isMotorOverloaded()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.IS_MOTOR_OVER_LOADED
      Description:

      true if one of the gimbal motors is overloaded.

      Return:
      booleanA boolean value.


      Calibration

      Calibration Succeeded
      method
      method isCalibrationSuccessful
      boolean isCalibrationSuccessful()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.IS_CALIBRATION_SUCCESSFUL
      Description:

      true if the gimbal calibration succeeded.

      Return:
      booleanA boolean value.
      Calibrate
      method
      method isCalibrating
      boolean isCalibrating()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.IS_CALIBRATING
      Description:

      true if the gimbal is calibrating.

      Return:
      booleanA boolean value.
      method getCalibrationProgress
      int getCalibrationProgress()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.CALIBRATION_PROGRESS
      Description:

      Current progress (percentage) for calibration.

      Return:
      intAn int value.


      Reach Limit

      Pitch Reach Limit
      method
      method isPitchAtStop
      boolean isPitchAtStop()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.IS_PITCH_AT_STOP
      Description:

      true if the gimbal's pitch value is at its limit.

      Return:
      booleanA boolean value.
      Roll Reach Limit
      method
      method isRollAtStop
      boolean isRollAtStop()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.IS_ROLL_AT_STOP
      Description:

      true if the gimbal's roll value is at its limit.

      Return:
      booleanA boolean value.
      Yaw Reach Limit
      method
      method isYawAtStop
      boolean isYawAtStop()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.IS_YAW_AT_STOP
      Description:

      true if the gimbal's yaw value is at its limit.

      Return:
      booleanA boolean value.


      Balance

      Testing Payload Balance
      method
      method isBalanceTesting
      boolean isBalanceTesting()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.IS_TESTING_BALANCE
      Description:

      true if the gimbal is currently testing payload balance.

      Return:
      booleanA boolean value.
      Pitch Axis Balance Test Result
      method
      method getPitchBalanceTestResult
      BalanceTestResult getPitchBalanceTestResult()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.PITCH_TEST_RESULT
      Description:

      Returns the pitch axis balance test result.

      Return:
      BalanceTestResultA BalanceTestResult enum value.
      Roll Axis Balance Test Result
      method
      method getRollBalanceTestResult
      BalanceTestResult getRollBalanceTestResult()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.ROLL_TEST_RESULT
      Description:

      Returns the roll axis balance test result.

      Return:
      BalanceTestResultA BalanceTestResult enum value.
      Gimbal Balance State
      method
      method getBalanceState
      BalanceState getBalanceState()
      Package:dji.common.gimbal
      SDK Key:GimbalKey.BALANCE_STATE
      Description:

      Returns the balance status of the gimbal.

      Return:
      BalanceStateA BalanceState enum value.
      Mounted Upwards
      method
      method isMountedUpwards
      boolean isMountedUpwards()
      Package:dji.common.gimbal
      Description:

      true if the gimbal is mounted upwards on the aircraft. It is only supported by M210 and M210 RTK.

      Return:
      booleanA boolean value.