DJIGimbal

@interface DJIGimbal : DJIBaseComponent

This class provides multiple methods to control the gimbal. These include setting the gimbal work mode, rotating the gimbal with angle, starting the gimbal auto calibration, etc.

  • Returns the delegate of DJIGimbal.

    Declaration

    Objective-C

    @property (readwrite, nonatomic) id<DJIGimbalDelegate> _Nullable delegate;
  • Returns the latest gimbal attitude data, or nil if none is available.

    @deprecated Duplicated with the one in DJIGimbalState.

    Declaration

    Objective-C

    @property (readonly, nonatomic) DJIGimbalAttitude attitudeInDegrees;
  • Sets the completion time, in seconds, to complete an action to control the gimbal. If the method rotateGimbalWithAngleMode:pitch:roll:yaw:withCompletion is used to control the gimbal’s absolute angle,this property will be used to determine in what duration of time the gimbal should rotate to its new position. For example, if the value of this property is set to 2.0 seconds, the gimbal will rotate to its target position in 2.0 seconds. Range is [0.1, 25.5] seconds.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        double completionTimeForControlAngleAction;
  • Returns the gimbal’s features and possible range of settings. Each dictionary key is a possible gimbal feature and uses the DJIGimbalParam prefix. The value for each key is an instance of DJIParamCapability or its sub-classes. The isSupported property can be used to query if a feature is supported by the gimbal and the min and max properties of DJIParamCapabilityMinMax can be used to query the valid range for the setting. When a feature is not supported, the values for min and max are undefined.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSDictionary *_Nonnull gimbalCapability;
  • Sets the gimbal’s work mode. See enum DJIGimbalWorkMode for modes.

    Declaration

    Objective-C

    - (void)setGimbalWorkMode:(DJIGimbalWorkMode)workMode
               withCompletion:(DJICompletionBlock)block;

    Parameters

    workMode

    Gimbal work mode to be set.

    block

    Remote execution result error block.

  • Rotate the gimbal’s pitch, roll, and yaw in Angle Mode. See gimbalCapability for which axes can be moved for the gimbal being used.

    Declaration

    Objective-C

    - (void)rotateGimbalWithAngleMode:(DJIGimbalRotateAngleMode)angleMode
                                pitch:(DJIGimbalAngleRotation)pitch
                                 roll:(DJIGimbalAngleRotation)roll
                                  yaw:(DJIGimbalAngleRotation)yaw
                       withCompletion:(DJICompletionBlock)block;

    Parameters

    pitch

    Gimbal’s pitch rotation.

    roll

    Gimbal’s roll rotation.

    yaw

    Gimbal’s yaw rotation.

    block

    Execution result error block.

  • Rotate the gimbal’s pitch, roll, and yaw using speed. The direction can either be set to clockwise or counter-clockwise. See gimbalCapability for which axes can be moved for the gimbal being used.

    Declaration

    Objective-C

    - (void)rotateGimbalBySpeedWithPitch:(DJIGimbalSpeedRotation)pitch
                                    roll:(DJIGimbalSpeedRotation)roll
                                     yaw:(DJIGimbalSpeedRotation)yaw
                          withCompletion:(DJICompletionBlock)block;

    Parameters

    pitch

    Gimbal’s pitch rotation.

    roll

    Gimbal’s roll rotation.

    yaw

    Gimbal’s yaw rotation.

    block

    Execution result error block.

  • Resets the gimbal. The behaviors are product-dependent. Osmo series (e.g. Osmo, Osmo Pro): The gimbal’s pitch and yaw will be set to the origin, which is the standard position for the gimbal. Phantom series (e.g. Phantom 3 Professional, Phantom 4 series): The first call sets gimbal to point down vertically to the earth. The second call sets gimbal to the standard position. Other products (e.g. Inspire 1): Only the gimbal’s pitch will the set to the origin.

    Declaration

    Objective-C

    - (void)resetGimbalWithCompletion:(DJICompletionBlock)block;

    Parameters

    block

    Remote execution result error block.

  • Starts calibrating the gimbal. The product should be stationary (not flying, or being held) and horizontal during calibration. For gimbal’s with adjustable payloads, the payload should be present and balanced before doing a calibration.

    Declaration

    Objective-C

    - (void)startGimbalAutoCalibrationWithCompletion:(DJICompletionBlock)block;

    Parameters

    block

    Remote execution result error block.

  • The gimbal roll can be fine tuned with a custom offset. The range for the custom offset is [-2.0, 2.0] degrees. If the offset is negative, the gimbal will be fine tuned the specified number of degrees in the counterclockwise direction.

    Declaration

    Objective-C

    - (void)fineTuneGimbalRollInDegrees:(float)offset
                         withCompletion:(DJICompletionBlock)block;

    Parameters

    offset

    Fine-tuned offset, in degrees, to be tuned.

    block

    Completion block.

  • Starts testing the balance of the gimbal payload. For gimbals that allow payloads to be changed, a balance test should be performed to ensure the camera is mounted correctly. The product should be stationary (not flying, or being held) and horizontal during testing. See DJIGimbalState for the test result. Only supported by Ronin-MX.

    Declaration

    Objective-C

    - (void)startGimbalBalanceTestWithCompletion:(DJICompletionBlock)block;

    Parameters

    block

    Completion block that receives the execution result. The completion block will return when the balance test is successfully started.

  • Sets the advanced settings profile. The advanced settings profile has options for both preset and custom profiles for SmoothTrack and Controller settings. Settings for SmoothTrack and Controller can only be set manually when using a custom profile. Use DJIGimbalParamAdvancedSettingsProfile in gimbalCapability to check if it is supported by the gimbal. Only supported by Osmo.

    Declaration

    Objective-C

    - (void)setAdvancedSettingsProfile:(DJIGimbalAdvancedSettingsProfile)profile
                        withCompletion:(DJICompletionBlock)block;

    Parameters

    profile

    Profile to set.

    block

    Completion block that receives the execution result.

  • Gets the advanced settings profile. Use DJIGimbalParamAdvancedSettingsProfile to check if it is supported by the gimbal. Only supported by Osmo.

    Declaration

    Objective-C

    - (void)getAdvancedSettingsProfileWithCompletion:
        (void (^_Nonnull)(DJIGimbalAdvancedSettingsProfile,
                          NSError *_Nullable))block;

    Parameters

    block

    Completion block that receives the execution result.

  • Restores the gimbal’s settings to factory settings.

    Declaration

    Objective-C

    - (void)loadFactorySettings:(DJICompletionBlock)block;

    Parameters

    block

    The completion block that receives execution result.

  • Extends the pitch range of gimbal. Currently, it is only supported by Phantom 3 Series, Phantom 4 and Phantom 4 Pro. If extended, the gimbal’s pitch control range can be [-30, 90], otherwise, it’s [0, 90]. Use DJIGimbalParamPitchRangeExtension to check if it is supported by the gimbal.

    Declaration

    Objective-C

    - (void)setPitchRangeExtensionEnabled:(BOOL)shouldExtend
                           withCompletion:(DJICompletionBlock)block;

    Parameters

    shouldExtend

    Whether the pitch range should be extended

    block

    The completion block that receives execution result.

  • Get the extend gimbal pitch range state. Use DJIGimbalParamPitchRangeExtension to check if it is supported by the gimbal.

    Declaration

    Objective-C

    - (void)getPitchRangeExtensionEnabledWithCompletion:
        (void (^_Nonnull)(BOOL, NSError *_Nullable))block;

    Parameters

    shouldExtend

    Whether the pitch range should be extended

    block

    The completion block that receives execution result.

  • Sets physical controller (e.g. the joystick on Osmo or the remote controller of the aircraft) deadband on an axis. A larger deadband requires more controller movement to start gimbal motion. Use DJIGimbalParamControllerDeadbandYaw and DJIGimbalParamControllerDeadbandPitch with gimbalCapability to check if the gimbal supports this feature and the range of possible values (unitless).

    Declaration

    Objective-C

    - (void)setControllerDeadband:(NSInteger)deadband
                           onAxis:(DJIGimbalAxis)axis
                   withCompletion:(DJICompletionBlock)block;

    Parameters

    deadband

    The deadband value to be set.

    axis

    The axis that the setting will be applied to.

    block

    The completion block that receives execution result.

  • Gets physical controller deadband value on an axis. A larger deadband requires more controller movement to start gimbal motion. Use DJIGimbalParamControllerDeadbandYaw and DJIGimbalParamControllerDeadbandPitch with gimbalCapability to check if the gimbal supports this feature and the range of possible values (unitless).

    Declaration

    Objective-C

    - (void)getControllerDeadbandOnAxis:(DJIGimbalAxis)axis
                         withCompletion:
                             (void (^_Nonnull)(NSInteger, NSError *_Nullable))block;

    Parameters

    axis

    The axis to query.

    block

    The completion block that receives execution result.

  • Sets physical controller (e.g. the joystick on Osmo or the remote controller of the aircraft) speed on an axis. Speed setting controls the mapping between the movement of the controller and the gimbal speed. Use DJIGimbalParamControllerSpeedYaw and DJIGimbalParamControllerSpeedPitch with gimbalCapability to check if the gimbal supports this feature and the range of possible values (unitless).

    Declaration

    Objective-C

    - (void)setControllerSpeed:(NSInteger)speed
                        onAxis:(DJIGimbalAxis)axis
                withCompletion:(DJICompletionBlock)block;

    Parameters

    speed

    The speed value to be set.

    axis

    The axis that the setting will be applied to.

    block

    The completion block that receives execution result.

  • Gets physical controller speed value on an axis. Speed setting controls the mapping between the movement of the controller and the gimbal speed. Use DJIGimbalParamControllerSpeedYaw and DJIGimbalParamControllerSpeedPitch with gimbalCapability to check if the gimbal supports this feature and the range of possible values (unitless).

    Declaration

    Objective-C

    - (void)getControllerSpeedOnAxis:(DJIGimbalAxis)axis
                      withCompletion:
                          (void (^_Nonnull)(NSInteger, NSError *_Nullable))block;

    Parameters

    axis

    The axis to query.

    block

    The completion block that receives execution result.

  • Sets physical controller (e.g. the joystick on Osmo or the remote controller of the aircraft) smoothing on an axis. Smoothing controls the deceleration of the gimbal. Use DJIGimbalParamControllerSmoothingYaw and DJIGimbalParamControllerSmoothingPitch with gimbalCapability to check if the gimbal supports this feature and the range of possible values (unitless).

    Declaration

    Objective-C

    - (void)setControllerSmoothing:(NSInteger)smoothing
                            onAxis:(DJIGimbalAxis)axis
                    withCompletion:(DJICompletionBlock)block;

    Parameters

    smoothing

    The smoothing value to be set.

    axis

    The axis that the setting will be applied to.

    block

    The completion block that receives execution result.

  • Gets physical controller smoothing value on an axis. Smoothing controls the deceleration of the gimbal. Use DJIGimbalParamControllerSmoothingYaw and DJIGimbalParamControllerSmoothingPitch with gimbalCapability to check if the gimbal supports this feature and the range of possible values (unitless).

    Declaration

    Objective-C

    - (void)getControllerSmoothingOnAxis:(DJIGimbalAxis)axis
                          withCompletion:
                              (void (^_Nonnull)(NSInteger,
                                                NSError *_Nullable))block;

    Parameters

    axis

    The axis to query.

    block

    The completion block that receives execution result.

  • Allows the camera to be mounted in the upright position (on top of the aircraft instead of underneath). Only supported by Ronin-MX.

    Declaration

    Objective-C

    - (void)setCameraUprightEnabled:(BOOL)enabled
                     withCompletion:(DJICompletionBlock)block;

    Parameters

    enabled

    YES to allow the camera to be upright.

    block

    The completion block that receives execution result.

  • Gets if the camera is allowed to be in the upright position. Only supported by Ronin-MX.

    Declaration

    Objective-C

    - (void)getCameraUprightEnabledWithCompletion:
        (void (^_Nonnull)(BOOL, NSError *_Nullable))block;

    Parameters

    block

    The completion block that receives execution result.

  • Turns on and off the gimbal motors. NO means the gimbal power remains on, however the motors will not work. Only supported by Ronin-MX.

    Declaration

    Objective-C

    - (void)setMotorEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)block;

    Parameters

    enabled

    YES to enable the motor.

    block

    The completion block that receives execution result.

  • Gets if the gimbal motors are enabled to work or not. Only supported by Ronin-MX.

    Declaration

    Objective-C

    - (void)getMotorEnabledWithCompletion:
        (void (^_Nonnull)(BOOL, NSError *_Nullable))block;

    Parameters

    block

    The completion block that receives execution result.

  • Resets gimbal position to selfie setup. If the gimbal yaw is not at 180 degrees, then calling this method will rotate the gimbal yaw to 180 degrees (effectively pointing the camera to the person holding the gimbal). If the gimbal yaw is at 180 degrees, then the gimbal will rotate in yaw to 0 degrees. Only supported by Osmo.

    Declaration

    Objective-C

    - (void)toggleGimbalSelfieWithCompletion:(DJICompletionBlock)block;

    Parameters

    block

    The completion block that receives execution result.

  • Sets the gimbal’s controller mode. The control mode for the gimbal controller (joystick for Osmo). The total controller deflection is a combination of horizontal and vertical deflection. This translates to gimbal movement around the yaw and pitch axes. The gimbal can be set to either move in both yaw and pitch simultaneously based on horizontal and vertical deflection of the controller, or move in only yaw or pitch exclusively based on whether horizontal or vertical deflection is larger. Only supported by Osmo.

    Declaration

    Objective-C

    - (void)setGimbalControllerMode:(DJIGimbalControllerMode)controlMode
                     withCompletion:(DJICompletionBlock)block;

    Parameters

    controlMode

    The stick control mode to set.

    block

    The completion block that receives execution result.

  • Gets the gimbal’s controller mode. Only supported by Osmo.

    Declaration

    Objective-C

    - (void)getGimbalControllerModeWithCompletion:
        (void (^_Nonnull)(DJIGimbalControllerMode, NSError *_Nullable))block;

    Parameters

    block

    The completion block that receives execution result.

  • Inverts the physical control for gimbal movement on an axis. It is only supported by Osmo Mobile. The setting can only be applied to the pitch or yaw axis.

    Declaration

    Objective-C

    - (void)setInvertControlEnabled:(BOOL)enabled
                             onAxis:(DJIGimbalAxis)axis
                     withCompletion:(DJICompletionBlock)block;

    Parameters

    enabled

    YES to enable inverted control.

    axis

    The axis that the setting will be applied to.

    block

    The completion block that receives execution result.

  • Gets if the physical control is inverted for gimbal movement on an axis. It is only supported by Osmo Mobile. The setting can only be applied to the pitch or yaw axis.

    Declaration

    Objective-C

    - (void)getInvertControlEnabledOnAxis:(DJIGimbalAxis)axis
                           withCompletion:
                               (void (^_Nonnull)(BOOL, NSError *_Nullable))block;

    Parameters

    axis

    The axis to query.

    block

    The completion block that receives execution result.