DJI Windows SDK Documentation

class FlightAssistantHandler

sealed class FlightAssistantHandler
Declaration:DJI.WindowsSDK.Components
Description:

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

Class Members:
property
property ProductIndex
uint ProductIndex { get; }
Declaration:DJI.WindowsSDK.Components
Description:

The index of the product to which this component handler belongs. The default product index is 0.

property ComponentIndex
uint ComponentIndex { get; }
Declaration:DJI.WindowsSDK.Components
Description:

The index of the component. It is unique for a type of components inside a product. It is useful when a product has multiple handlers of the same kind. If the product only has one handler of this kind, the index is 0.

method ~FlightAssistantHandler
~FlightAssistantHandler()
Declaration:DJI.WindowsSDK.Components
Description:

The destructor. It should not be called explicitly.

struct ObstacleDetectionSector
struct ObstacleDetectionSector
Declaration:DJI.WindowsSDK
Description:

A class containes the infomation of obstacel detection sector.

Struct Members:
ObstacleDetectionSectorWarning warningLevelThe warning level of obstacle detection.
double obstacleDistanceInMetersThe distance of the obstracle in meters.
struct VissionDetectionState
struct VissionDetectionState
Declaration:DJI.WindowsSDK
Description:

The state of vission detection.

Struct Members:
bool isSensorBeingUsedIf the sensor being used. The sensor would not be working if this value is false.
VisionSystemWarning systemWarningSystem warning of vision.
VisionSensorPosition positionPostion of the vision sensor.
double obstacleDistanceInMetersDistance of obstacle in meters.
struct VisionSystemWarningMsg
struct VisionSystemWarningMsg
Declaration:DJI.WindowsSDK
Description:

A class that contains a system warning type of vision systems.

Struct Members:
VisionSystemWarning valueThe actual value of the class.
enum LandingProtectionState
enum LandingProtectionState
Declaration:DJI.WindowsSDK
Description:

Values of landing protection.

Enum Members:
NONEThe aircraft is not executing auto-landing or the downward vision sensor has not started to analyze the ground yet.
ANALYZINGThe downward vision sensor is analyzing the ground at the landing zone.
ANALYSIS_FAILEDThe downward vision sensor's analysis failed. Either the auto-landing can be attempted again, or the user needs to land the aircraft manually.
SAFE_TO_LANDThe ground is flat and the aircraft is safe to land automatically.
NOT_SAFE_TO_LANDLanding area is not flat enough to be considered safe for landing. The aircraft should be moved to an area that is more flat and an auto-land should be attempted again or the user should land the aircraft manually.
UNKNOWNUnknown.
enum VisionSensorPosition
enum VisionSensorPosition
Declaration:DJI.WindowsSDK
Description:

Position of the vision sensor.

Enum Members:
NOSEThe sensor is on the front or nose of the aircraft.
TAILThe sensor is on the back or tail of the aircraft.
RIGHTThe sensor is on the right or starboard side of the aircraft.
LEFTThe sensor is on the left or port side of the aircraft.
UNKNOWNUnknown.
enum ObstacleDetectionSectorWarning
enum ObstacleDetectionSectorWarning
Declaration:DJI.WindowsSDK
Description:

Warning level values of obstalcle detection.

Enum Members:
INVALIDThe warning level is invalid. The sector cannot determine depth of the scene in front of it.
LEVEL_1Level 1.
LEVEL_2Level 2.
LEVEL_3Level 3.
LEVEL_4Level 4.
LEVEL_5Level 5.
LEVEL_6Level 6.
UNKNOWNUNKNOWN.
enum VisionSystemWarning
enum VisionSystemWarning
Declaration:DJI.WindowsSDK
Description:

Distance warning returned by the front vision system. Warning Level 4 is the most serious level.

