NEW: release DJI Payload-SDK version 3.9.0

This commit is contained in:
DJI-Martin
2024-05-16 21:08:13 +08:00
parent 51d8261d62
commit edfc329553
20 changed files with 502 additions and 460 deletions

View File

@ -41,100 +41,100 @@ extern "C" {
typedef uint16_t E_DjiFlightControllerGoHomeAltitude; /*!< Unit:meter, range 20~500 */
/**
* @brief The UAV's actions when rc is lost.
* @brief The aircraft's actions when RC is lost.
*/
typedef enum {
DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_HOVER = 0, /*!< Aircraft will execute hover cation when rc is lost. */
DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_LANDING = 1, /*!< Aircraft will execute land cation when rc is lost. */
DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_GOHOME = 2, /*!< Aircraft will execute go-home cation when rc is lost. */
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;
/**
* @brief Enable/Disable RTK position enum
*/
typedef enum {
DJI_FLIGHT_CONTROLLER_DISABLE_RTK_POSITION = 0, /*!< 0: The UAV will use GPS data instead of RTK data to execute
* actions which require location information(waypointgo home...)
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 UAV will use RTK data instead of GPS data to execute
* actions which require location information(waypointgo 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;
/**
* @brief Enable/Disable obstacle avoidance enum
* @brief Enable/Disable obstacle sensing enum
*/
typedef enum {
DJI_FLIGHT_CONTROLLER_DISABLE_OBSTACLE_AVOIDANCE = 0, /*!< 0: The UAV will not perform obstacle avoidance in
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 UAV will perform obstacle avoidance in the
DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE = 1, /*!< 0: The aircraft will perform obstacle sensing in the
* specified direction */
} E_DjiFlightControllerObstacleAvoidanceEnableStatus;
/**
* @brief Enable/Disable emergency stop motor function enum
* @note Attention:Enable emergency-stop-motor function is very dangerous in the air.it will make the aircraft crash!!!
* @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;
/**
* @brief Obtain/Release joystick control authority command enum
* @note You have obtain joystick control authority successfully before using joystick.
* @brief 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 authority */
DJI_FLIGHT_CONTROLLER_OBTAIN_JOYSTICK_CTRL_AUTHORITY = 1, /*!< Release joystick authority */
DJI_FLIGHT_CONTROLLER_RELEASE_JOYSTICK_CTRL_AUTHORITY = 0, /*!< Obtain joystick permission */
DJI_FLIGHT_CONTROLLER_OBTAIN_JOYSTICK_CTRL_AUTHORITY = 1, /*!< Release joystick permission */
} E_DjiFlightControllerJoystickCtrlAuthorityAction;
/**
* @brief The UAV's joystick control authority owner enum
* @brief The aircraft's joystick control permission owner enum
*/
typedef enum {
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_RC = 0, /*!< Rc could control UAV with joystick. */
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_MSDK = 1, /*!< MSDK could control UAV with joystick. */
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_INTERNAL = 2, /*!< Special Internal modules could control UAV
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, /*!< OSDK could control UAV with joystick. */
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_OSDK = 4, /*!< PSDK could control aircraft with joystick. */
} E_DjiFlightControllerJoystickCtrlAuthority;
/**
* @brief The UAV's joystick control authority switch reason enum
* @brief The aircraft's joystick control permission switch reason enum
*/
typedef enum {
DJI_FLIGHT_CONTROLLER_MSDK_GET_JOYSTICK_CTRL_AUTH_EVENT = 1, /*!< MSDK get joystick control authority. */
DJI_FLIGHT_CONTROLLER_INTERNAL_GET_JOYSTICK_CTRL_AUTH_EVENT = 2, /*!< Special Internal modules get joystick control authority. */
DJI_FLIGHT_CONTROLLER_OSDK_GET_JOYSTICK_CTRL_AUTH_EVENT = 3, /*!< OSDK get joystick control authority. */
DJI_FLIGHT_CONTROLLER_RC_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT = 4, /*!< Reset joystick control authority to rc when executing rc lost action */
DJI_FLIGHT_CONTROLLER_RC_NOT_P_MODE_RESET_JOYSTICK_CTRL_AUTH_EVENT = 5, /*!< Reset joystick control authority to rc when rc is not in P mode */
DJI_FLIGHT_CONTROLLER_RC_SWITCH_MODE_GET_JOYSTICK_CTRL_AUTH_EVENT = 6, /*!< Set joystick control authority to rc when rc switch control mode(T/APS) */
DJI_FLIGHT_CONTROLLER_RC_PAUSE_GET_JOYSTICK_CTRL_AUTH_EVENT = 7, /*!< Reset joystick control authority to rc when rc pausing */
DJI_FLIGHT_CONTROLLER_RC_REQUEST_GO_HOME_GET_JOYSTICK_CTRL_AUTH_EVENT = 8, /*!< Reset joystick control authority to rc when rc requesting go home*/
DJI_FLIGHT_CONTROLLER_LOW_BATTERY_GO_HOME_RESET_JOYSTICK_CTRL_AUTH_EVENT = 9, /*!< Reset joystick control authority to rc when aircraft is executing low-battery-go-home*/
DJI_FLIGHT_CONTROLLER_LOW_BATTERY_LANDING_RESET_JOYSTICK_CTRL_AUTH_EVENT = 10, /*!< Reset joystick control authority to rc when aircraft is executing low-battery-landing*/
DJI_FLIGHT_CONTROLLER_OSDK_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT = 11, /*!< Reset joystick control authority to rc when osdk is lost*/
DJI_FLIGHT_CONTROLLER_NERA_FLIGHT_BOUNDARY_RESET_JOYSTICK_CTRL_AUTH_EVENT = 12, /*!< Reset joystick control authority to rc when aircraft is near boundary.*/
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;
/**
* @brief The UAV's joystick control authority switch event info enum
* @brief The aircraft's joystick control permission switch event info enum
*/
typedef struct {
E_DjiFlightControllerJoystickCtrlAuthority curJoystickCtrlAuthority; /*!< The UAV's joystick control authority owner */
E_DjiFlightControllerJoystickCtrlAuthoritySwitchEvent joystickCtrlAuthoritySwitchEvent; /*!< The UAV's joystick control authority switch reason */
E_DjiFlightControllerJoystickCtrlAuthority curJoystickCtrlAuthority; /*!< The aircraft's joystick control permission owner */
E_DjiFlightControllerJoystickCtrlAuthoritySwitchEvent joystickCtrlAuthoritySwitchEvent; /*!< The aircraft's joystick control permission switch reason */
} T_DjiFlightControllerJoystickCtrlAuthorityEventInfo;
/**
* @brief Prototype of callback function used to get joystick control authority switch event info.
* @brief Prototype of callback function used to get joystick control permission switch event info.
* @return Execution result.
*/
typedef T_DjiReturnCode (*JoystickCtrlAuthorityEventCbFunc)(
T_DjiFlightControllerJoystickCtrlAuthorityEventInfo eventData);
/**
* @brief Horizon control mode in joystick mode enum
* @brief Horizon control mode enum in joystick mode
* @note Only when the GPS signal is good (health_flag >=3)horizontal position control (DJI_FLIGHT_CONTROLLER_HORIZONTAL_POSITION_CONTROL_MODE)
* related control modes can be used. only when GPS signal is good (health_flag >=3)or when advanced sensing system is working properly with Autopilot
* related control modes can be used. Only when GPS signal is good (health_flag >=3)or advanced sensing system is working properly with Autopilot
* horizontal velocity controlDJI_FLIGHT_CONTROLLER_HORIZONTAL_VELOCITY_CONTROL_MODE) related control modes can be used.
*/
typedef enum {
@ -145,19 +145,19 @@ typedef enum {
*/
DJI_FLIGHT_CONTROLLER_HORIZONTAL_ANGLE_CONTROL_MODE = 0,
/**
* @brief Set the control-mode to control horizontal vehicle velocities.
* @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.
* @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.
* @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
*/
@ -165,51 +165,50 @@ typedef enum {
} E_DjiFlightControllerHorizontalControlMode;
/**
* @brief Vertical control mode in joystick mode enum
* @note We suggest developers do not use VERTICAL_POSITION control mode indoor when your UAV flight height is larger than 3 meters.
* This is because in indoor environments, barometer can be inaccurate, and the vertical controller may fail to keep
* the height of the UAV.
* @brief Vertical control mode enum in joystick mode
* @note We don not recommend using VERTICAL_POSITION control mode indoors when the aircraft's flying height exceeds 3 meters.
* This is because barometer can be inaccurate indoors, and the vertical controller may fail to keep the height of the aircraft.
*/
typedef enum {
/**
* @brief Set the control-mode to control the vertical speed of UAV, upward is positive/
* @note Limit: -5m/s to 5 m/s
* @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 UAV
* @note Limit: 0m to 120 m
* @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%
* @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;
/**
* @brief Yaw control mode in joystick mode enum
* @brief Yaw control mode enum in joystick mode
*/
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.
* @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: -150deg/s to 150 deg/s
* Limit: -150 deg/s to 150 deg/s
*/
DJI_FLIGHT_CONTROLLER_YAW_ANGLE_RATE_CONTROL_MODE = 1
} E_DjiFlightControllerYawControlMode;
/**
* @brief Horizontal coordinate in joystick mode enum
* @brief 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) */
@ -217,10 +216,10 @@ typedef enum {
} E_DjiFlightControllerHorizontalCoordinate;
/*!
* @brief Stable mode in joystick mode enum.
* @note Only works in Horizontal velocity control mode.In velocity stable mode, drone will brake and hover at one position once
* the input command is zero.In velocity non-stable mode, drone will follow the velocity command and not hover when the command is zero.
* That means drone will drift with the wind.
* @brief 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 */
@ -246,9 +245,9 @@ typedef struct {
#pragma pack(1)
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 x; /*!< Controls the x axis.*/
dji_f32_t y; /*!< Controls the y axis.*/
dji_f32_t z; /*!< Controls the z axis, setting upward as positive. */
dji_f32_t yaw; /*!< Yaw position/velocity control w.r.t. the ground frame.*/
} T_DjiFlightControllerJoystickCommand;// pack(1)
@ -271,9 +270,8 @@ typedef struct {
/* Exported functions --------------------------------------------------------*/
/**
* @brief Initialise flight controller module, and user should call this function
* before using flight controller features.
* @param ridInfo: Use PSDK to control the aircraft, must report the correct RID information.
* @brief Initialise flight controller module
* @param ridInfo: Must report the correct RID information before using PSDK to control the aircraft.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_Init(T_DjiFlightControllerRidInfo ridInfo);
@ -287,8 +285,7 @@ T_DjiReturnCode DjiFlightController_DeInit(void);
/**
* @brief Enable/Disable RTK position function.
* @details Enabling RTK means that RTK data will be used instead of GPS during flight.
* @param rtkEnableStatus: see reference of "E_DjiFlightControllerRtkPositionEnableStatus".
* It keeps in sync with pilot's param.
* @param rtkEnableStatus: refer to "E_DjiFlightControllerRtkPositionEnableStatus", inheriting from Pilot.
* @return Execution result.
*/
T_DjiReturnCode
@ -297,164 +294,163 @@ DjiFlightController_SetRtkPositionEnableStatus(E_DjiFlightControllerRtkPositionE
/**
* @brief Get RTK enable status.
* @note Enabling RTK means that RTK data will be used during intelligent flight.
* @param rtkEnableStatus: see reference of "E_DjiFlightControllerRtkPositionEnableStatus".
* It keeps in sync with pilot's param.
* @param rtkEnableStatus: refer to "E_DjiFlightControllerRtkPositionEnableStatus", inheriting from Pilot.
* @return Execution result.
*/
T_DjiReturnCode
DjiFlightController_GetRtkPositionEnableStatus(E_DjiFlightControllerRtkPositionEnableStatus *rtkEnableStatus);
/**
* @brief Set rc lost action.
* @note It will be valid when rc and osdk is both lost.It only support M30.
* @param rcLostAction: actions when rc is lost.(hover/landing/go home).It keeps in sync with pilot's param.
* @brief Set RC lost action.
* @note Valid when RC and PSDK are both lost. It only supports M30.
* @param rcLostAction: actions when RC is lost.(hover/landing/go home).It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_SetRCLostAction(E_DjiFlightControllerRCLostAction rcLostAction);
/**
* @brief Get rc lost action(hover/landing/gohome).
* @note It will be valid when rc and osdk is both lost.It only support M30.
* @param rcLostAction: see reference of E_DjiFlightControllerRCLostAction.It keeps in sync with pilot's param.
* @brief Get RC lost action(hover/landing/gohome).
* @note Valid when RC and PSDK are both lost. It only supports M30.
* @param rcLostAction: see reference of E_DjiFlightControllerRCLostAction.It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_GetRCLostAction(E_DjiFlightControllerRCLostAction *rcLostAction);
/**
* @brief Enable/Disable horizontal visual(forwards,backwards,left,right) obstacle avoidance.
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
* @brief 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.
* @param horizontalObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
* It keeps in sync with pilot's param.
* It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_SetHorizontalVisualObstacleAvoidanceEnableStatus(
E_DjiFlightControllerObstacleAvoidanceEnableStatus horizontalObstacleAvoidanceEnableStatus);
/**
* @brief Get status of horizontal visual(forwards,backwards,left,right) obstacle avoidance switch.
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
* @brief 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.
* @param horizontalObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
* It keeps in sync with pilot's param.
* It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_GetHorizontalVisualObstacleAvoidanceEnableStatus(
E_DjiFlightControllerObstacleAvoidanceEnableStatus *horizontalObstacleAvoidanceEnableStatus);
/**
* @brief Enable/Disable horizontal radar obstacle avoidance.
* @note It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle avoidance,
* it is recommended to read the official user manual in https://www.dji.com/uk/matrice-300/downloads.
* @brief 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.
* @param horizontalObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
* It keeps in sync with pilot's param.
* It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_SetHorizontalRadarObstacleAvoidanceEnableStatus(
E_DjiFlightControllerObstacleAvoidanceEnableStatus horizontalObstacleAvoidanceEnableStatus);
/**
* @brief Get status of horizontal radar obstacle avoidance switch.
* @note It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle avoidance,
* @brief 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.
* @param horizontalObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
* It keeps in sync with pilot's param.
* It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_GetHorizontalRadarObstacleAvoidanceEnableStatus(
E_DjiFlightControllerObstacleAvoidanceEnableStatus *horizontalObstacleAvoidanceEnableStatus);
/**
* @brief Enable/Disable upwards visual obstacle avoidance.
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
* @brief 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.
* @param upwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
* It keeps in sync with pilot's param.
* It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_SetUpwardsVisualObstacleAvoidanceEnableStatus(
E_DjiFlightControllerObstacleAvoidanceEnableStatus upwardsObstacleAvoidanceEnableStatus);
/**
* @brief Get status of upwards visual obstacle avoidance switch.
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
* @brief 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.
* @param upwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
* It keeps in sync with pilot's param.
* It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_GetUpwardsVisualObstacleAvoidanceEnableStatus(
E_DjiFlightControllerObstacleAvoidanceEnableStatus *upwardsObstacleAvoidanceEnableStatus);
/**
* @brief Enable/Disable upwards radar obstacle avoidance.
* @note It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle avoidance,
* @brief 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.
* @param upwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
* It keeps in sync with pilot's param.
* It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_SetUpwardsRadarObstacleAvoidanceEnableStatus(
E_DjiFlightControllerObstacleAvoidanceEnableStatus upwardsObstacleAvoidanceEnableStatus);
/**
* @brief Get status of upwards radar obstacle avoidance switch
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
* @brief 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.
* @param upwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
* It keeps in sync with pilot's param.
* It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_GetUpwardsRadarObstacleAvoidanceEnableStatus(
E_DjiFlightControllerObstacleAvoidanceEnableStatus *upwardsObstacleAvoidanceEnableStatus);
/**
* @brief Enable/Disable downwards visual obstacle avoidance
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
* @brief 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.
* @param downwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
* It keeps in sync with pilot's param.
* It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_SetDownwardsVisualObstacleAvoidanceEnableStatus(
E_DjiFlightControllerObstacleAvoidanceEnableStatus downwardsObstacleAvoidanceEnableStatus);
/**
* @brief Get status of downwards visual obstacle avoidance switch
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
* @brief 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.
* @param downwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
* It keeps in sync with pilot's param.
* It inherits from Pilot's param.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_GetDownwardsVisualObstacleAvoidanceEnableStatus(
E_DjiFlightControllerObstacleAvoidanceEnableStatus *downwardsObstacleAvoidanceEnableStatus);
/**
* @brief Arrest flying.
* @note when the UAV is on the ground ,it will stop motors and display "hms description" on APP. when the UAV is
* in the air, it will continue flying and display "hms description" on APP only.
* @brief 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 UAV can fly again.
* then the aircraft can fly again.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_ArrestFlying(void);
/**
* @brief Quit status of arrest-flying.
* @note The UAV need to quit status of arrest-flying to continue flying after arresting flying.
* @note The aircraft need to quit status of arrest-flying to continue flying after arresting flying.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_CancelArrestFlying(void);
/**
* @brief Turn on motors when the UAV is on the ground.
* @brief Turn on motors when the aircraft is on the ground.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_TurnOnMotors(void);
/**
* @brief Turn off motors when the UAV is on the ground.
* @brief Turn off motors when the aircraft is on the ground.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_TurnOffMotors(void);
@ -470,36 +466,36 @@ T_DjiReturnCode DjiFlightController_TurnOffMotors(void);
T_DjiReturnCode DjiFlightController_EmergencyStopMotor(E_DjiFlightControllerEmergencyStopMotor cmd,
char debugMsg[EMERGENCY_STOP_MOTOR_MSG_MAX_LENGTH]);
/**
* @brief Request take off action when the UAV is on the ground.
* @brief Request taking off action when the aircraft is on the ground.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_StartTakeoff(void);
/**
* @brief Request landing action when the UAV is in the air.
* @brief Request landing action when the aircraft is in the air.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_StartLanding(void);
/**
* @brief Request cancel landing action when the UAV is landing
* @brief Request cancelling landing action when the aircraft is landing
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_CancelLanding(void);
/**
* @brief Confirm the landing when the UAV is 0.7m above the ground.
* @brief 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 use for confirm landing. If the ground is not suitable for landing ,user must
* use RC to control it landing manually or force landing.
* 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.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_StartConfirmLanding(void);
/**
* @brief Force landing in any case.
* @note This api will ignore the smart landing function,.When using this pi, it will landing directly (would not stop
* at 0.7m and wait user's command). Attention:it may make the aircraft crash!!!
* @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!!!
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_StartForceLanding(void);
@ -507,7 +503,7 @@ T_DjiReturnCode DjiFlightController_StartForceLanding(void);
/**
* @brief 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(20km).
* 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.
* @param homeLocation: homeLocation include latitude and longitude
* @return Execution result.
@ -515,7 +511,7 @@ T_DjiReturnCode DjiFlightController_StartForceLanding(void);
T_DjiReturnCode DjiFlightController_SetHomeLocationUsingGPSCoordinates(T_DjiFlightControllerHomeLocation homeLocation);
/**
* @brief Set home location using current aircraft GPS(not RTK) location.
* @brief 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.
@ -527,7 +523,7 @@ T_DjiReturnCode DjiFlightController_SetHomeLocationUsingCurrentAircraftLocation(
* @brief 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 20m ~ 1500m.
* Go home altitude setting is 20-1500 m.
* @param altitude: go home altitude, unit: meter
* @return Execution result.
*/
@ -550,35 +546,35 @@ T_DjiReturnCode DjiFlightController_GetGoHomeAltitude(E_DjiFlightControllerGoHom
T_DjiReturnCode DjiFlightController_GetCountryCode(uint16_t *countryCode);
/**
* @brief Request go home action when the UAV is in the air
* @brief Request go home action when the aircraft is in the air
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_StartGoHome(void);
/**
* @brief Request cancel go home action when the UAV is going home
* @brief Request cancel go home action when the aircraft is going home
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_CancelGoHome(void);
/**
* @brief Obtain UAV's joystick control authority.
* @note 1.You have to obtain joystick control authority successfully before you using joystick to control UAV.
* @brief 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.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_ObtainJoystickCtrlAuthority(void);
/**
* @brief Release UAV's joystick control authority.
* @brief Release aircraft's joystick control permission.
* @note RC must be in p-mode.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_ReleaseJoystickCtrlAuthority(void);
/**
* @brief Subscribe to joystick control authority switch event with a callback function.
* @note it will be triggered once the joystick control authority switch event occurs.
* @brief Subscribe to joystick control permission switch event with a callback function.
* @note it will be triggered once the joystick control permission switch event occurs.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_RegJoystickCtrlAuthorityEventCallback(JoystickCtrlAuthorityEventCbFunc callback);
@ -605,7 +601,7 @@ T_DjiReturnCode DjiFlightController_ExecuteEmergencyBrakeAction(void);
/**
* @brief 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 drone action again.
* "DjiFlightController_CancelEmergencyBrakeAction()" to allow aircraft to execute aircraft action again.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_CancelEmergencyBrakeAction(void);
@ -618,11 +614,11 @@ T_DjiReturnCode DjiFlightController_CancelEmergencyBrakeAction(void);
*/
T_DjiReturnCode DjiFlightController_GetGeneralInfo(T_DjiFlightControllerGeneralInfo *generalInfo);
/*! @brief The command decides whether execute RC lost action or not when osdk is running
* @note This setting only affects the behavior of the drone when the RC lost and the OSDK is connected.
* if the command is enable, the drone will not execute rc lost action when rc is lost but OSDK is running;
* if the command is disable, the drone will execute rc lost action when rc is lost but OSDK is running
* the drone will execute rc lost action when rc is lost and OSDK is lost whatever the command is.
/*! @brief 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.
* @param executeRCLostActionOrNotWhenOnboardOn enable:1;disable:0
* @return T_DjiReturnCode error code
@ -630,7 +626,7 @@ T_DjiReturnCode DjiFlightController_GetGeneralInfo(T_DjiFlightControllerGeneralI
T_DjiReturnCode
DjiFlightController_SetRCLostActionEnableStatus(E_DjiFlightControllerRCLostActionEnableStatus command);
/*! @brief get rc lost action enable status(enable or disable)
/*! @brief get RC lost action enable status(enable or disable)
* @param command executeRCLostActionOrNotWhenOnboardOn, enable:1;disable:0
* @return T_DjiReturnCode error code
*/