Flight Controller

2024-07-12
No Rating

Catalog

Enum

E_DjiFlightControllerRCLostAction
E_DjiFlightControllerRtkPositionEnableStatus
E_DjiFlightControllerObstacleAvoidanceEnableStatus
E_DjiFlightControllerEmergencyStopMotor
E_DjiFlightControllerJoystickCtrlAuthorityAction
E_DjiFlightControllerJoystickCtrlAuthority
E_DjiFlightControllerJoystickCtrlAuthoritySwitchEvent
E_DjiFlightControllerHorizontalControlMode
E_DjiFlightControllerVerticalControlMode
E_DjiFlightControllerYawControlMode
E_DjiFlightControllerHorizontalCoordinate
E_DjiFlightControllerStableControlMode
E_DjiFlightControllerRCLostActionEnableStatus

Struct

T_DjiFlightControllerJoystickCtrlAuthorityEventInfo
T_DjiFlightControllerJoystickMode
T_DjiFlightControllerJoystickCommand
T_DjiFlightControllerHomeLocation
T_DjiFlightControllerGeneralInfo
T_DjiFlightControllerRidInfo

Function

DjiFlightController_Init
DjiFlightController_DeInit
DjiFlightController_SetRtkPositionEnableStatus
DjiFlightController_GetRtkPositionEnableStatus
DjiFlightController_SetRCLostAction
DjiFlightController_GetRCLostAction
DjiFlightController_SetHorizontalVisualObstacleAvoidanceEnableStatus
DjiFlightController_GetHorizontalVisualObstacleAvoidanceEnableStatus
DjiFlightController_SetHorizontalRadarObstacleAvoidanceEnableStatus
DjiFlightController_GetHorizontalRadarObstacleAvoidanceEnableStatus
DjiFlightController_SetUpwardsVisualObstacleAvoidanceEnableStatus
DjiFlightController_GetUpwardsVisualObstacleAvoidanceEnableStatus
DjiFlightController_SetUpwardsRadarObstacleAvoidanceEnableStatus
DjiFlightController_GetUpwardsRadarObstacleAvoidanceEnableStatus
DjiFlightController_SetDownwardsVisualObstacleAvoidanceEnableStatus
DjiFlightController_GetDownwardsVisualObstacleAvoidanceEnableStatus
DjiFlightController_ArrestFlying
DjiFlightController_CancelArrestFlying
DjiFlightController_TurnOnMotors
DjiFlightController_TurnOffMotors
DjiFlightController_EmergencyStopMotor
DjiFlightController_StartTakeoff
DjiFlightController_StartLanding
DjiFlightController_CancelLanding
DjiFlightController_StartConfirmLanding
DjiFlightController_StartForceLanding
DjiFlightController_SetHomeLocationUsingGPSCoordinates
DjiFlightController_SetHomeLocationUsingCurrentAircraftLocation
DjiFlightController_SetGoHomeAltitude
DjiFlightController_GetGoHomeAltitude
DjiFlightController_GetCountryCode
DjiFlightController_StartGoHome
DjiFlightController_CancelGoHome
DjiFlightController_ObtainJoystickCtrlAuthority
DjiFlightController_ReleaseJoystickCtrlAuthority
DjiFlightController_RegJoystickCtrlAuthorityEventCallback
DjiFlightController_ExecuteJoystickAction
DjiFlightController_ExecuteEmergencyBrakeAction
DjiFlightController_CancelEmergencyBrakeAction
DjiFlightController_GetGeneralInfo
DjiFlightController_SetRCLostActionEnableStatus
DjiFlightController_GetEnableRCLostActionStatus
DjiFlightController_RegTriggerFtsEventCallback

Definition, Enum and Struct

Enum E_DjiFlightControllerRCLostAction

The aircraft's actions when RC is lost.

typedef enum {
DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_HOVER = 0,  /*!< Aircraft will execute hover action when RC is lost. */
DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_LANDING = 1,  /*!< Aircraft will execute land action when RC is lost. */
DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_GOHOME = 2,  /*!< Aircraft will execute go-home action when RC is lost. */
} E_DjiFlightControllerRCLostAction;

Enum E_DjiFlightControllerRtkPositionEnableStatus