Enum Members:
INVALIDThe warning is invalid. The front vision system cannot determine depth of the scene in front of it.
SAFEThe distance between the obstacle detected by the vision system and the aircraft is safe (over 2 meters).
DANGEROUSThe distance between the obstacle detected by the vision system and the aircraft is dangerous (less than 2 meters).
UNKNOWNUnknown.
enum BottomAuxiliaryLightMode
enum BottomAuxiliaryLightMode
Declaration:DJI.WindowsSDK
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.
struct BottomAuxiliaryLightModeMsg
struct BottomAuxiliaryLightModeMsg
Declaration:DJI.WindowsSDK
Description:

A class that contains the mode for the auxiliary light at the bottom of the aircraft.

Struct Members:
BottomAuxiliaryLightMode valueThe actual value of the class.
delegate LandingProtectionStateMsgChangedEventHandler
delegate void LandingProtectionStateMsgChangedEventHandler(object sender, LandingProtectionStateMsg? value)
Declaration:DJI.WindowsSDK
Description:

A delegate type used to subscribe the updated values in type LandingProtectionStateMsg.

delegate GoHomeAssessmentValueChangedEventHandler
delegate void GoHomeAssessmentValueChangedEventHandler(object sender, GoHomeAssessmentValue? value)
Declaration:DJI.WindowsSDK
Description:

A delegate type used to subscribe the updated values in type GoHomeAssessmentValue.

delegate VissionDetectionStateChangedEventHandler
delegate void VissionDetectionStateChangedEventHandler(object sender, VissionDetectionState? value)
Declaration:DJI.WindowsSDK
Description:

A delegate type used to subscribe the updated values in type VissionDetectionState.

Methods
method
method GetIsBrakingAsync
async Task<ResultValue<BoolMsg?>> GetIsBrakingAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Determines if the aircraft is braking automatically to avoid collision

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method GetRTHObstacleAvoidanceEnabledAsync
async Task<ResultValue<BoolMsg?>> GetRTHObstacleAvoidanceEnabledAsync()
Declaration:DJI.WindowsSDK.Components
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.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method SetRTHObstacleAvoidanceEnabledAsync
async Task<SDKError> SetRTHObstacleAvoidanceEnabledAsync(BoolMsg value)
Declaration:DJI.WindowsSDK.Components
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:
BoolMsg valueA parameter object of type BoolMsg.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method SetObstacleAvoidanceEnabledAsync
async Task<SDKError> SetObstacleAvoidanceEnabledAsync(BoolMsg value)
Declaration:DJI.WindowsSDK.Components
Description:

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

Input Parameters:
BoolMsg valueA parameter object of type BoolMsg.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method GetObstacleAvoidanceEnabledAsync
async Task<ResultValue<BoolMsg?>> GetObstacleAvoidanceEnabledAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Determines if the obstacle avoidance is enabled.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method SetVisionAssistedPositioningEnabledAsync
async Task<SDKError> SetVisionAssistedPositioningEnabledAsync(BoolMsg value)
Declaration:DJI.WindowsSDK.Components
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:
BoolMsg valueA parameter object of type BoolMsg.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method GetVisionAssistedPositioningEnabledAsync
async Task<ResultValue<BoolMsg?>> GetVisionAssistedPositioningEnabledAsync()
Declaration:DJI.WindowsSDK.Components
Description:

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

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method GetPrecisionLandingEnabledAsync
async Task<ResultValue<BoolMsg?>> GetPrecisionLandingEnabledAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Determines if precision landing is enabled. 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.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method GetIsPerformingPrecisionLandingAsync
async Task<ResultValue<BoolMsg?>> GetIsPerformingPrecisionLandingAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Determines if the aircraft is performing precision landing.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method GetIsAscentLimitedByObstacleAsync
async Task<ResultValue<BoolMsg?>> GetIsAscentLimitedByObstacleAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Determines if the aircraft's ascent is limited by obstacle. True if the aircraft will not ascend further because of an obstacle detected within 1m above it.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method GetAdvancedPilotAssistanceSystemEnableAsync
async Task<ResultValue<BoolMsg?>> GetAdvancedPilotAssistanceSystemEnableAsync()
Declaration:DJI.WindowsSDK.Components
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.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method SetAdvancedPilotAssistanceSystemEnableAsync
async Task<SDKError> SetAdvancedPilotAssistanceSystemEnableAsync(BoolMsg value)
Declaration:DJI.WindowsSDK.Components
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:
BoolMsg valueA parameter object of type BoolMsg.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method GetIsAdvancedPilotAssistanceSystemActiveAsync
async Task<ResultValue<BoolMsg?>> GetIsAdvancedPilotAssistanceSystemActiveAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Determines if Advanced Pilot Assistance System (APAS) is active. When it is active, the aircraft will change flight path automatically to avoid obstacles.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method GetLandingProtectionStateAsync
async Task<ResultValue<LandingProtectionStateMsg?>> GetLandingProtectionStateAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Get the state of landing protection. This status is valid when landing protection is enabled.

