DJI Mobile SDK Documentation

      class IVirtualStickManager

      interface IVirtualStickManager
      Package:dji.v5.manager.interfaces
      Description:

      Class that is used to manage virtual stick. It is used to enable/disable the virtual stick mode. It also provides the ability to listen the virtual stick values.

      Supported since MSDK 5.0.0

      Class Members:
      method enableVirtualStick
      void enableVirtualStick(CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Open the virtual stick mode.
      Note:
      1. For flight safety, when the aircraft is close(about 30 meters) to the restricted flight zone or restricted distance, the remote controller will get the control of the aircraft, and the virtual stick cannot be used.
      2. Currently, only M300 RTK, M350 RTK and M30 series aircraft support obstacle avoidance in virtual joystick mode.
      3. The virtual stick normal mode supports obstacle avoidance by default.
      4. In the virtual stick advanced mode, obstacle avoidance is supported only when the vertical control Mode is velocity mode, the yaw control mode is angular velocity mode, and the roll pitch control mode is velocity mode.


      Supported since MSDK 5.0.0

      Input Parameters:
      CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method disableVirtualStick
      void disableVirtualStick(CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Close the virtual stick mode.

      Supported since MSDK 5.0.0

      Input Parameters:
      CommonCallbacks.CompletionCallback callbackReturn the callback of execution result.
      method getLeftStick
      IStick getLeftStick()
      Package:dji.v5.manager.interfaces
      Description:

      To get the left stick instance of the virtual stick. Left stick controls the yaw axis and throttle of the aircraft.

      • When the stick moves left, the horizontalPosition is negative. The aircraft will rotate counterclockwise when looking down at the aircraft.
      • When the stick moves right, the horizontalPosition is positive. The aircraft will rotate clockwise when looking down at the aircraft.
      • When the stick moves upward, the verticalPosition is positive. The aircraft will increase its altitude.
      • When the stick moves downward, the verticalPosition is negative. The aircraft will lower its altitude.


      Supported since MSDK 5.0.0

      Return:
      IStickReturn the instance of left stick.
      method getRightStick
      IStick getRightStick()
      Package:dji.v5.manager.interfaces
      Description:

      To get the right stick instance of the virtual stick. Right stick controls the roll axis and pitch axis of the aircraft.

      • When the stick moves left, the horizontalPosition is negative. The aircraft will fly left when looking down at the aircraft.
      • When the stick moves right, the horizontalPosition is positive. The aircraft will fly right when looking down at the aircraft.
      • When the stick moves upward, the verticalPosition is positive. The aircraft will fly forward when looking down at the aircraft.
      • When the stick moves downward, the verticalPosition is negative. The aircraft will fly backward when looking down at the aircraft.


      Supported since MSDK 5.0.0

      Return:
      IStickReturn the instance of right stick.
      method setVirtualStickAdvancedModeEnabled
      void setVirtualStickAdvancedModeEnabled(boolean isEnabled)
      Package:dji.v5.manager.interfaces
      Description:

      Enable virtual stick advanced mode. In advanced mode, the control data of left stick getLeftStick and right stick getLeftStick will no longer take effect, you can call sendVirtualStickAdvancedParam to set more advanced control parameters for use with more complex application scenarios, such as using a virtual stick to implement waypoint-related functions.

      Supported since MSDK 5.1.0

      Input Parameters:
      boolean isEnabledtrue means enable virtual stick advanced mode.
      method sendVirtualStickAdvancedParam
      void sendVirtualStickAdvancedParam(@NonNull VirtualStickFlightControlParam param)
      Package:dji.v5.manager.interfaces
      Description:

      Send virtual stick advanced control parameters.

    • Please call setVirtualStickAdvancedModeEnabled to enable advanced mode before using this interface.
    • Developers can send control parameters at a specific frequency according to their own needs. The recommended sending frequency is between 5Hz and 25Hz.
    • For detailed usage of advanced control parameters, please refer to Virtual stick
    • For advanced control parameter ranges, please refer to: VirtualStickRange.


    • Supported since MSDK 5.1.0

      Input Parameters:
      @NonNull VirtualStickFlightControlParam paramAdvanced mode parameters.
      method setVirtualStickStateListener
      void setVirtualStickStateListener(VirtualStickStateListener listener)
      Package:dji.v5.manager.interfaces
      Description:

      To set the listener of the virtual stick status.

      Supported since MSDK 5.0.0

      Input Parameters:
      VirtualStickStateListener listenerListener of the virtual stick status
      method removeVirtualStickStateListener
      void removeVirtualStickStateListener(VirtualStickStateListener listener)
      Package:dji.v5.manager.interfaces
      Description:

      Remove the listener of the virtual stick status.

      Supported since MSDK 5.0.0

      Input Parameters:
      VirtualStickStateListener listenerListener of the virtual stick status
      method clearAllVirtualStickStateListener
      void clearAllVirtualStickStateListener()
      Package:dji.v5.manager.interfaces
      Description:

      Clean all the listener of the virtual stick status.

      Supported since MSDK 5.0.0

      class
      enum FlightControlAuthority
      enum FlightControlAuthority implements JNIProguardKeepTag
      Package:dji.sdk.keyvalue.value.flightcontroller
      Description:

      Flight control authority.

      Supported since MSDK 5.0.0

      Enum Members:
      RCRemote controller.
      MSDKMSDK.
      OSDKOSDK.
      Class Members:
      enum FlightControlAuthorityChangeReason
      enum FlightControlAuthorityChangeReason implements JNIProguardKeepTag
      Package:dji.sdk.keyvalue.value.flightcontroller
      Description:

      Flight control authority change reason.

      Supported since MSDK 5.0.0

      Enum Members:
      MSDK_REQUESTMSDK got the flight control authority.
      OSDK_REQUESTOSDK got the flight control authority.
      RC_LOSTRemote controller lost contact, reset flight control authority to the remote controller.
      RC_NOT_P_MODEThe flight mode of the aircraft is not P mode, reset flight control authority to the remote controller.
      RC_SWITCHThe flight mode of the aircraft is switched, reset flight control authority to the remote controller.
      RC_PAUSE_STOPThe pause button is pressed, reset flight control authority to the remote controller.
      RC_ONE_KEY_GO_HOMEThe aircraft is going home, reset flight control authority to the remote controller.
      BATTERY_LOW_GO_HOMEThe aircraft is going home because of the low battery, reset flight control authority to the remote controller.
      BATTERY_SUPER_LOW_LANDINGThe aircraft is landing because of the low battery, reset flight control authority to the remote controller.
      OSDK_LOSTOSDK lost contact, reset flight control authority to the remote controller.
      NEAR_BOUNDARYThe aircraft is nearby the fly zone or restricted distance, reset flight control authority to the remote controller.
      Class Members: