M350b版本

This commit is contained in:
xin
2026-01-08 16:00:08 +08:00
parent 7396728ea7
commit a76d4b77e9
213 changed files with 8883 additions and 7196579 deletions

View File

@ -29,7 +29,6 @@
/* Includes ------------------------------------------------------------------*/
#include "dji_typedef.h"
#ifdef __cplusplus
extern "C" {
#endif
@ -114,6 +113,7 @@ typedef enum {
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.*/
DJI_FLIGHT_CONTROLLER_DOCK_REQUEST_CHANGE_JOYSTICK_CTRL_AUTH_EVENT = 13, /*!< Dock request change the joystick control permission.*/
} E_DjiFlightControllerJoystickCtrlAuthoritySwitchEvent;
/**
@ -237,6 +237,17 @@ typedef enum {
DJI_FLIGHT_CONTROLLER_DISABLE_RC_LOST_ACTION = 1,
} E_DjiFlightControllerRCLostActionEnableStatus;
typedef enum {
DJI_FLIGHT_CONTROLLER_NO_MOTOR_IN_SLOW_ROTATE_MODE = 0,
DJI_FLIGHT_CONTROLLER_SOME_MOTOR_IN_SLOW_ROTATE_MODE = 1,
DJI_FLIGHT_CONTROLLER_ALL_MOTOR_IN_SLOW_ROTATE_MODE = 2,
} E_DjiFlightControllerElectronicSpeedControllerStatus;
typedef enum {
DJI_FLIGHT_CONTROLLER_FTS_NOT_TRIGGERD = 0,
DJI_FLIGHT_CONTROLLER_FTS_TRIGGERD = 1,
} E_DjiFlightControllerFtsStatus;
/**
* @brief Joystick mode.
* @note You need to set joystick mode first before start to send joystick command to aircraft.
@ -272,6 +283,62 @@ typedef struct {
uint16_t altitude;
} T_DjiFlightControllerRidInfo;
typedef struct
{
double lat; /*!< Target point latitude, unit: rad */
double lon; /*!< Target point longitude, unit: rad */
float alt; /*!< Target point altitude, ellipsoidal height unit: meters */
} T_DjiFlightControllerPointInfo;
typedef struct
{
uint8_t version; /*!< Function version */
int8_t operation; /*!< New upload of a target point or update of the current task's target point; 0: new order, 1: update goal */
float mea; /*!< Minimum enroute height, in meters, relative to the takeoff point.
If the aircraft has not started or is on the ground, it will first climb to this height before executing the task. This height is ignored if the aircraft is in the air. */
uint8_t fly_vel; /*!< Maximum horizontal flight speed to the target point, in meters per second */
uint8_t goal_num; /*!< Number of target points, currently only supports one point */
T_DjiFlightControllerPointInfo cmd_mode_point_info[1]; /*!< Information of the target point */
} T_DjiFlightControllerStartMissionReq;
typedef struct
{
uint8_t ret_code; /*!< 0: Start task successfully, 1: Start task failed */
uint16_t error_code; /*!< Instruction flight route version reused route error code */
uint8_t code_name; /*!< Task code, unique, will be included in the trajectory push to ensure that external modules can correlate the task with its trajectory */
} T_DjiFlightControllerStartMissionRsp;
typedef struct
{
uint8_t mission_state_machine; /*!< Task state machine, 0 is idle, others are in progress.*/
uint8_t mission_planning_algo; /*!< Task planning algorithm mode */
uint8_t goal_index; /*!< Current target point index */
float distance_remaining; /*!< Remaining task distance */
float time_remaining; /*!< Remaining task time */
uint8_t soe_remaining; /*!< Required SOE (State of Energy) */
uint8_t progress; /*!< Progress, reserved unused */
uint8_t success_rate; /*!< Task success rate, reserved unused */
} T_DjiFlightControllerOpenMis;
typedef struct
{
int32_t latitude; /*!< GPS latitude, unit: 1/2^32 * 180°, range: [-90°, 90°) */
int32_t longitude; /*!< GPS longitude, unit: 1/2^32 * 360°, range: [-180°, 180°) */
int32_t altitude; /*!< Altitude, unit: mm; Note: The type of altitude depends on the function definition.
It could be: relative to the takeoff point, WGS84 absolute ellipsoidal height, EGM96 absolute altitude, barometric height, etc. */
} T_DjiFlightControllerSpotlightZoomGps;
typedef struct
{
uint8_t code_name; /*!< Unique task code for this trajectory push */
uint8_t point_num; /*!< Number of key points in the trajectory */
uint8_t byte_per_point; /*!< Number of bytes per point */
T_DjiFlightControllerSpotlightZoomGps points[1]; /*!< Array of key points in the trajectory */
uint8_t last_point_type; /*!< Whether the target point can be reached
0: Yes, the last point in the trajectory is the user's target point
1: No, the user's target point is in an invalid area (e.g., within an NFZ or building), the last point is the closest point to the target */
} T_DjiFlightControllerCoreTraj;
#pragma pack()
/* Exported functions --------------------------------------------------------*/
@ -288,6 +355,81 @@ T_DjiReturnCode DjiFlightController_Init(T_DjiFlightControllerRidInfo ridInfo);
*/
T_DjiReturnCode DjiFlightController_DeInit(void);
/**
* @brief Set planning algorithm.
* @param algo: 0:smart height, 1:Manual height.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_SetPlanningAlgo(uint8_t algo);
/**
* @brief Set max velocity.
* @param value: max velocity value, min:1, max:15.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_SetMaxVelocity(uint8_t value);
/**
* @brief Set min flight height.
* @param value: min flight height value, min:1.0, max:3000.0, only SetPlanningAlgo 1 effective.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_SetMinFlightHeight(float value);
/**
* @brief Get exit reason.
* @param reason: exit reason".
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_GetExitReason(uint16_t *reason);
/**
* @brief Prototype of callback function used to get open mis info.
* @return Execution result.
*/
typedef T_DjiReturnCode (*FcCmderModeOpenMisEventCbFunc)(T_DjiFlightControllerOpenMis eventData);
/**
* @brief Prototype of callback function used to get core traj info.
* @return Execution result.
*/
typedef T_DjiReturnCode (*FcCmderModeCoreTrajEventCbFunc)(T_DjiFlightControllerCoreTraj eventData);
/**
* @brief Register callback function for the open mis event.
* @param callback: the callback for the open mis event.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_RegisterOpenMisInfoCallBack(FcCmderModeOpenMisEventCbFunc callback);
/**
* @brief Register callback function for the core traj event.
* @param callback: the callback for the core traj event.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_RegisterCoreTrajCallBack(FcCmderModeCoreTrajEventCbFunc callback);
/**
* @brief antiregister callback function for the open mis event.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_AntiRegisterOpenMisInfoCallBack(void);
/**
* @brief antiregister callback function for the core traj event.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_AntiRegisterCoreTrajCallBack(void);
/**
* @brief set mode start mission.
* @param command: cmd for start mission.
* @param rsp: response data for set start mission.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_SetModeStartMission(T_DjiFlightControllerStartMissionReq command,
T_DjiFlightControllerStartMissionRsp *rsp);
/**
* @brief Enable/Disable RTK position function.
* @details Enabling RTK means that RTK data will be used instead of GPS during flight.
@ -649,6 +791,25 @@ DjiFlightController_GetEnableRCLostActionStatus(E_DjiFlightControllerRCLostActio
*/
T_DjiReturnCode DjiFlightController_RegTriggerFtsEventCallback(TriggerFtsEventCallback callback);
/**
* @brief Start to rotate motors slowly.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_StartSlowRotateMotor(void);
/**
* @brief Stop to rotate motors slowly.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_StopSlowRotateMotor(void);
/**
* @brief Get the status of the ESC.
* @param status: The status of the motor on aircraft.
* @return Execution result.
*/
T_DjiReturnCode DjiFlightController_GetElectronicSpeedControllerStatus(E_DjiFlightControllerElectronicSpeedControllerStatus *status);
#ifdef __cplusplus
}
#endif