DJI Mobile SDK Documentation

      class DJIRemoteControllerKey

      class DJIRemoteControllerKey
      包:dji.sdk.keyvalue.key
      描述:

      DJIRemoteControllerKey提供了一组方法来设置和获取遥控器数据。遥控器是一种具有摇杆、按钮、滚轮、GPS、电池、和视频输出端口的设备。移动设备可以连接到遥控器,遥控器会向移动设备发送任何从飞行器上返回的信息。

      此类从MSDK 5.0开始支持

      类成员:

      基础信息

      连接状态
      final KeyConnection
      static final DJIKeyInfo<Boolean> KeyConnection = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"Connection", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)
      包:dji.sdk.keyvalue.key
      描述:

      参数: Boolean

      true表示遥控器已连接。

      MSDK 5.0开始支持

      final KeyRemoteControllerType
      static final DJIKeyInfo<RemoteControllerType> KeyRemoteControllerType = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"RemoteControllerType", new SingleValueConverter<>(RemoteControllerType.class,RemoteControllerTypeMsg.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)
      包:dji.sdk.keyvalue.key
      描述:

      参数: RemoteControllerType

      获取遥控器类型。

      MSDK 5.0开始支持

      控制模式
      final KeyRcControllerMode
      static final DJIKeyInfo<RcControllerModeMsg> KeyRcControllerMode = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"RcControllerMode", new DJIValueConverter<>(RcControllerModeMsg.class)).canGet(true).canSet(true).canListen(false).canPerformAction(false).setIsEvent(false)
      包:dji.sdk.keyvalue.key
      描述:

      参数: Value_RemoteController_Struct_RcControllerModeMsg

      获取遥控器控制模式。 TODO:希望把模式单独开放一个key,开发者调用更简洁。去掉channel相关属性。

      MSDK 5.0开始支持

      电量信息
      final KeyBatteryInfo
      static final DJIKeyInfo<BatteryInfo> KeyBatteryInfo = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"BatteryInfo", new DJIValueConverter<>(BatteryInfo.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RcParamChargeRemaining")
      包:dji.sdk.keyvalue.key
      描述:

      参数: BatteryInfo

      获取遥控器电量信息。

      MSDK 5.0开始支持

      序列号
      final KeySerialNumber
      static final DJIKeyInfo<String> KeySerialNumber = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"SerialNumber", SingleValueConverter.StringConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)
      包:dji.sdk.keyvalue.key
      描述:

      参数: String

      获取遥控器序列号。

      MSDK 5.0开始支持

      固件版本号
      final KeyFirmwareVersion
      static final DJIKeyInfo<String> KeyFirmwareVersion = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"FirmwareVersion", SingleValueConverter.StringConverter).canGet(true).canSet(false).canListen(false).canPerformAction(false).setIsEvent(false)
      包:dji.sdk.keyvalue.key
      描述:

      参数: String

      获取遥控器固件版本。

      MSDK 5.0开始支持


      物理按键信息监听

      final KeyStickLeftVertical
      static final DJIKeyInfo<Integer> KeyStickLeftVertical = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"StickLeftVertical", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCStickLeftVertical")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Integer

      获取遥控器左摇杆的垂直杆量,范围区间:[-660,660],把摇杆控制到最下边,杆量为-660,把摇杆控制到最上边,杆量则为660。该分量的含义需要结合KeyRcControllerMode的设置而定,比如把KeyRcControllerMode设置为美国手,该分量可以控制飞行器升降。

      MSDK 5.0开始支持

      final KeyStickLeftHorizontal
      static final DJIKeyInfo<Integer> KeyStickLeftHorizontal = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"StickLeftHorizontal", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCStickLeftHorizontal")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Integer

      获取遥控器左摇杆的水平杆量,范围区间:[-660,660],把摇杆控制到最左边,杆量为-660,把摇杆控制到最右边,杆量则为660。该分量的含义需要结合KeyRcControllerMode的设置而定,比如把KeyRcControllerMode设置为美国手,该分量可以控制飞行器转左转右。

      MSDK 5.0开始支持

      final KeyStickRightVertical
      static final DJIKeyInfo<Integer> KeyStickRightVertical = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"StickRightVertical", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCStickRightVertical")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Integer

      获取遥控器右摇杆的垂直杆量,范围区间:[-660,660],把摇杆控制到最下边,杆量为-660,把摇杆控制到最上边,杆量则为660。该分量的含义需要结合KeyRcControllerMode的设置而定,比如把KeyRcControllerMode设置为美国手,该分量可以控制飞行器前后移动。

      MSDK 5.0开始支持

      final KeyStickRightHorizontal
      static final DJIKeyInfo<Integer> KeyStickRightHorizontal = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"StickRightHorizontal", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCStickRightHorizontal")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Integer

      获取遥控器右摇杆的水平杆量,范围区间:[-660,660],把摇杆控制到最左边,杆量为-660,把摇杆控制到最右边,杆量则为660。该分量的含义需要结合KeyRcControllerMode的设置而定,比如把KeyRcControllerMode设置为美国手,该分量可以控制飞行器左右移动。

      MSDK 5.0开始支持

      final KeyShutterButtonDown
      static final DJIKeyInfo<Boolean> KeyShutterButtonDown = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"ShutterButtonDown", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCShutterButtonDown")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Boolean

      true表示按下快门按钮,相机会切换成拍照模式或者进行拍照动作。

      MSDK 5.0开始支持

      录像按钮
      final KeyRecordButtonDown
      static final DJIKeyInfo<Boolean> KeyRecordButtonDown = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"RecordButtonDown", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCRecordButtonDown")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Boolean

      true表示按下录像按钮,相机会切换到录像模式或者开启关闭录像行为。

      MSDK 5.0开始支持

      返航按钮
      final KeyGoHomeButtonDown
      static final DJIKeyInfo<Boolean> KeyGoHomeButtonDown = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"GoHomeButtonDown", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCGohomeButtonDown")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Boolean

      true表示按下返航按钮,飞行器将启动或者取消返航行为。

      MSDK 5.0开始支持

      急停按钮
      final KeyPauseButtonDown
      static final DJIKeyInfo<Boolean> KeyPauseButtonDown = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"PauseButtonDown", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCPauseButtonDown")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Boolean

      true表示按下急停按钮。在Matrice 30 Series和Matrice 300 RTK上,按下急停按钮后,飞行器将停止智能飞行行为。

      MSDK 5.0开始支持

      左拨轮
      final KeyLeftDial
      static final DJIKeyInfo<Integer> KeyLeftDial = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"LeftDial", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCLeftWheel")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Integer

      获取遥控器左拨轮的偏移量,范围区间:[-660,660],默认偏移量为0。把拨轮拨到最左边,偏移量为-660。把拨轮拨到最右边,偏移量为660。左拨轮通常用来控制云台的俯仰行为。

      MSDK 5.0开始支持

      右拨轮
      final KeyRightDial
      static final DJIKeyInfo<Integer> KeyRightDial = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"RightDial", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCRightWheel")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Integer

      获取遥控器右拨轮的偏移量,范围区间:[-660,660],默认偏移量为0。把拨轮拨到最左边,偏移量为-660。把拨轮拨到最右边,偏移量为660。右拨轮通常用来控制云台的偏航行为。

      MSDK 5.0开始支持

      final KeyFiveDimensionPressedStatus
      static final DJIKeyInfo<FiveDimensionPressedStatus> KeyFiveDimensionPressedStatus = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"FiveDimensionPressedStatus", new DJIValueConverter<>(FiveDimensionPressedStatus.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RcFiveDimensionPressedStatus")
      包:dji.sdk.keyvalue.key
      描述:

      参数: FiveDimensionPressedStatus

      获取遥控器五维按键的状态。

      MSDK 5.0开始支持

      自定义按键
      final KeyCustomButton1Down
      static final DJIKeyInfo<Boolean> KeyCustomButton1Down = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"CustomButton1Down", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCCustomButton1Down")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Boolean

      true表示按下自定义按键C1。Pilot中默认用于云台回中,可自定义配置。

      MSDK 5.0开始支持

      final KeyCustomButton2Down
      static final DJIKeyInfo<Boolean> KeyCustomButton2Down = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"CustomButton2Down", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCCustomButton2Down")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Boolean

      true表示按下自定义按键C2。Pilot中默认用于主辅画面切换,可自定义配置。

      MSDK 5.0开始支持

      final KeyCustomButton3Down
      static final DJIKeyInfo<Boolean> KeyCustomButton3Down = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"CustomButton3Down", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RCCustomButton3Down")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Boolean

      true表示按下自定义按键C3。可自定义配置。

      MSDK 5.0开始支持


      基本操作

      final KeyRequestPairing
      static final DJIActionKeyInfo<EmptyMsg,EmptyMsg> KeyRequestPairing = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"RequestPairing", EmptyValueConverter.converter,EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false).setInnerIdentifier("RcRequestPairing")
      包:dji.sdk.keyvalue.key
      描述:

      启动遥控器对频操作,遥控器开始与飞行器对频。当遥控器无法连接飞行器或者更换遥控器的时候可以通过对频操作连接飞行器。

      MSDK 5.0开始支持

      final KeyStopPairing
      static final DJIActionKeyInfo<EmptyMsg,EmptyMsg> KeyStopPairing = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"StopPairing", EmptyValueConverter.converter,EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false).setInnerIdentifier("RcStopPairing")
      包:dji.sdk.keyvalue.key
      描述:

      停止遥控器对频操作。

      MSDK 5.0开始支持

      final KeyPairingStatus
      static final DJIKeyInfo<PairingState> KeyPairingStatus = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"PairingStatus", new SingleValueConverter<>(PairingState.class,RcPairingStateMsg.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RcPairingState")
      包:dji.sdk.keyvalue.key
      描述:

      参数: PairingState

      获取遥控器对频状态。

      MSDK 5.0开始支持


      双控

      是否支持双控
      final KeyMultiControlIsSupported
      static final DJIKeyInfo<Boolean> KeyMultiControlIsSupported = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlIsSupported", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("IsMasterSlaveModeV4Supported")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Boolean

      true表示支持双控功能。

      MSDK 5.0开始支持

      final KeyMultiControlRequestPairing
      static final DJIActionKeyInfo<MultiControlChannel,EmptyMsg> KeyMultiControlRequestPairing = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlRequestPairing", new SingleValueConverter<>(MultiControlChannel.class,MultiControlChannelInfo.class),EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false).setInnerIdentifier("StartModePairing")
      包:dji.sdk.keyvalue.key
      描述:

      参数: MultiControlChannel

      启动双控对频操作,可选择把遥控器切换成A控或者B控跟飞行器对频。

      MSDK 5.0开始支持

      final KeyMultiControlOnlineRcCount
      static final DJIKeyInfo<Integer> KeyMultiControlOnlineRcCount = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlOnlineRcCount", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("MultiRcOnlineRCCount")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Integer

      获取当前已连接的遥控器个数。

      MSDK 5.0开始支持

      final KeyMultiControlOnlineAppCount
      static final DJIKeyInfo<Integer> KeyMultiControlOnlineAppCount = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlOnlineAppCount", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("MultiRcOnlineAPPCount")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Integer

      获取当前已连接的APP个数。
      注意:此处提及的APP包括DJI的官方APP,以及通过DJI MSDK开发的第三方APP。

      MSDK 5.0开始支持

      双控连接状态
      final KeyMultiControlStatus
      static final DJIKeyInfo<MultiControlStatusInfo> KeyMultiControlStatus = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlStatus", new DJIValueConverter<>(MultiControlStatusInfo.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("RcMultiStatus")
      包:dji.sdk.keyvalue.key
      描述:

      参数: MultiControlStatusInfo

      获取遥控器双控连接状态。可以通过这个接口查看A控、A控中的APP、B控、B控中APP是否在线状态。


      MSDK 5.0开始支持

      final KeyMultiControlFlightControlAuthorityOwner
      static final DJIKeyInfo<MultiControlFlightControlAuthorityOwnerInfo> KeyMultiControlFlightControlAuthorityOwner = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlFlightControlAuthorityOwner", new DJIValueConverter<>(MultiControlFlightControlAuthorityOwnerInfo.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("MultiRCFlightControlAuthOwner")
      包:dji.sdk.keyvalue.key
      描述:

      参数: MultiControlFlightControlAuthorityOwnerInfo

      获取当前飞行控制权是在A控还是在B控。

      MSDK 5.0开始支持

      final KeyMultiControlGimbalAuthorityOwner
      static final DJIKeyInfo<List<MultiControlChannelInfo>> KeyMultiControlGimbalAuthorityOwner = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlGimbalAuthorityOwner", new SingleValueConverter<>((Class)List.class,MultiRcGimbalsControlAuthOwnerMsg.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("MultiRcGimbalsControlAuthOwner")
      包:dji.sdk.keyvalue.key
      描述:

      参数: List<MultiControlChannelInfo>

      获取当前云台控制权是在A控还是在B控。

      MSDK 5.0开始支持

      final KeyMultiControlAuthorityObtain
      static final DJIActionKeyInfo<List<MultiControlAuthorityType>,EmptyMsg> KeyMultiControlAuthorityObtain = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlAuthorityObtain", new SingleValueConverter<>((Class)List.class,RCAuthorityModes.class),EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false).setInnerIdentifier("MultiRcControlAuthoritySurpass")
      包:dji.sdk.keyvalue.key
      描述:

      参数: List<MultiControlAuthorityType>

      抢夺飞行或者云台控制权。

      MSDK 5.0开始支持

      final KeyMultiControlLockAuthority
      static final DJIActionKeyInfo<MultiControlLockAuthorityInfo,EmptyMsg> KeyMultiControlLockAuthority = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlLockAuthority", new DJIValueConverter<>(MultiControlLockAuthorityInfo.class),EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false).setInnerIdentifier("MultiRcControlLockRight")
      包:dji.sdk.keyvalue.key
      描述:

      参数: MultiControlLockAuthorityInfo

      锁定飞行或者云台控制权, 锁定后控制权将不能被其他控抢夺。

      MSDK 5.0开始支持

      final KeyMultiControlFlightControlAuthorityLockStatus
      static final DJIKeyInfo<Boolean> KeyMultiControlFlightControlAuthorityLockStatus = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlFlightControlAuthorityLockStatus", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("MultiRCFlightControlAuthLockState")
      包:dji.sdk.keyvalue.key
      描述:

      参数: Boolean

      返回飞行控制权是否锁定。

      MSDK 5.0开始支持

      final KeyMultiControlLostControlNotice
      static final DJIKeyInfo<MultiControlLostControlInfo> KeyMultiControlLostControlNotice = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlLostControlNotice", new DJIValueConverter<>(MultiControlLostControlInfo.class)).canGet(false).canSet(false).canListen(true).canPerformAction(false).setIsEvent(true).setInnerIdentifier("MultiRcLostNotice")
      包:dji.sdk.keyvalue.key
      描述:

      参数: MultiControlLostControlInfo

      监听具有飞行或者云台控制权的遥控器失去连接的通知事件。当具有飞行控制权的遥控器失去连接的时候,无飞行控制权的遥控器可以调用KeyMultiControlObtainAuthorityWhenLostControl接管飞行控制权,否则飞行器将执行失控行为。

      MSDK 5.0开始支持

      final KeyMultiControlObtainAuthorityWhenLostControl
      static final DJIActionKeyInfo<EmptyMsg,EmptyMsg> KeyMultiControlObtainAuthorityWhenLostControl = new DJIActionKeyInfo<>(componentType.value(),subComponentType.value(),"MultiControlObtainAuthorityWhenLostControl", EmptyValueConverter.converter,EmptyValueConverter.converter).canGet(false).canSet(false).canListen(false).canPerformAction(true).setIsEvent(false).setInnerIdentifier("MultiRcExecuteAircraftLostLogic")
      包:dji.sdk.keyvalue.key
      描述:

      当具有飞行控制权的遥控器失去连接的时候,无飞行控制权的遥控器可以调用这个接口接管飞行控制权,否则飞行器将执行失控行为。

      MSDK 5.0开始支持