Enable/Disable RTK position enum

typedef enum {
DJI_FLIGHT_CONTROLLER_DISABLE_RTK_POSITION = 0, /*!< 0: The aircraft will use GPS data instead of RTK data to execute
* actions which requires location information(waypoint, go home...)
*/
DJI_FLIGHT_CONTROLLER_ENABLE_RTK_POSITION = 1, /*!< 1:The aircraft will use RTK data instead of GPS data to execute
* actions which requires location information(waypoint, go home...)*/
} E_DjiFlightControllerRtkPositionEnableStatus;

Enum E_DjiFlightControllerObstacleAvoidanceEnableStatus

Enable/Disable obstacle sensing enum

typedef enum {
DJI_FLIGHT_CONTROLLER_DISABLE_OBSTACLE_AVOIDANCE = 0, /*!< 0: The aircraft will not perform obstacle sensing in
* the specified direction */
DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE = 1, /*!< 0: The aircraft will perform obstacle sensing in the
* specified direction */
} E_DjiFlightControllerObstacleAvoidanceEnableStatus;

Enum E_DjiFlightControllerEmergencyStopMotor

Enable/Disable emergency stop motor function enum

Note: Enable emergency-stop-motor function is very dangerous in the air. It will make the aircraft crash!!!

typedef enum {
DJI_FLIGHT_CONTROLLER_ENABLE_EMERGENCY_STOP_MOTOR = 0x01, /*!< Execute emergency-stop-motor action */
} E_DjiFlightControllerEmergencyStopMotor;

Enum E_DjiFlightControllerJoystickCtrlAuthorityAction

Obtain/Release joystick control permission command enum

Note: You have obtained joystick control permission successfully before using joystick.

typedef enum {
DJI_FLIGHT_CONTROLLER_RELEASE_JOYSTICK_CTRL_AUTHORITY = 0, /*!< Obtain joystick permission */
DJI_FLIGHT_CONTROLLER_OBTAIN_JOYSTICK_CTRL_AUTHORITY = 1, /*!< Release joystick permission */
} E_DjiFlightControllerJoystickCtrlAuthorityAction;

Enum E_DjiFlightControllerJoystickCtrlAuthority

The aircraft's joystick control permission owner enum

typedef enum {
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_RC = 0,  /*!< RC could control aircraft with joystick. */
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_MSDK = 1, /*!< MSDK could control aircraft with joystick. */
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_INTERNAL = 2, /*!< Special Internal modules could control aircraft
* with joystick. */
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_OSDK = 4, /*!< PSDK could control aircraft with joystick. */
} E_DjiFlightControllerJoystickCtrlAuthority;

Enum E_DjiFlightControllerJoystickCtrlAuthoritySwitchEvent

The aircraft's joystick control permission switch reason enum

typedef enum {
DJI_FLIGHT_CONTROLLER_MSDK_GET_JOYSTICK_CTRL_AUTH_EVENT = 1, /*!< MSDK gets the joystick control permission. */
DJI_FLIGHT_CONTROLLER_INTERNAL_GET_JOYSTICK_CTRL_AUTH_EVENT = 2,  /*!< A specific internal modules gets the joystick control permission. */
DJI_FLIGHT_CONTROLLER_OSDK_GET_JOYSTICK_CTRL_AUTH_EVENT = 3, /*!< PSDK gets the joystick control permission. */
DJI_FLIGHT_CONTROLLER_RC_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT = 4, /*!< Reset the joystick control permission to RC when executing RC lost action */
DJI_FLIGHT_CONTROLLER_RC_NOT_P_MODE_RESET_JOYSTICK_CTRL_AUTH_EVENT = 5,  /*!< Reset the joystick control permission to RC when RC is not in P mode */
DJI_FLIGHT_CONTROLLER_RC_SWITCH_MODE_GET_JOYSTICK_CTRL_AUTH_EVENT = 6,  /*!< Set the joystick control permission to RC when RC switches control mode(T/APS) */
DJI_FLIGHT_CONTROLLER_RC_PAUSE_GET_JOYSTICK_CTRL_AUTH_EVENT = 7, /*!< Reset the joystick control permission to RC when RC pauses */
DJI_FLIGHT_CONTROLLER_RC_REQUEST_GO_HOME_GET_JOYSTICK_CTRL_AUTH_EVENT = 8, /*!< Reset the joystick control permission to RC when RC requests to go home*/
DJI_FLIGHT_CONTROLLER_LOW_BATTERY_GO_HOME_RESET_JOYSTICK_CTRL_AUTH_EVENT = 9, /*!< Reset the joystick control permission to RC when aircraft is executing low-battery-go-home*/
DJI_FLIGHT_CONTROLLER_LOW_BATTERY_LANDING_RESET_JOYSTICK_CTRL_AUTH_EVENT = 10, /*!< Reset the joystick control permission to RC when aircraft is executing low-battery-landing*/
DJI_FLIGHT_CONTROLLER_OSDK_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT = 11, /*!< Reset the joystick control permission to RC when PSDK is lost*/
DJI_FLIGHT_CONTROLLER_NERA_FLIGHT_BOUNDARY_RESET_JOYSTICK_CTRL_AUTH_EVENT = 12, /*!< Reset the joystick control permission to RC when aircraft is near boundary.*/
} E_DjiFlightControllerJoystickCtrlAuthoritySwitchEvent;

Enum E_DjiFlightControllerHorizontalControlMode

Horizon control mode enum in joystick mode

Note: Need to be referenced to either the ground or body frame by E_DjiFlightControllerHorizontalCoordinate setting Limit: -150deg/s to 150.0 deg/s

typedef enum {
/**
* @brief Control pitch & roll & angle of the aircraft.
* @note Need to be referenced to either the ground or body frame by E_DjiFlightControllerHorizontalCoordinate setting.
* Limit: -35 degree to 35 degree
*/
DJI_FLIGHT_CONTROLLER_HORIZONTAL_ANGLE_CONTROL_MODE = 0,
/**
* @brief Set the control mode to control horizontal vehicle velocities.
* @note Need to be referenced to either the ground or body frame by E_DjiFlightControllerHorizontalCoordinate setting
* Limit: -30m/s to 30 m/s
*/
DJI_FLIGHT_CONTROLLER_HORIZONTAL_VELOCITY_CONTROL_MODE = 1,
/**
* @brief Set the control mode to control position offsets of pitch & roll directions.
* @note Need to be referenced to either the ground or body frame by E_DjiFlightControllerHorizontalCoordinate setting
* Limit: N/A
*/
DJI_FLIGHT_CONTROLLER_HORIZONTAL_POSITION_CONTROL_MODE = 2,
/**
* @brief Set the control mode to control rate of change of the vehicle's attitude.
* @note Need to be referenced to either the ground or body frame by E_DjiFlightControllerHorizontalCoordinate setting
* Limit: -150deg/s to 150.0 deg/s
*/
DJI_FLIGHT_CONTROLLER_HORIZONTAL_ANGULAR_RATE_CONTROL_MODE = 3
} E_DjiFlightControllerHorizontalControlMode;

Enum E_DjiFlightControllerVerticalControlMode

Vertical control mode enum in joystick mode

Note: Range: 0 % to 100 %

typedef enum {
/**
* @brief Set the control mode to control the vertical speed of aircraft, setting the upward as positive/
* @note Limit: -5 m/s to 5 m/s
*/
DJI_FLIGHT_CONTROLLER_VERTICAL_VELOCITY_CONTROL_MODE = 0,

/**
* @brief Set the control mode to control the height of aircraft
* @note Limit: 0 m to 120 m
*/
DJI_FLIGHT_CONTROLLER_VERTICAL_POSITION_CONTROL_MODE = 1,

/**
* @brief Set the control mode to directly control the thrust
* @note Range: 0 % to 100 %
*/
DJI_FLIGHT_CONTROLLER_VERTICAL_THRUST_CONTROL_MODE = 2,
} E_DjiFlightControllerVerticalControlMode;

Enum E_DjiFlightControllerYawControlMode

Yaw control mode enum in joystick mode

Note: Same reference frame as YAW_ANGLE. Limit: -150 deg/s to 150 deg/s

