DJI Mobile SDK Documentation

      class FlightAssistant

      class FlightAssistant
      Package:dji.sdk.flightcontroller
      Description:

      This class contains components of the Intelligent Flight Assistant and provides methods to change its settings.

      Class Members:
      method setVisionDetectionStateUpdatedCallback
      void setVisionDetectionStateUpdatedCallback(VisionDetectionState.Callback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Set intelligent flight assistant state update callback.

      Input Parameters:
      VisionDetectionState.Callback callbackThe execution callback with the execution result returned.
      method setVisionControlStateUpdatedcallback
      void setVisionControlStateUpdatedcallback(VisionControlState.Callback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Callback function that updates aircraft state. Controlled by the intelligent flight assistant.

      Input Parameters:
      VisionControlState.Callback callbackThe execution callback with the execution result returned.
      method setFaceAwareStateCallback
      void setFaceAwareStateCallback(FaceAwareState.Callback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Starts to receive the update of FaceAwareState.

      Input Parameters:
      FaceAwareState.Callback callbackFaceAwareState update callback.
      method setPalmControlStateCallback
      void setPalmControlStateCallback(PalmControlState.Callback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Starts to receive the update of PalmControlState.

      Input Parameters:
      PalmControlState.Callback callbackPalmControlState update callback.
      method setSmartCaptureStateCallback
      void setSmartCaptureStateCallback(@Nullable SmartCaptureState.Callback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Starts to receive the update of SmartCaptureState.

      Input Parameters:
      @Nullable SmartCaptureState.Callback callbackSmartCaptureState update callback.
      Collision Avoidance
      method
      method setCollisionAvoidanceEnabled
      void setCollisionAvoidanceEnabled(boolean enable, @Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.COLLISION_AVOIDANCE_ENABLED
      Description:

      Enable collision avoidance. When enabled, the aircraft will stop and try to go around detected obstacles.

      Input Parameters:
      boolean enableA boolean value.
      @Nullable final CompletionCallback callbackCompletion callback.
      method getCollisionAvoidanceEnabled
      void getCollisionAvoidanceEnabled(@NonNull CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.COLLISION_AVOIDANCE_ENABLED
      Description:

      Gets collision avoidance status (enabled/disabled).

      Input Parameters:
      @NonNull CompletionCallbackWith<Boolean> callbackThe execution callback with the returned value(s).
      method setUpwardsAvoidanceEnabled
      void setUpwardsAvoidanceEnabled(Boolean enabled, @Nullable CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.UPWARDS_AVOIDANCE_ENABLED
      Description:

      Enables/disables upward avoidance. When the Inspire 2's upwards-facing infrared sensor detects an obstacle, the aircraft will slow its ascent and maintain a minimum distance of 1 meter from the obstacle. The sensor has a 10-degree horizontal field of view (FOV) and 10-degree vertical FOV. The maximum detection distance is 5m.

      Input Parameters:
      Boolean enabledtrue to enable the upwards avoidance.
      @Nullable CompletionCallback callbackCompletion callback that receives the setter result.
      method getUpwardsAvoidanceEnabled
      void getUpwardsAvoidanceEnabled(@NonNull CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.UPWARDS_AVOIDANCE_ENABLED
      Description:

      Gets upward avoidance status (enabled/disabled).

      Input Parameters:
      @NonNull CompletionCallbackWith<Boolean> callbackThe execution callback with the returned value(s).
      method setActiveObstacleAvoidanceEnabled
      void setActiveObstacleAvoidanceEnabled(boolean enabled, @Nullable CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.ACTIVE_OBSTACLE_AVOIDANCE_ENABLED
      Description:

      Enables/disables active obstacle avoidance. When enabled, and an obstacle is moving toward the aircraft, the aircraft will actively fly away from it. If while actively avoiding a moving obstacle, the aircraft detects another obstacle in its avoidance path, it will stop. setCollisionAvoidanceEnabled must also be enabled.

      Input Parameters:
      boolean enabledtrue to enable the active avoidance.
      @Nullable CompletionCallback callbackCompletion callback that receives the setter result.
      method getActiveObstacleAvoidanceEnabled
      void getActiveObstacleAvoidanceEnabled(@NonNull CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.ACTIVE_OBSTACLE_AVOIDANCE_ENABLED
      Description:

      Gets active obstacle avoidance status (enabled/disabled).

      Input Parameters:
      @NonNull CompletionCallbackWith<Boolean> callbackThe execution callback with the returned value(s).
      Advanced Gesture Control
      method
      method setAdvancedGestureControlEnabled
      void setAdvancedGestureControlEnabled(boolean enabled, @Nullable CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Enables/disables advanced gesture control. When enabled, users can use PalmLaunch, PalmLand, PalmControl and Beckon. When enabled, the various modes can be initiated by the user. In summary:
      - Aircraft starts idle on users hand
      - User double clicks the power button and FaceAware becomes active
      - Once a face is recogized, PalmLaunch will happen
      - When flying, the user can control the aircraft position by moving their palm
      - If the user waves one hand, the aircraft will fly up and backwards and start following the user.
      - If the user waves both hands, the aircraft will execute Beckon and return to the user.
      It is only supported by Spark.

      Input Parameters:
      boolean enabledtrue to enable advanced gesture control.
      @Nullable CompletionCallback callbackThe completion callback with the returned execution result.
      method getAdvancedGestureControlEnabled
      void getAdvancedGestureControlEnabled(@NonNull CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Determines whether advanced gesture control is enabled. When enabled, users can use PalmLaunch, PalmLand, PalmControl and Beckon. It is only supported by Spark.

      Input Parameters:
      @NonNull CompletionCallbackWith<Boolean> callbackThe completion callback with the returned execution result.
      Smart Capture
      method
      method isSmartCaptureSupported
      boolean isSmartCaptureSupported()
      Package:dji.sdk.flightcontroller
      Description:

      Determines if SmartCapture is supported. This feature is only supported by Mavic Air.

      Return:
      booleantrue if Smart Capture is supported.
      method setSmartCaptureEnabled
      void setSmartCaptureEnabled(boolean enabled, @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Enables/disables SmartCapture. When enabled, deep learning gesture recognition allows the user to take selfies, record videos, and control the aircraft (GestureLaunch, Follow and GestureLand) using simple hand gestures. It is only supported when isSmartCaptureSupported returns true.

      Input Parameters:
      boolean enabledtrue to enable SmartCapture.
      @Nullable CommonCallbacks.CompletionCallback callbackCompletion block with the returned execution result.
      method getSmartCaptureEnabled
      void getSmartCaptureEnabled(@NonNull CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Determines whether SmartCapture is enabled. When enabled, users can When enabled, deep learning gesture recognition allows the user to take selfies, record videos, and control the aircraft (GestureLaunch, Follow and GestureLand) using simple hand gestures. It is only supported when isSmartCaptureSupported returns true.

      Input Parameters:
      @NonNull CompletionCallbackWith<Boolean> callbackCompletion block with the returned execution result.
      method setSmartCaptureFollowingMode
      void setSmartCaptureFollowingMode(@NonNull SmartCaptureFollowingMode mode,
      @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Sets the following mode for SmartCapture. It is only valid when SmartCapture is enabled.

      Input Parameters:
      @NonNull SmartCaptureFollowingMode modeThe following mode to set.
      @Nullable CommonCallbacks.CompletionCallback callbackCompletion block with the returned execution result.
      method getSmartCaptureFollowingMode
      void getSmartCaptureFollowingMode(
      @NonNull CommonCallbacks.CompletionCallbackWith<SmartCaptureFollowingMode> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Gets the following mode for SmartCapture. It is only valid when SmartCapture is enabled.

      Input Parameters:
      @NonNull CommonCallbacks.CompletionCallbackWith<SmartCaptureFollowingMode> callbackCompletion block with the returned execution result.
      method setAdvancedPilotAssistanceSystemEnabled
      void setAdvancedPilotAssistanceSystemEnabled(boolean enabled, @Nullable CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Enables the Advanced Pilot Assistance System (APAS). When APAS is enabled, the aircraft continues to respond to user commands and plans its path according to both control stick inputs and the flight environment. APAS makes it easier to avoid obstacles and obtain smoother footage, and gives a better fly experiences. It is only valid when the aircraft is in P-mode. It is supported by Mavic Air and Mavic 2 Series.

      Input Parameters:
      boolean enabledtrue to enable APAS.
      @Nullable CompletionCallback callbackThe completion callback with the returned execution result.
      method getAdvancedPilotAssistanceSystemEnabled
      void getAdvancedPilotAssistanceSystemEnabled(@NonNull CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Determines whether the Advanced Pilot Assistance System (APAS) is enabled or not. When APAS is enabled, the aircraft continues to respond to user commands and plans its path according to both control stick inputs and the flight environment. APAS makes it easier to avoid obstacles and obtain smoother footage, and gives a better fly experiences. It is only supported by Mavic Air.

      Input Parameters:
      @NonNull CompletionCallbackWith<Boolean> callbackThe completion callback with the returned execution result.
      RTH Obstacle Avoidance
      method
      method setRTHObstacleAvoidanceEnabled
      void setRTHObstacleAvoidanceEnabled(boolean enabled, @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Enables Obstacle Avoidance during RTH. This is only active when the environment is bright enough. It is not active when the aircraft is landing. CAUTION: If RTH Obstacle Avoidance is disabled, aircraft will not check obstacles during RTH or ascend to avoid obstacles, which may cause great risks.

      Input Parameters:
      boolean enabledtrue to enable Obstacle Avoidance during RTH.
      @Nullable CommonCallbacks.CompletionCallback callbackCompletion callback that receives the setter result.
      method getRTHObstacleAvoidanceEnabled
      void getRTHObstacleAvoidanceEnabled(@NonNull CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Determines if Obstacle Avoidance is enabled during RTH. This is only active when the environment is bright enough. It is not active when the aircraft is landing. CAUTION: If RTH Obstacle Avoidance is disabled, aircraft will not check obstacles during RTH or ascend to avoid obstacles, which may cause great risks.

      Input Parameters:
      @NonNull CompletionCallbackWith<Boolean> callbackCompletion callback with the returned value(s).
      RTH Remote Obstacle Avoidance
      method
      method setRTHRemoteObstacleAvoidanceEnabled
      void setRTHRemoteObstacleAvoidanceEnabled(boolean enabled,
      @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Enables Remote Obstacle Avoidance during RTH. Enabling this, the aircraft will adjust its RTH route automatically to avoid obstacles in far distance. The gimbal will not respond to any commands from the application or the remote controller.

      Input Parameters:
      boolean enabledtrue to enable Remote Obstacle Avoidance during RTH.
      @Nullable CommonCallbacks.CompletionCallback callbackCompletion callback that receives the setter result.
      method getRTHRemoteObstacleAvoidanceEnabled
      void getRTHRemoteObstacleAvoidanceEnabled(@NonNull CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Determines if RTH Remote Obstacle Avoidance is enabled or not. When it is enabled, the aircraft will adjust its RTH route automatically to avoid obstacles in far distance. The gimbal will not respond to any commands from the application or the remote controller.

      Input Parameters:
      @NonNull CompletionCallbackWith<Boolean> callbackCompletion callback with the returned value(s).
      Bottom Auxiliary Lighting
      method
      method setBottomAuxiliaryLightMode
      void setBottomAuxiliaryLightMode(@NonNull BottomAuxiliaryLightMode mode, @Nullable CommonCallbacks.CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Sets the mode for the auxiliary light at the bottom of the aircraft. It is only supported by Mavic 2 series.

      Input Parameters:
      @NonNull BottomAuxiliaryLightMode modeThe lighting mode to set.
      @Nullable CommonCallbacks.CompletionCallback callbackCompletion callback that receives the setter result.
      method getBottomAuxiliaryLightMode
      void getBottomAuxiliaryLightMode(
      @NonNull CommonCallbacks.CompletionCallbackWith<BottomAuxiliaryLightMode> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Gets the mode for the auxiliary light at the bottom of the aircraft. It is only supported by Mavic 2 series.

      Input Parameters:
      @NonNull CommonCallbacks.CompletionCallbackWith<BottomAuxiliaryLightMode> callbackCompletion callback with the returned value(s).
      Vision Positioning
      method
      method setVisionAssistedPositioningEnabled
      void setVisionAssistedPositioningEnabled(boolean enabled, @Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.VISION_ASSISTED_POSITIONING_ENABLED
      Description:

      Enable vision positioning. Vision positioning is used to augment GPS to improve location accuracy when hovering and improve velocity calculation when flying.

      Input Parameters:
      boolean enabledtrue to enable vision assisted positioning.
      @Nullable final CompletionCallback callbackCompletion callback.
      method getVisionAssistedPositioningEnabled
      void getVisionAssistedPositioningEnabled(@NonNull final CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.VISION_ASSISTED_POSITIONING_ENABLED
      Description:

      Gets vision positioning status (enabled/disabled).

      Input Parameters:
      @NonNull final CompletionCallbackWith<Boolean> callbackThe execution callback with the returned value(s).
      Precision Landing
      method
      method setPrecisionLandingEnabled
      void setPrecisionLandingEnabled(boolean enabled, @Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.PRECISION_LANDING_ENABLED
      Description:

      Enables/disables precision landing. When enabled, the aircraft will record its take-off location visually (as well as with GPS). On a Return-To-Home action the aircraft will attempt to perform a precision landing using the additional visual information. This method only works on a Return-To-Home action when the home location is successfully recorded during take-off, and not changed during flight.

      Input Parameters:
      boolean enabledtrue to enable the precise landing.
      @Nullable final CompletionCallback callbackcallback block that receives the setter result.
      method getPrecisionLandingEnabled
      void getPrecisionLandingEnabled(@NonNull final CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.PRECISION_LANDING_ENABLED
      Description:

      Gets precision landing status (enabled/disabled).

      Input Parameters:
      @NonNull final CompletionCallbackWith<Boolean> callbackThe execution callback with the returned value(s).
      Landing Protection
      method
      method setLandingProtectionEnabled
      void setLandingProtectionEnabled(boolean enabled, @Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.LANDING_PROTECTION_ENABLED
      Description:

      Enables/disables landing protection. During auto-landing, the downwards facing vision sensor will check if the ground surface is flat enough for a safe landing. If it is not and landing protection is enabled, then landing will abort and need to be manually performed by the user.

      Input Parameters:
      boolean enabledtrue to enable the landing protection.
      @Nullable final CompletionCallback callback<<>android:Callback> that receives the setter result.
      method getLandingProtectionEnabled
      void getLandingProtectionEnabled(@NonNull final CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.LANDING_PROTECTION_ENABLED
      Description:

      Gets landing protection status (enabled/disabled).

      Input Parameters:
      @NonNull final CompletionCallbackWith<Boolean> callbackThe execution callback with the returned value(s).
      interface
      interface Callback
      interface Callback
      Package:dji.common.flightcontroller.flightassistant
      Description:

      Callback to update the FaceAwareState.

      Interface Methods:

      Callback Method

      State
      method
      method onUpdate
      void onUpdate(FaceAwareState state)
      Package:dji.common.flightcontroller.flightassistant
      Description:

      Callback function that updates the FaceAware state. When starting a PalmLaunch, the aircraft will start FaceAware. If FaceAware activates successfully, the motors will start spinning and the aircraft will hover after releasing it.

      Input Parameters:
      FaceAwareState stateThe face sware state.
      interface
      interface Callback
      interface Callback
      Package:dji.common.flightcontroller.flightassistant
      Description:

      Callback to update the PalmControlState.

      Interface Methods:

      Callback Method

      State
      method
      method onUpdate
      void onUpdate(PalmControlState state)
      Package:dji.common.flightcontroller.flightassistant
      Description:

      Callback function that updates the palm control state.

      Input Parameters:
      PalmControlState stateThe palm control state.
      interface
      interface Callback
      interface Callback
      Package:dji.common.flightcontroller.flightassistant
      Description:

      Callback to update the SmartCaptureState.

      Interface Methods:

      Callback Method

      State
      method
      method onUpdate
      void onUpdate(SmartCaptureState state)
      Package:dji.common.flightcontroller.flightassistant
      Description:

      Callback function that updates the SmartCapture state. It is only supported by Mavic Air.

      Input Parameters:
      SmartCaptureState stateThe SmartCapture state.
      enum BottomAuxiliaryLightMode
      enum BottomAuxiliaryLightMode
      Package:dji.common.flightcontroller.flightassistant
      SDK Key:FlightControllerKey.BOTTOM_AUXILIARY_LIGHT_MODE
      Description:

      Modes for the auxiliary light at the bottom of the aircraft.

      Enum Members:
      AUTOThe auto mode. In this mode, the auxiliary light will be turned on automatically when the downward vision system is active but the environment is too dark.
      ONThe auxiliary light is on.
      OFFThe auxiliary light is off.
      BEACONBeacon mode. In this mode, the auxiliary light will have different behaviors in different conditions:
      - When the aircraft just takes off, the auxiliary light will have the same behavior as ''DJIBottomAuxiliaryLightMode_Auto''.
      - When the aircraft ascends above 5.5 meters, the auxiliary light starts to blink in 1Hz.
      - When the aircraft descends below 4.5 meters, the auxiliary light will have the same behavior as ''DJIBottomAuxiliaryLightMode_Auto''. This mode is only supported by Mavic 2 Enterprise.
      UNKNOWNUnknown.
      Class Members:
      enum FaceAwareState
      @EXClassNullAway
      enum FaceAwareState
      Package:dji.common.flightcontroller.flightassistant
      Description:

      FaceAware states. FaceAware is a step of PalmLaunch. Tapping the battery battery power button twice, FaceAware will start to work automatically. If FaceAware is activated successfully, the aircraft will takeoff from the palm.

      Enum Members:
      IDLEThe aircraft is not executing FaceAware.
      ACTIVATINGThe aircraft is in the process of detecting a human face in front of the camera.
      ACTIVATEDFaceAware has been activated. The aircraft will beep twice and the motors will start spinning.
      FAILED_NO_FACE_DETECTEDFaceAware has failed to activate because no face was detected.
      UNKNOWNUnknown.
      Class Members:
      enum PalmControlState
      @EXClassNullAway
      enum PalmControlState
      Package:dji.common.flightcontroller.flightassistant
      Description:

      States of PalmControl.

      Enum Members:
      INITIALIZINGThe aircraft is initializing for PalmControl.
      RECOGNIZING_PALMThe aircraft is recognizing the palm.
      STARTING_FOLLOWThe aircraft is moving into position for the PalmControl Follow command. In this state, the aircraft is ascending and flying backward to a position that is 3m horizontally away from the user and 2.3m above the ground. Once it has reached this position, the state will move to FOLLOWING and the aircraft will then follow the user. The Follow command can be initiated by raising one arm and quickly waving your hand at the camera.
      FOLLOWINGThe aircraft is currently following the user. To reach this state, the user first raises one arm and quickly waves their hand at the aircraft's camera. The aircraft will then move into position (3m from the user and 2.3m above the ground), and reach this state.
      ADJUSTING_POSITIONThe aircraft's position is being adjusted by the moving palm.
      PALM_CONTROL_STOPPEDPalmControl is stopped. PalmControl can be stopped by moving the sticks on the physical remote controller or sending commands through MobileRemoteController when the physical remote controller is absent.
      UNKNOWNUnknown.
      Class Members: