GSGimbal

@objc
public protocol GSGimbal : Peripheral

Objective-C version of Gimbal.

The gimbal is the peripheral holding and orientating the camera. It can be a real mechanical gimbal, or a software one.

The gimbal can act on one or multiple axes. It can stabilize a given axis, meaning that the movement on this axis will be following the horizon (for .roll and .pitch) or the North (for the .yaw).

Note

This class is for Objective-C only and must not be used in Swift.
  • Offset correction process. Not nil when offset correction is started (see startOffsetsCorrectionProcess() and stopOffsetsCorrectionProcess()).

    Declaration

    Swift

    var offsetsCorrectionProcess: GimbalOffsetsCorrectionProcess? { get }
  • Whether the gimbal is calibrated.

    Declaration

    Swift

    var calibrated: Bool { get }
  • Calibration process state. See startCalibration() and cancelCalibration()

    Declaration

    Swift

    var calibrationProcessState: GimbalCalibrationProcessState { get }
  • Tells whether a given axis is supported

    Declaration

    Swift

    func isAxisSupported(_ axis: GimbalAxis) -> Bool

    Parameters

    axis

    the axis to query

    Return Value

    true if the axis is supported, false otherwise

  • Tells whether the gimbal currently has the given error.

    Declaration

    Swift

    func hasError(_ error: GimbalError) -> Bool

    Parameters

    error

    the error to query

    Return Value

    true if the error is currently happening

  • Tells whether a given axis is currently locked.

    While an axis is locked, you cannot set a speed or a position.

    An axis can be locked because the drone is controlling this axis on itself, thus it does not allow the controller to change its orientation. This might be the case during a FollowMe or when the PointOfInterestPilotingItf is active.

    Declaration

    Swift

    func isAxisLocked(_ axis: GimbalAxis) -> Bool

    Parameters

    axis

    the axis to query

    Return Value

    true if the axis is supported and locked, false otherwise

  • Gets the lower bound of the attitude on a given axis.

    Declaration

    Swift

    func attitudeLowerBound(onAxis axis: GimbalAxis) -> NSNumber?

    Parameters

    axis

    the axis

    Return Value

    a double in an NSNumber. nil if axis is not supported.

  • Gets the upper bound of the attitude on a given axis.

    Declaration

    Swift

    func attitudeUpperBound(onAxis axis: GimbalAxis) -> NSNumber?

    Parameters

    axis

    the axis

    Return Value

    a double in an NSNumber. nil if axis is not supported.

  • Gets the max speed setting on a given axis.

    Declaration

    Swift

    func maxSpeed(onAxis axis: GimbalAxis) -> DoubleSetting?

    Parameters

    axis

    the axis

    Return Value

    the max speed setting or nil if the axis is not supported.

  • Gets the stabilization setting on a given axis

    Declaration

    Swift

    func stabilization(onAxis axis: GimbalAxis) -> BoolSetting?

    Parameters

    axis

    the axis

    Return Value

    the stabilization setting or nil if the axis is not supported

  • Gets the current attitude on a given axis.

    Declaration

    Swift

    func currentAttitude(onAxis axis: GimbalAxis) -> NSNumber?

    Parameters

    axis

    the axis

    Return Value

    the current attitude as a double in an NSNumber. nil if axis is not supported.

  • Controls the gimbal.

    Unit of the yaw, pitch, roll values depends on the value of the mode parameter:

    • .position: axis value is in degrees and represents the desired position of the gimbal on the given axis.
    • .velocity: axis value is in max speed (maxSpeedSettings[thisAxis].value) ratio (from -1 to 1).

    If mode is .position, frame of reference of a given axis depends on the value of the stabilization on this axis. If this axis is stabilized (i.e. stabilizationSettings[thisAxis].value == true, here are the frame of references:

    • yaw: given angle is relative to the magnetic North (clockwise).
    • pitch: given angle is relative to the horizon. Positive pitch values means an orientation towards sky.
    • roll: given angle is relative to the horizon line. Positive roll values means an orientation to the right when seeing the gimbal from behind.

    However, if the axis is not stabilized:

    • yaw: given angle is relative to the heading of the drone. Positive yaw values means a right orientation when seeing the gimbal from above.
    • pitch: given angle is relative to the body of the drone. Positive pitch values means an orientation of the gimbal towards the top of the drone.
    • roll: given angle is relative to the body of the drone. Positive roll values means an clockwise rotation of the gimbal.

    Declaration

    Swift

    func control(mode: GimbalControlMode, yaw: NSNumber?, pitch: NSNumber?, roll: NSNumber?)

    Parameters

    mode

    the mode that should be used to move the gimbal. This parameter will change the unit of the following parameters

    yaw

    target on the yaw axis as a Double in an NSNumber. nil if you want to keep the current value.

    pitch

    target on the pitch axis as a Double in an NSNumber. nil if you want to keep the current value.

    roll

    target on the roll axis as a Double in an NSNumber. nil if you want to keep the current value.

  • Starts the offsets correction process.

    When offset correction is started, offsetsCorrectionProcess is not nil and correctable offsets can be corrected.

    Declaration

    Swift

    func startOffsetsCorrectionProcess()
  • Stops the offsets correction process.

    offsetsCorrectionProcess will be set to nil.

    Declaration

    Swift

    func stopOffsetsCorrectionProcess()
  • Starts calibration process.

    Declaration

    Swift

    func startCalibration()
  • Cancels the current calibration process.

    Declaration

    Swift

    func cancelCalibration()