typedef enum {
/**
* @brief Set the control mode to control yaw angle.
* @note Yaw angle is referenced to the ground frame. In this control mode, Ground frame is enforced in Autopilot.
*/
DJI_FLIGHT_CONTROLLER_YAW_ANGLE_CONTROL_MODE = 0x00,

/**
* @brief Set the control-mode to control yaw angular velocity
* @note Same reference frame as YAW_ANGLE.
* Limit: -150 deg/s to 150 deg/s
*/
DJI_FLIGHT_CONTROLLER_YAW_ANGLE_RATE_CONTROL_MODE = 1
} E_DjiFlightControllerYawControlMode;

Enum E_DjiFlightControllerHorizontalCoordinate

Horizontal coordinate enum in joystick mode

typedef enum {
DJI_FLIGHT_CONTROLLER_HORIZONTAL_GROUND_COORDINATE = 0, /*!< Set the x-y of ground frame as the horizontal frame (NEU) */
DJI_FLIGHT_CONTROLLER_HORIZONTAL_BODY_COORDINATE = 1 /*!< Set the x-y of body frame as the horizontal frame (FRU) */
} E_DjiFlightControllerHorizontalCoordinate;

Enum E_DjiFlightControllerStableControlMode

Stable mode enum in joystick mode

Note: Only works in horizontal velocity control mode. In velocity stable mode, aircraft will brake and hover at one position once the input command is zero. In velocity non-stable mode, aircraft will follow the velocity command and not hover when the command is zero. That means aircraft will drift with the wind.

typedef enum {
DJI_FLIGHT_CONTROLLER_STABLE_CONTROL_MODE_DISABLE = 0, /*!< Disable the stable mode */
DJI_FLIGHT_CONTROLLER_STABLE_CONTROL_MODE_ENABLE = 1   /*!< Enable the stable mode */
} E_DjiFlightControllerStableControlMode;

Enum E_DjiFlightControllerRCLostActionEnableStatus

Stable mode enum in joystick mode

Note: Only works in horizontal velocity control mode. In velocity stable mode, aircraft will brake and hover at one position once the input command is zero. In velocity non-stable mode, aircraft will follow the velocity command and not hover when the command is zero. That means aircraft will drift with the wind.

typedef enum {
DJI_FLIGHT_CONTROLLER_ENABLE_RC_LOST_ACTION = 0,
DJI_FLIGHT_CONTROLLER_DISABLE_RC_LOST_ACTION = 1,
} E_DjiFlightControllerRCLostActionEnableStatus;

Struct T_DjiFlightControllerJoystickCtrlAuthorityEventInfo

The aircraft's joystick control permission switch event info enum

typedef struct {
E_DjiFlightControllerJoystickCtrlAuthority curJoystickCtrlAuthority; /*!< The aircraft's joystick control permission owner */
E_DjiFlightControllerJoystickCtrlAuthoritySwitchEvent joystickCtrlAuthoritySwitchEvent; /*!< The aircraft's joystick control permission switch reason */
} T_DjiFlightControllerJoystickCtrlAuthorityEventInfo;

Struct T_DjiFlightControllerJoystickMode

Joystick mode. @note You need to set joystick mode first before start to send joystick command to aircraft.

Note: You need to set joystick mode first before start to send joystick command to aircraft.

typedef struct {
E_DjiFlightControllerHorizontalControlMode horizontalControlMode; /*!< See reference of E_DjiFlightControllerHorizontalControlMode*/
E_DjiFlightControllerVerticalControlMode verticalControlMode; /*!< See reference of E_DjiFlightControllerVerticalControlMode*/
E_DjiFlightControllerYawControlMode yawControlMode; /*!< See reference of E_DjiFlightControllerYawControlMode*/
E_DjiFlightControllerHorizontalCoordinate horizontalCoordinate; /*!< See reference of E_DjiFlightControllerHorizontalCoordinate*/
E_DjiFlightControllerStableControlMode stableControlMode; /*!< See reference of E_DjiFlightControllerStableControlMode*/
} T_DjiFlightControllerJoystickMode;

typedef struct T_DjiFlightControllerJoystickCommand

