DJI Mobile SDK Documentation
      包:dji.sdk.keyvalue.key
      继承自:DJIGimbalKey
      classSince MSDK 5.0.0

      GimbalKey

      GimbalKey提供了一组方法来设置和获取云台数据。包括获取云台姿态数据、控制云台转动、以及云台的相关参数设置。

      Package dji.sdk.keyvalue.keyAndroid · Java / Kotlin

      GimbalKey提供了一组方法来设置和获取云台数据。包括获取云台姿态数据、控制云台转动、以及云台的相关参数设置。


      MSDK 5.0.0开始支持

      成员

      27 个成员

      方法

      27

      基础信息

      连接状态
      method

      KeyConnection

      Since MSDK 5.0.0
      static final DJIKeyInfo<Boolean> KeyConnection = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"Connection", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      参数: Boolean

      true表示云台已连接。

      固件版本号
      method

      KeyFirmwareVersion

      Since MSDK 5.0.0
      static final DJIKeyInfo<String> KeyFirmwareVersion = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"FirmwareVersion", SingleValueConverter.StringConverter).canGet(true).canSet(false).canListen(false).canPerformAction(false).setIsEvent(false)

      参数: String

      获取云台固件版本。

      姿态数据
      method

      KeyGimbalAttitude

      Since MSDK 5.0.0
      static final DJIKeyInfo<Attitude> KeyGimbalAttitude = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"GimbalAttitude", new DJIValueConverter<>(Attitude.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      参数: Attitude

      获取云台姿态数据。其中偏航角度使用的是北东地坐标系,如需要获取云台相对于飞行器机头朝向的偏航角度,请调用KeyYawRelativeToAircraftHeading获取。

      method

      KeyYawRelativeToAircraftHeading

      Since MSDK 5.0.0
      static final DJIKeyInfo<Double> KeyYawRelativeToAircraftHeading = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"YawRelativeToAircraftHeading", SingleValueConverter.DoubleConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("YawRelativeToBodyHeading")

      参数: Double

      获取云台相对于飞行器机头朝向的偏航角度。


      基本操作

      method

      KeyGimbalMode

      Since MSDK 5.0.0
      static final DJIKeyInfo<GimbalMode> KeyGimbalMode = new KeyGimbalMode().canGet(true).canSet(true).canListen(true).canPerformAction(false).setIsEvent(false)

      参数: GimbalMode

      设置云台模式。

      method

      KeyRotateByAngle

      Since MSDK 5.0.0
      static final DJIActionKeyInfo<GimbalAngleRotation,EmptyMsg> KeyRotateByAngle = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"RotateByAngle", new DJIValueConverter<>(GimbalAngleRotation.class),EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false)

      参数: GimbalAngleRotation

      用角度模式旋转云台的俯仰角度、横滚角度和偏航角度。支持相对角度模式和绝对角度模式。

      注意

      不同的云台负载的可控制角度不一样,以下提供了一种方法获取云台的最大最小限位角度:请通过遥控器的滚轮控制云台到俯仰,横滚和偏航的最大最小限位,然后调用KeyGimbalAttitude即可获取到该云台的可调限位角度。

      method

      KeyRotateBySpeed

      Since MSDK 5.0.0
      static final DJIActionKeyInfo<GimbalSpeedRotation,EmptyMsg> KeyRotateBySpeed = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"RotateBySpeed", new DJIValueConverter<>(GimbalSpeedRotation.class),EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false)

      参数: GimbalSpeedRotation

      用速度模式旋转云台的俯仰角度、横滚角度和偏航角度。单位:0.1度/秒,范围:[-359.9, 359.9]。设置的值越大,单位时间转动的角度越大,设置频率和链路信号强弱会对最终转动角度造成偏差。

      method

      KeyGimbalReset

      Since MSDK 5.0.0
      static final DJIActionKeyInfo<GimbalResetType,EmptyMsg> KeyGimbalReset = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"GimbalReset", new SingleValueConverter<>(GimbalResetType.class,GimbalResetCommandMsg.class),EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false).setInnerIdentifier("ResetGimbal")

      参数: GimbalResetType

      云台重置,可以通过设置GimbalResetType让俯仰轴,偏航轴和横滚轴回中或者朝下。

      method

      KeyFineTunePitchInDegrees

      Since MSDK 5.0.0
      static final DJIActionKeyInfo<Double,EmptyMsg> KeyFineTunePitchInDegrees = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"FineTunePitchInDegrees", SingleValueConverter.DoubleConverter,EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false)

      参数: Double

      云台俯仰轴可以通过自定义偏移量进行微调。当云台回中后仍然有小角度偏移,可用此功能进行云台调平。单次可微调的范围是[-2.0, 2.0],单位:度,总共可微调的范围是[-10.0, 10.0],单位:度, 如果偏移量为负数,云台将在逆时针方向微调指定的度数。可通过KeyFineTunePitchTotalDegree获取总共微调的偏移量。

      method

      KeyFineTuneYawInDegrees

      Since MSDK 5.0.0
      static final DJIActionKeyInfo<Double,EmptyMsg> KeyFineTuneYawInDegrees = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"FineTuneYawInDegrees", SingleValueConverter.DoubleConverter,EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false)

      参数: Double

      云台偏航轴可以通过自定义偏移量进行微调。当云台回中后仍然有小角度偏移,可用此功能进行云台微调,使得云台水平居中。单次可微调的范围是[-2.0, 2.0],单位:度,总共可微调的范围是[-10.0, 10.0],单位:度, 如果偏移量为负数,云台将在逆时针方向微调指定的度数。可通过KeyFineTuneYawTotalDegree获取总共微调的偏移量。

      method

      KeyFineTuneRollInDegrees

      Since MSDK 5.0.0
      static final DJIActionKeyInfo<Double,EmptyMsg> KeyFineTuneRollInDegrees = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"FineTuneRollInDegrees", SingleValueConverter.DoubleConverter,EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false)

      参数: Double

      云台横滚轴可以通过自定义偏移量进行微调。当云台回中后仍然有小角度偏移,可用此功能进行云台调平,使得云台水平居中。单次可微调的范围是[-2.0, 2.0],单位:度,总共可微调的范围是[-10.0, 10.0],单位:度, 如果偏移量为负数,云台将在逆时针方向微调指定的度数。可通过KeyFineTuneRollTotalDegree获取总共微调的偏移量。

      method

      KeyFineTunePitchTotalDegree

      Since MSDK 5.0.0
      static final DJIKeyInfo<Double> KeyFineTunePitchTotalDegree = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"FineTunePitchTotalDegree", SingleValueConverter.DoubleConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("PitchAdjustDegree")

      参数: Double

      获取云台俯仰轴总偏移量。可通过KeyFineTunePitchInDegrees进行微调。

      method

      KeyFineTuneYawTotalDegree

      Since MSDK 5.0.0
      static final DJIKeyInfo<Double> KeyFineTuneYawTotalDegree = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"FineTuneYawTotalDegree", SingleValueConverter.DoubleConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("YawAdjustDegree")

      参数: Double

      获取云台偏航轴总偏移量。可通过KeyFineTuneYawInDegrees进行微调。

      method

      KeyFineTuneRollTotalDegree

      Since MSDK 5.0.0
      static final DJIKeyInfo<Double> KeyFineTuneRollTotalDegree = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"FineTuneRollTotalDegree", SingleValueConverter.DoubleConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RollAdjustDegree")

      参数: Double

      获取云台横滚轴总偏移量。可通过KeyFineTuneRollInDegrees进行微调。

      method

      KeyLightGimbalCalibrate

      Since MSDK 5.12.0
      static final DJIActionKeyInfo<EmptyMsg, EmptyMsg> KeyLightGimbalCalibrate = new KeyLightGimbalCalibrate().canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false)

      启动探照灯云台自动校准。可通过KeyLightGimbalCalibrationStatus监听校准状态。 仅支持AL1 探照灯。

      method

      KeyLightGimbalCalibrationStatus

      Since MSDK 5.12.0
      static final DJIKeyInfo<GimbalCalibrationStatusInfo> KeyLightGimbalCalibrationStatus = new KeyLightGimbalCalibrationStatus().canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      参数: GimbalCalibrationStatusInfo

      获取探照灯云台校准状态和校准进度。调用KeyLightGimbalCalibrate启动探照灯云台校准后才能获取探照灯云台校准状态和校准进度。

      method

      KeyLightGimbalFineTunePitchInDegrees

      Since MSDK 5.12.0
      static final DJIActionKeyInfo<LightGimbalAdjustInfo, EmptyMsg> KeyLightGimbalFineTunePitchInDegrees = new KeyLightGimbalFineTunePitchInDegrees().canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false)

      参数: LightGimbalAdjustInfo

      探照灯云台俯仰轴可以通过自定义偏移量进行微调。当探照灯云台回中后仍然有小角度偏移,可用此功能进行云台调平。单次可微调的范围是[-2.0, 2.0],单位:度,总共可微调的范围是[-10.0, 10.0],单位:度, 如果偏移量为负数,探照灯云台将在逆时针方向微调指定的度数。可通过KeyLightGimbalPitchTotalInDegrees获取总共微调的偏移量。

      method

      KeyLightGimbalPitchTotalInDegrees

      Since MSDK 5.12.0
      static final DJIKeyInfo<LightGimbalTotalAdjustInfo> KeyLightGimbalPitchTotalInDegrees = new KeyLightGimbalPitchTotalInDegrees().canGet(true).canSet(false).canPerformAction(false).setIsEvent(false)

      参数: LightGimbalTotalAdjustInfo

      获取探照灯云台俯仰轴总偏移量。可通过KeyLightGimbalFineTunePitchInDegrees进行微调。

      method

      KeyGimbalCalibrate

      Since MSDK 5.0.0
      static final DJIActionKeyInfo<EmptyMsg,EmptyMsg> KeyGimbalCalibrate = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"GimbalCalibrate", EmptyValueConverter.converter,EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false).setInnerIdentifier("CalibrateGimbal")

      启动云台自动校准。可通过KeyGimbalCalibrationStatus监听校准状态。

      method

      KeyGimbalCalibrationStatus

      Since MSDK 5.0.0
      static final DJIKeyInfo<GimbalCalibrationStatusInfo> KeyGimbalCalibrationStatus = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"GimbalCalibrationStatus", new DJIValueConverter<>(GimbalCalibrationStatusInfo.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("GimbalCalibrationState")

      参数: GimbalCalibrationStatusInfo

      获取云台校准状态和校准进度。调用KeyGimbalCalibrate启动云台校准后才能获取云台校准状态和校准进度。

      method

      KeyRestoreFactorySettings

      Since MSDK 5.0.0
      static final DJIActionKeyInfo<EmptyMsg,EmptyMsg> KeyRestoreFactorySettings = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"RestoreFactorySettings", EmptyValueConverter.converter,EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false)

      将云台参数恢复到出厂设置。


      基本设置

      method

      KeyPitchRangeExtensionEnabled

      Since MSDK 5.0.0
      static final DJIKeyInfo<Boolean> KeyPitchRangeExtensionEnabled = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"PitchRangeExtensionEnabled", SingleValueConverter.BooleanConverter).canGet(true).canSet(true).canListen(true).canPerformAction(false).setIsEvent(false)

      参数: Boolean

      设置开启或者关闭云台俯仰限位扩展。以M30系列机型为例,它们的云台是下置的,在未开启限位扩展时,云台俯仰限位的角度范围为[45, -90],在开启限位扩展后,角度范围扩展到[45, -120]。也就是说开启俯仰限位扩展后,当云台俯仰轴往下调节时,角度可以控制到-120度。

      最大速度百分比
      method

      KeyPitchControlMaxSpeed

      Since MSDK 5.0.0
      static final DJIKeyInfo<Integer> KeyPitchControlMaxSpeed = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"PitchControlMaxSpeed", SingleValueConverter.IntegerConverter).canGet(true).canSet(true).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("PitchControllerMaxSpeed")

      参数: Integer

      设置云台俯仰控制的最大速度,该数值为百分比,范围:[1,100]。数值越大速度越快,100%则表示云台所能达到的最大物理速度进行控制。

      method

      KeyYawControlMaxSpeed

      Since MSDK 5.0.0
      static final DJIKeyInfo<Integer> KeyYawControlMaxSpeed = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"YawControlMaxSpeed", SingleValueConverter.IntegerConverter).canGet(true).canSet(true).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("YawControllerMaxSpeed")

      参数: Integer

      设置云台偏航控制的最大速度,该数值为百分比,范围:[1,100]。数值越大速度越快,100%则表示云台所能达到的最大物理速度进行控制。

      method

      KeyPitchSmoothingFactor

      Since MSDK 5.0.0
      static final DJIKeyInfo<Integer> KeyPitchSmoothingFactor = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"PitchSmoothingFactor", SingleValueConverter.IntegerConverter).canGet(true).canSet(true).canListen(true).canPerformAction(false).setIsEvent(false)

      参数: Integer

      设置云台俯仰缓启/停,范围:[0,30],数值越大,控制云台俯仰轴启动/停止转动的缓冲距离越长。

      method

      KeyYawSmoothingFactor

      Since MSDK 5.0.0
      static final DJIKeyInfo<Integer> KeyYawSmoothingFactor = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"YawSmoothingFactor", SingleValueConverter.IntegerConverter).canGet(true).canSet(true).canListen(true).canPerformAction(false).setIsEvent(false)

      参数: Integer

      设置云台偏航缓启/停,范围:[0,30],数值越大,控制云台偏航轴启动/停止转动的缓冲距离越长。

      method

      KeyGimbalVerticalShotEnabled

      Since MSDK 5.3.0
      static final DJIKeyInfo<Boolean> KeyGimbalVerticalShotEnabled = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"GimbalVerticalShotEnabled", SingleValueConverter.BooleanConverter).canGet(true).canSet(true).canListen(true).canPerformAction(false).setIsEvent(false)

      参数: Boolean

      设置开启或者关闭竖拍。通常用于消费类机型。