Return:
async Task<ResultValue<LandingProtectionStateMsg?>>A Task<ResultValue<LandingProtectionStateMsg?>> object.
method GetVissionDetectionStateAsync
async Task<ResultValue<VissionDetectionState?>> GetVissionDetectionStateAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Get the state of vision detection.

Return:
async Task<ResultValue<VissionDetectionState?>>A Task<ResultValue<LandingProtectionStateMsg?>> object.
method GetUpwardsAvoidanceEnableAsync
async Task<ResultValue<BoolMsg?>> GetUpwardsAvoidanceEnableAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Determines if upward avoidance is enabled. When the aircraft'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.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method SetUpwardsAvoidanceEnableAsync
async Task<SDKError> SetUpwardsAvoidanceEnableAsync(BoolMsg value)
Declaration:DJI.WindowsSDK.Components
Description:

Enables/disables upward avoidance. When the aircraft'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:
BoolMsg valueA parameter object of type BoolMsg.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method GetIMUStateAsync
async Task<ResultValue<IMUStates?>> GetIMUStateAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Get the state of IMU.

Return:
async Task<ResultValue<IMUStates?>>A Task<ResultValue<IMUStates?>> object.
method GetIMUCountAsync
async Task<ResultValue<IntMsg?>> GetIMUCountAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Get the count of IMUs.

Return:
async Task<ResultValue<IntMsg?>>A Task<ResultValue<IntMsg?>> object.
method GetGoHomeAssessmentAsync
async Task<ResultValue<GoHomeAssessmentValue?>> GetGoHomeAssessmentAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Get the aircraft's smart go home data if smart go home is enabled.

Return:
async Task<ResultValue<GoHomeAssessmentValue?>>A Task<ResultValue<GoHomeAssessmentValue?>> object.
method SetPrecisionLandingEnabledAsync
async Task<SDKError> SetPrecisionLandingEnabledAsync(BoolMsg value)
Declaration:DJI.WindowsSDK.Components
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:
BoolMsg valueA parameter object of type BoolMsg.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method GetLandingProtectionEnabledAsync
async Task<ResultValue<BoolMsg?>> GetLandingProtectionEnabledAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Determines if landing protection is enabled. 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.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method SetLandingProtectionEnabledAsync
async Task<SDKError> SetLandingProtectionEnabledAsync(BoolMsg value)
Declaration:DJI.WindowsSDK.Components
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:
BoolMsg valueA parameter object of type BoolMsg.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
method GetConnectionAsync
async Task<ResultValue<BoolMsg?>> GetConnectionAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Determines if a component is connected or not.

Return:
async Task<ResultValue<BoolMsg?>>A Task<ResultValue<BoolMsg?>> object.
method GetSerialNumberAsync
async Task<ResultValue<StringMsg?>> GetSerialNumberAsync()
Declaration:DJI.WindowsSDK.Components
Description:

Gets the serial number of the component.

Return:
async Task<ResultValue<StringMsg?>>A Task<ResultValue<StringMsg?>> object.
method GetBottomAuxiliaryLightModeAsync
async Task<ResultValue<BottomAuxiliaryLightModeMsg?>> GetBottomAuxiliaryLightModeAsync()
Declaration:DJI.WindowsSDK.Components
Description:

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