typedef struct {
    dji_f32_t x;   /*!< Control with respect to the x axis.*/
    dji_f32_t y;   /*!< Control with respect to the y axis.*/
    dji_f32_t z;   /*!< Control with respect to the z axis, up is positive. */
    dji_f32_t yaw; /*!< Yaw position/velocity control w.r.t. the ground frame.*/
} T_DjiFlightControllerJoystickCommand;// pack(1)

typedef struct T_DjiFlightControllerHomeLocation

typedef struct {
dji_f64_t latitude;  /*!< unit: rad */
dji_f64_t longitude; /*!< unit: rad */
} T_DjiFlightControllerHomeLocation; // pack(1)

Struct T_DjiFlightControllerGeneralInfo

Note: You need to set joystick mode first before start to send joystick command to aircraft.

typedef struct {
char serialNum[32];
} T_DjiFlightControllerGeneralInfo;

Struct T_DjiFlightControllerRidInfo

Note: You need to set joystick mode first before start to send joystick command to aircraft.

typedef struct {
dji_f64_t latitude;  /*!< unit: rad */
dji_f64_t longitude; /*!< unit: rad */
uint16_t altitude;
} T_DjiFlightControllerRidInfo;

Function

Function DjiFlightController_Init

Initialise flight controller module

T_DjiReturnCode DjiFlightController_Init(T_DjiFlightControllerRidInfo ridInfo);
Parameter
ridInfo:Must report the correct RID information before using PSDK to control the aircraft.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_DeInit

DeInitialise flight controller module.