Return:
async Task<ResultValue<BottomAuxiliaryLightModeMsg?>>A Task<ResultValue<Value_BottomAuxiliaryLightModeMsg?>> object.
method SetBottomAuxiliaryLightModeAsync
async Task<SDKError> SetBottomAuxiliaryLightModeAsync(BottomAuxiliaryLightModeMsg value)
Declaration:DJI.WindowsSDK.Components
Description:

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

Input Parameters:
BottomAuxiliaryLightModeMsg valueA parameter object of type BottomAuxiliaryLightModeMsg.
Return:
async Task<SDKError>A Task<SDKErrorCode> object.
event IsBrakingChanged
event BoolMsgChangedEventHandler IsBrakingChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive changes about whether the aircraft is braking automatically to avoid collision.

event RTHObstacleAvoidanceEnabledChanged
event BoolMsgChangedEventHandler RTHObstacleAvoidanceEnabledChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive the change about whether Obstacle Avoidance is enabled during RTH.

event ObstacleAvoidanceEnabledChanged
event BoolMsgChangedEventHandler ObstacleAvoidanceEnabledChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive the change about whether the obstacle avoidance is enabled.

event VisionAssistedPositioningEnabledChanged
event BoolMsgChangedEventHandler VisionAssistedPositioningEnabledChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive the change about whether vision positioning is enabled. Vision positioning is used to augment GPS to improve location accuracy when hovering and improve velocity calculation when flying.

event PrecisionLandingEnabledChanged
event BoolMsgChangedEventHandler PrecisionLandingEnabledChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive the change about whether precision landing is enabled.

event IsPerformingPrecisionLandingChanged
event BoolMsgChangedEventHandler IsPerformingPrecisionLandingChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive the change about if the aircraft is perfoming precision landing.

event IsAscentLimitedByObstacleChanged
event BoolMsgChangedEventHandler IsAscentLimitedByObstacleChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive the change about is the aircraft's ascent limited by obstacle. True if the aircraft will not ascend further because of an obstacle detected within 1m above it.

event AdvancedPilotAssistanceSystemEnableChanged
event BoolMsgChangedEventHandler AdvancedPilotAssistanceSystemEnableChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe event to receive the change about 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 valid when the aircraft is in P-mode. It is supported by Mavic Air and Mavic 2 Series.

event IsAdvancedPilotAssistanceSystemActiveChanged
event BoolMsgChangedEventHandler IsAdvancedPilotAssistanceSystemActiveChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe event to receive the change about whether the Advanced Pilot Assistance System (APAS) is active. When it is active, the aircraft will change flight path automatically to avoid obstacles.

event LandingProtectionStateChanged
event LandingProtectionStateMsgChangedEventHandler LandingProtectionStateChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe event to receive the change about the state of landing protection. This status is valid when landing protection is enabled.

event VissionDetectionStateChanged
event VissionDetectionStateChangedEventHandler VissionDetectionStateChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe event to receive the change about the state of vision detection.

event UpwardsAvoidanceEnableChanged
event BoolMsgChangedEventHandler UpwardsAvoidanceEnableChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe event to receive the change about whether upward avoidance is enable. When the aircraft'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.

event IMUStateChanged
event IMUStatesChangedEventHandler IMUStateChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe event to receive the change about the IMU state.

event IMUCountChanged
event IntMsgChangedEventHandler IMUCountChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe event to receive the change about the count of IMUs.

event GoHomeAssessmentChanged
event GoHomeAssessmentValueChangedEventHandler GoHomeAssessmentChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe event to receive the change about the aircraft's smart go home data if smart go home is enabled.

event LandingProtectionEnabledChanged
event BoolMsgChangedEventHandler LandingProtectionEnabledChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive the change about whether landing protection is enabled. 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.

event ConnectionChanged
event BoolMsgChangedEventHandler ConnectionChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive a component's connection change.

event SerialNumberChanged
event StringMsgChangedEventHandler SerialNumberChanged
Declaration:DJI.WindowsSDK.Components
Description:

Subscribe the event to receive the change of the component's serial number.