T_DjiReturnCode DjiFlightController_DeInit(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetRtkPositionEnableStatus

Enable/Disable RTK position function. @details Enabling RTK means that RTK data will be used instead of GPS during flight.

T_DjiReturnCode DjiFlightController_SetRtkPositionEnableStatus(E_DjiFlightControllerRtkPositionEnableStatus rtkEnableStatus);
Parameter
rtkEnableStatus:refer to "E_DjiFlightControllerRtkPositionEnableStatus", inheriting from Pilot.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetRtkPositionEnableStatus

Get RTK enable status.

Note: Enabling RTK means that RTK data will be used during intelligent flight.

T_DjiReturnCode DjiFlightController_GetRtkPositionEnableStatus(E_DjiFlightControllerRtkPositionEnableStatus *rtkEnableStatus);
Parameter
rtkEnableStatus:refer to "E_DjiFlightControllerRtkPositionEnableStatus", inheriting from Pilot.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetRCLostAction

Set RC lost action.

Note: Valid when RC and PSDK are both lost. It only supports M30.

T_DjiReturnCode DjiFlightController_SetRCLostAction(E_DjiFlightControllerRCLostAction rcLostAction);
Parameter
rcLostAction:actions when RC is lost.(hover/landing/go home).It inherits from Pilot's param.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetRCLostAction

Get RC lost action(hover/landing/gohome).

Note: Valid when RC and PSDK are both lost. It only supports M30.

T_DjiReturnCode DjiFlightController_GetRCLostAction(E_DjiFlightControllerRCLostAction *rcLostAction);
Parameter
rcLostAction:see reference of E_DjiFlightControllerRCLostAction.It inherits from Pilot's param.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetHorizontalVisualObstacleAvoidanceEnableStatus

Enable/Disable horizontal visual(forwards,backwards,left,right) obstacle sensing.

Note: For detailed parameters of obstacle sensing, it is recommended to read the official user manual in https://www.dji.com.

T_DjiReturnCode DjiFlightController_SetHorizontalVisualObstacleAvoidanceEnableStatus( E_DjiFlightControllerObstacleAvoidanceEnableStatus horizontalObstacleAvoidanceEnableStatus);
Parameter
horizontalObstacleAvoidanceEnableStatus:see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetHorizontalVisualObstacleAvoidanceEnableStatus

Get the switch status of horizontal visual(forwards,backwards,left,right) obstacle sensing.

Note: For detailed parameters of obstacle sensing, it is recommended to read the official user manual in https://www.dji.com.

T_DjiReturnCode DjiFlightController_GetHorizontalVisualObstacleAvoidanceEnableStatus( E_DjiFlightControllerObstacleAvoidanceEnableStatus *horizontalObstacleAvoidanceEnableStatus);
Parameter
horizontalObstacleAvoidanceEnableStatus:see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetHorizontalRadarObstacleAvoidanceEnableStatus

Enable/Disable horizontal radar obstacle sensing.

Note: It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle sensing, it is recommended to read the official user manual in https://www.dji.com.

T_DjiReturnCode DjiFlightController_SetHorizontalRadarObstacleAvoidanceEnableStatus( E_DjiFlightControllerObstacleAvoidanceEnableStatus horizontalObstacleAvoidanceEnableStatus);
Parameter
horizontalObstacleAvoidanceEnableStatus:see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetHorizontalRadarObstacleAvoidanceEnableStatus

Get the switch status of horizontal radar obstacle sensing.

Note: It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle sensing, it is recommended to read the official user manual in https://www.dji.com/uk/matrice-300/downloads.

T_DjiReturnCode DjiFlightController_GetHorizontalRadarObstacleAvoidanceEnableStatus( E_DjiFlightControllerObstacleAvoidanceEnableStatus *horizontalObstacleAvoidanceEnableStatus);
Parameter
horizontalObstacleAvoidanceEnableStatus:see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetUpwardsVisualObstacleAvoidanceEnableStatus

Enable/Disable upwards visual obstacle sensing.

Note: For detailed parameters of obstacle sensing, it is recommended to read the official user manual in https://www.dji.com.

T_DjiReturnCode DjiFlightController_SetUpwardsVisualObstacleAvoidanceEnableStatus( E_DjiFlightControllerObstacleAvoidanceEnableStatus upwardsObstacleAvoidanceEnableStatus);
Parameter
upwardsObstacleAvoidanceEnableStatus:see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetUpwardsVisualObstacleAvoidanceEnableStatus

Get the switch status of upwards visual obstacle sensing.

Note: For detailed parameters of obstacle sensing, it is recommended to read the official user manual in https://www.dji.com.

T_DjiReturnCode DjiFlightController_GetUpwardsVisualObstacleAvoidanceEnableStatus( E_DjiFlightControllerObstacleAvoidanceEnableStatus *upwardsObstacleAvoidanceEnableStatus);
Parameter
upwardsObstacleAvoidanceEnableStatus:see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetUpwardsRadarObstacleAvoidanceEnableStatus

Enable/Disable upwards radar obstacle sensing.

Note: It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle sensing, it is recommended to read the official user manual in https://www.dji.com.

T_DjiReturnCode DjiFlightController_SetUpwardsRadarObstacleAvoidanceEnableStatus( E_DjiFlightControllerObstacleAvoidanceEnableStatus upwardsObstacleAvoidanceEnableStatus);
Parameter
upwardsObstacleAvoidanceEnableStatus:see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetUpwardsRadarObstacleAvoidanceEnableStatus

Get the switch status of upwards radar obstacle sensing.

Note: For detailed parameters of obstacle sensing, it is recommended to read the official user manual in https://www.dji.com.

T_DjiReturnCode DjiFlightController_GetUpwardsRadarObstacleAvoidanceEnableStatus( E_DjiFlightControllerObstacleAvoidanceEnableStatus *upwardsObstacleAvoidanceEnableStatus);
Parameter
upwardsObstacleAvoidanceEnableStatus:see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetDownwardsVisualObstacleAvoidanceEnableStatus

Enable/Disable downwards visual obstacle sensing.

Note: For detailed parameters of obstacle sensing, it is recommended to read the official user manual in https://www.dji.com.

T_DjiReturnCode DjiFlightController_SetDownwardsVisualObstacleAvoidanceEnableStatus( E_DjiFlightControllerObstacleAvoidanceEnableStatus downwardsObstacleAvoidanceEnableStatus);
Parameter
downwardsObstacleAvoidanceEnableStatus:see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetDownwardsVisualObstacleAvoidanceEnableStatus

Get the switch status of downwards visual obstacle sensing.

Note: For detailed parameters of obstacle sensing, it is recommended to read the official user manual in https://www.dji.com.

T_DjiReturnCode DjiFlightController_GetDownwardsVisualObstacleAvoidanceEnableStatus( E_DjiFlightControllerObstacleAvoidanceEnableStatus *downwardsObstacleAvoidanceEnableStatus);
Parameter
downwardsObstacleAvoidanceEnableStatus:see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_ArrestFlying

Arrest flying means emergency braking

Note: When the aircraft is on the ground, it will stop motors and display "hms description" on App. when the aircraft is in the air, it will continue flying and display "hms description" on App only. If you use this interface, you need to use "DjiFlightController_CancelArrestFlying" to quit arrest-flying status, then then the aircraft can fly again.

T_DjiReturnCode DjiFlightController_ArrestFlying(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_CancelArrestFlying

Quit status of arrest-flying.

Note: The aircraft need to quit status of arrest-flying to continue flying after arresting flying.

T_DjiReturnCode DjiFlightController_CancelArrestFlying(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_TurnOnMotors

Turn on motors when the aircraft is on the ground.

T_DjiReturnCode DjiFlightController_TurnOnMotors(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_TurnOffMotors

Turn off motors when the aircraft is on the ground.

T_DjiReturnCode DjiFlightController_TurnOffMotors(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_EmergencyStopMotor

Emergency stop motor in any case.

Note: If you want to turn on motor after emergency stopping motor, you need to use the interface to send disable command to quit lock-motor status.

T_DjiReturnCode DjiFlightController_EmergencyStopMotor(E_DjiFlightControllerEmergencyStopMotor cmd, char debugMsg[EMERGENCY_STOP_MOTOR_MSG_MAX_LENGTH]);
Parameter
cmd:see reference of E_DjiFlightControllerEmergencyStopMotor
debugMsg:inject debug message to flight control FW for logging, size limit: 10 bytes
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_StartTakeoff

Request taking off action when the aircraft is on the ground.

T_DjiReturnCode DjiFlightController_StartTakeoff(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_StartLanding

Request landing action when the aircraft is in the air.

T_DjiReturnCode DjiFlightController_StartLanding(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_CancelLanding

Request cancelling landing action when the aircraft is landing

T_DjiReturnCode DjiFlightController_CancelLanding(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_StartConfirmLanding

Confirm the landing when the aircraft is 0.7 m above the ground.

Note: When the clearance between the aircraft and the ground is less than 0.7m, the aircraft will pause landing and wait for user's confirmation. This API is for confirm landing. If the ground is not suitable for landing, user must use RC to control it landing manually or force landing.

T_DjiReturnCode DjiFlightController_StartConfirmLanding(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_StartForceLanding

Force landing in any case.

Note: This API will ignore the smart landing function. When using this API, it will landing directly (would not stop at 0.7m and wait user's command). Attention: it may make the aircraft crash!!!

T_DjiReturnCode DjiFlightController_StartForceLanding(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetHomeLocationUsingGPSCoordinates

Set customized GPS(not RTK) home location.

Note: Set customized home location failed reason may as follows: 1. The distance between new home location and last home location is larger than MAX_FLY_RADIUS(20 km). 2. Record initial home location failed after start aircraft.

T_DjiReturnCode DjiFlightController_SetHomeLocationUsingGPSCoordinates(T_DjiFlightControllerHomeLocation homeLocation);
Parameter
homeLocation:homeLocation include latitude and longitude
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetHomeLocationUsingCurrentAircraftLocation

Set home location using current aircraft GPS (not RTK) location.

Note: Set home location failed reasons may as follows: 1. Aircraft's gps level can't reach the condition of recording home location. 2. Record initial home location failed after start aircraft.

T_DjiReturnCode DjiFlightController_SetHomeLocationUsingCurrentAircraftLocation(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetGoHomeAltitude

Set go home altitude.

Note: If aircraft's current altitude is higher than the setting value of go home altitude, aircraft will go home using current altitude. Otherwise, it will climb to setting of go home altitude ,and then execute go home action. Go home altitude setting is 20-1500 m.

T_DjiReturnCode DjiFlightController_SetGoHomeAltitude(E_DjiFlightControllerGoHomeAltitude altitude);
Parameter
altitude:go home altitude, unit: meter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetGoHomeAltitude

Get go home altitude.

T_DjiReturnCode DjiFlightController_GetGoHomeAltitude(E_DjiFlightControllerGoHomeAltitude *altitude);
Parameter
altitude:go home altitude, unit: meter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetCountryCode

Get country code.

T_DjiReturnCode DjiFlightController_GetCountryCode(uint16_t *countryCode);
Parameter
countryCode:Pointer of buffer to return country code. The country code indicates the current country or region where the aircraft is located. Please refer to the ISO 3166-1 code table for the specific meaning of the country code.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_StartGoHome

Request go home action when the aircraft is in the air

T_DjiReturnCode DjiFlightController_StartGoHome(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_CancelGoHome

Request cancel go home action when the aircraft is going home

T_DjiReturnCode DjiFlightController_CancelGoHome(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_ObtainJoystickCtrlAuthority

Obtain aircraft's joystick control permission.

Note: 1.You have to obtain joystick control permission successfully before you using joystick to control aircraft. 2. RC must be in p-mode.

T_DjiReturnCode DjiFlightController_ObtainJoystickCtrlAuthority(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_ReleaseJoystickCtrlAuthority

Release aircraft's joystick control permission.

Note: RC must be in p-mode.

T_DjiReturnCode DjiFlightController_ReleaseJoystickCtrlAuthority(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_RegJoystickCtrlAuthorityEventCallback

Subscribe to joystick control permission switch event with a callback function.

Note: it will be triggered once the joystick control permission switch event occurs.

T_DjiReturnCode DjiFlightController_RegJoystickCtrlAuthorityEventCallback(JoystickCtrlAuthorityEventCbFunc callback);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_ExecuteJoystickAction

Request execute joystick action.

T_DjiReturnCode DjiFlightController_ExecuteJoystickAction(T_DjiFlightControllerJoystickCommand joystickCommand);
Parameter
joystickCommand:include x/y/z/yaw.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_ExecuteEmergencyBrakeAction

Request emergency brake action.

T_DjiReturnCode DjiFlightController_ExecuteEmergencyBrakeAction(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_CancelEmergencyBrakeAction

Request cancel emergency brake action.

Note: It is only support on M30.If you use DjiFlightController_ExecuteEmergencyBrakeAction(), you need to use "DjiFlightController_CancelEmergencyBrakeAction()" to allow aircraft to execute aircraft action again.

T_DjiReturnCode DjiFlightController_CancelEmergencyBrakeAction(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetGeneralInfo

Get general info of the aircraft.

T_DjiReturnCode DjiFlightController_GetGeneralInfo(T_DjiFlightControllerGeneralInfo *generalInfo);
Parameter
generalInfo:the struct stored the serial num which contains a array of chars var in case the user gives an
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_SetRCLostActionEnableStatus

The command decides whether execute RC lost action or not when PSDK is running.

Note: This setting only affects the behavior of the aircraft when the RC lost and the PSDK is connected. if the command is enable, the aircraft will not execute RC lost action when RC is lost but PSDK is running; if the command is disable, the aircraft will execute RC lost action when RC is lost but PSDK is running the aircraft will execute RC lost action when RC is lost and PSDK is lost whatever the command is. default command is disable.

T_DjiReturnCode DjiFlightController_SetRCLostActionEnableStatus(E_DjiFlightControllerRCLostActionEnableStatus command);
Parameter
generalInfo:the struct stored the serial num which contains a array of chars var in case the user gives an illegal length character pointer
executeRCLostActionOrNotWhenOnboardOn:enable:1;disable:0
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_GetEnableRCLostActionStatus

Get RC lost action enable status(enable or disable).

T_DjiReturnCode DjiFlightController_GetEnableRCLostActionStatus(E_DjiFlightControllerRCLostActionEnableStatus *command);
Parameter
command:executeRCLostActionOrNotWhenOnboardOn, enable:1;disable:0
Return
The details for the return code please refer to: DjiErrorCode

Function DjiFlightController_RegTriggerFtsEventCallback

Register callback function for the trigger FTS event.

Note: The timing of the trigger of the callback function of the FTS is determined by the aircraft, and the trigger execution action of the FTS needs to be implemented in the callback function and the correct return value must be returned, otherwise the aircraft will always be triggered.

T_DjiReturnCode DjiFlightController_RegTriggerFtsEventCallback(TriggerFtsEventCallback callback);
Parameter
callback:the callback for the trigger FTS event.
Return
The details for the return code please refer to: DjiErrorCode

If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.