NEW: release DJI Payload-SDK version 3.9.1
This commit is contained in:
29
README.md
29
README.md
@ -1,8 +1,8 @@
|
|||||||
# DJI Payload SDK (PSDK)
|
# DJI Payload SDK (PSDK)
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
## What is the DJI Payload SDK?
|
## What is the DJI Payload SDK?
|
||||||
|
|
||||||
@ -23,23 +23,16 @@ to get the latest version information.
|
|||||||
|
|
||||||
## Latest Release
|
## Latest Release
|
||||||
|
|
||||||
The latest release version of PSDK is 3.9.0. This version of Payload SDK mainly add some new features support and fixed some
|
The latest release version of PSDK is 3.9.1. This version of Payload SDK mainly add some new features support and fixed some
|
||||||
bugs. Please refer to the release notes for detailed changes list.
|
bugs. Please refer to the release notes for detailed changes list.
|
||||||
|
|
||||||
* Supports the payload camera Zenmuse H30 series.
|
* GEO Caging feature supported for the M3D series models.
|
||||||
* FlyCart 30 aircraft supports the time synchronization function.
|
* Flight control function and waypoint mission supported for the FlyCart 30 model.
|
||||||
* FlyCart 30 aircraft supports HMS functions.
|
* Fixed an issue with subscribing to the flight control topics for M300 RTK and M350 RTK models.
|
||||||
* FlyCart 30 aircraft supports the data subscription function.
|
* Resolved a problem with DJI Smart Controller Enterprise not recognizing PSDK payload devices on M300 RTK.
|
||||||
* Fixed the issue with inaccurate zoom multiplier retrieval for the Mavic 3 Enterprise series cameras.
|
* Fixed an issue with acquiring the camera stream without I-frames on M3D series models.
|
||||||
* Fixed data errors on the receiving end of small data transfers from MSDK to PSDK.
|
* Added the MOP 49154 channel as an alternative to the 49152 channel for subscribing to the L2 camera's real-time 3D point cloud. This enhancement avoids conflicts when subscribing to point cloud data concurrently with Pilot2 and improves the quality of the point cloud data.
|
||||||
* Fixed the inability of devices at payload ports 2 and 3 of the M300 RTK aircraft to perform small data transmission to devices connected to the OSDK port.
|
> Note: When using M300 RTK with the DJI Smart Controller Enterprise to activate payloads via the OSDK interface, the remote controller will not recognize the payload device if the virtual serial port is not utilized.
|
||||||
* Fixed the issue where MSDK V5 and PSDK devices could not perform small data transmission when using M300 RTK and M350 RTK aircraft.
|
|
||||||
* Fixed occasional payload negotiation failures between PSDK and the M350 RTK aircraft.
|
|
||||||
* Fixed screen flickering and glitching issues with the H20T payload camera's video stream.
|
|
||||||
* Fixed issues with retrieving the visible light camera video stream from the M3TD camera.
|
|
||||||
* Optimized the C++ camera management sample.
|
|
||||||
* Optimized memory usage strategy for STM32 platform sample by introducing CCMRAM.
|
|
||||||
> Note: For M300 RTK and M350 RTK, the camera management module now checks the payload port device's status at startup. This may occasionally result in log errors. Normal function is not affected, and this will be optimized in a future release.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ typedef struct {
|
|||||||
} T_DjiMobileAppInfo;
|
} T_DjiMobileAppInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Some base information of aircraft system, mainly including some constant parameters information of system.
|
* @brief Basic information about the aircraft system, mainly including some constant parameters information.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
E_DjiAircraftSeries aircraftSeries; /*!< Aircraft series. */
|
E_DjiAircraftSeries aircraftSeries; /*!< Aircraft series. */
|
||||||
@ -68,31 +68,31 @@ typedef struct {
|
|||||||
|
|
||||||
/* Exported functions --------------------------------------------------------*/
|
/* Exported functions --------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Get base information of aircraft system, including aircraft type and DJI adapter type.
|
* @brief Basic information about the aircraft system, including aircraft type and DJI adapter type.
|
||||||
* @param baseInfo: pointer to memory space used to store base information of the aircraft system.
|
* @param baseInfo: Pointer to a memory space where the aircraft's basic information will be stored.
|
||||||
* @return Execution result.
|
* @return Execution result.
|
||||||
*/
|
*/
|
||||||
T_DjiReturnCode DjiAircraftInfo_GetBaseInfo(T_DjiAircraftInfoBaseInfo *baseInfo);
|
T_DjiReturnCode DjiAircraftInfo_GetBaseInfo(T_DjiAircraftInfoBaseInfo *baseInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get information related to mobile APP.
|
* @brief Get information related to mobile app.
|
||||||
* @note The mobile APP language and screen type is unknown if RC or APP is not connected to the aircraft system.
|
* @note Returns unknown for app language and screen type if the RC or app is not connected to the aircraft system.
|
||||||
* @param mobileAppInfo: pointer to memory space used to store information related to mobile APP.
|
* @param mobileAppInfo: Pointer to a memory space where the mobile app information will be stored.
|
||||||
* @return Execution result.
|
* @return Execution result.
|
||||||
*/
|
*/
|
||||||
T_DjiReturnCode DjiAircraftInfo_GetMobileAppInfo(T_DjiMobileAppInfo *mobileAppInfo);
|
T_DjiReturnCode DjiAircraftInfo_GetMobileAppInfo(T_DjiMobileAppInfo *mobileAppInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get connection status of payload and aircraft.
|
* @brief Get connection status between the payload and the aircraft.
|
||||||
* @note Update period: 1Hz
|
* @note Update period: 1Hz
|
||||||
* @param isConnected: pointer to connection status.
|
* @param isConnected: Pointer to connection status.
|
||||||
* @return Execution result.
|
* @return Execution result.
|
||||||
*/
|
*/
|
||||||
T_DjiReturnCode DjiAircraftInfo_GetConnectionStatus(bool *isConnected);
|
T_DjiReturnCode DjiAircraftInfo_GetConnectionStatus(bool *isConnected);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get version of aircraft.
|
* @brief Get version of the aircraft.
|
||||||
* @param aircraftVersion: pointer to aircraft version.
|
* @param aircraftVersion: Pointer to aircraft version.
|
||||||
* @return Execution result.
|
* @return Execution result.
|
||||||
*/
|
*/
|
||||||
T_DjiReturnCode DjiAircraftInfo_GetAircraftVersion(T_DjiAircraftVersion *aircraftVersion);
|
T_DjiReturnCode DjiAircraftInfo_GetAircraftVersion(T_DjiAircraftVersion *aircraftVersion);
|
||||||
|
|||||||
@ -132,7 +132,13 @@ typedef T_DjiReturnCode (*JoystickCtrlAuthorityEventCbFunc)(
|
|||||||
T_DjiFlightControllerJoystickCtrlAuthorityEventInfo eventData);
|
T_DjiFlightControllerJoystickCtrlAuthorityEventInfo eventData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Horizon control mode enum in joystick mode
|
* @brief Prototype of callback function used to get the trigger FTS event.
|
||||||
|
* @return Execution result.
|
||||||
|
*/
|
||||||
|
typedef T_DjiReturnCode (*TriggerFtsEventCallback)(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Horizon control mode in joystick mode enum
|
||||||
* @note Only when the GPS signal is good (health_flag >=3),horizontal position control (DJI_FLIGHT_CONTROLLER_HORIZONTAL_POSITION_CONTROL_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 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 control(DJI_FLIGHT_CONTROLLER_HORIZONTAL_VELOCITY_CONTROL_MODE) related control modes can be used.
|
* horizontal velocity control(DJI_FLIGHT_CONTROLLER_HORIZONTAL_VELOCITY_CONTROL_MODE) related control modes can be used.
|
||||||
@ -633,6 +639,16 @@ DjiFlightController_SetRCLostActionEnableStatus(E_DjiFlightControllerRCLostActio
|
|||||||
T_DjiReturnCode
|
T_DjiReturnCode
|
||||||
DjiFlightController_GetEnableRCLostActionStatus(E_DjiFlightControllerRCLostActionEnableStatus *command);
|
DjiFlightController_GetEnableRCLostActionStatus(E_DjiFlightControllerRCLostActionEnableStatus *command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 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.
|
||||||
|
* @param callback: the callback for the trigger FTS event.
|
||||||
|
* @return Execution result.
|
||||||
|
*/
|
||||||
|
T_DjiReturnCode DjiFlightController_RegTriggerFtsEventCallback(TriggerFtsEventCallback callback);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -52,7 +52,7 @@ typedef struct {
|
|||||||
/* Exported functions --------------------------------------------------------*/
|
/* Exported functions --------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Initialize the gimbal manager module.
|
* @brief Initialize the gimbal manager module.
|
||||||
* @note This interface must be initialized after DjiCore_Init..
|
* @note This interface must be initialized after DjiCore_Init.
|
||||||
* @return Execution result.
|
* @return Execution result.
|
||||||
*/
|
*/
|
||||||
T_DjiReturnCode DjiGimbalManager_Init(void);
|
T_DjiReturnCode DjiGimbalManager_Init(void);
|
||||||
|
|||||||
@ -215,10 +215,8 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DJI_MOBILE_APP_SCREEN_TYPE_UNKNOWN = 255, /*!< Mobile APP screen type is unknown. */
|
DJI_MOBILE_APP_SCREEN_TYPE_UNKNOWN = 255, /*!< Mobile APP screen type is unknown. */
|
||||||
DJI_MOBILE_APP_SCREEN_TYPE_BIG_SCREEN = 0, /*!< The big screen of mobile device refers to a screen
|
DJI_MOBILE_APP_SCREEN_TYPE_BIG_SCREEN = 0, /*!< Screen size is 6 inches or larger. */
|
||||||
* size greater than or equal to 6 inches. */
|
DJI_MOBILE_APP_SCREEN_TYPE_LITTLE_SCREEN = 1, /*!< Screen size is less than 6 inches. */
|
||||||
DJI_MOBILE_APP_SCREEN_TYPE_LITTLE_SCREEN = 1, /*!< The little screen of mobile device refers to a
|
|
||||||
* screen size less than 6 inches. */
|
|
||||||
} E_DjiMobileAppScreenType;
|
} E_DjiMobileAppScreenType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -250,7 +248,7 @@ typedef enum {
|
|||||||
DJI_SDK_ADAPTER_TYPE_UNKNOWN = 0, /*!< SDK adapter type is unknown. */
|
DJI_SDK_ADAPTER_TYPE_UNKNOWN = 0, /*!< SDK adapter type is unknown. */
|
||||||
DJI_SDK_ADAPTER_TYPE_SKYPORT_V2 = 1, /*!< SDK adapter type is Skyport V2. */
|
DJI_SDK_ADAPTER_TYPE_SKYPORT_V2 = 1, /*!< SDK adapter type is Skyport V2. */
|
||||||
DJI_SDK_ADAPTER_TYPE_XPORT = 2, /*!< SDK adapter type is X-Port. */
|
DJI_SDK_ADAPTER_TYPE_XPORT = 2, /*!< SDK adapter type is X-Port. */
|
||||||
DJI_SDK_ADAPTER_TYPE_NONE = 3, /*!< don't have any adapter outside */
|
DJI_SDK_ADAPTER_TYPE_NONE = 3, /*!< No external adapter is connected. */
|
||||||
} E_DjiSdkAdapterType;
|
} E_DjiSdkAdapterType;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -268,56 +266,47 @@ typedef enum {
|
|||||||
* @brief Camera focus target point when in focus mode.
|
* @brief Camera focus target point when in focus mode.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
dji_f32_t focusX; /*!< Specifies horizontal zone coordinate. This parameter is between 0 and 1.
|
dji_f32_t focusX; /*!< Specifies the horizontal coordinate within the zone. Range: 0 to 1.
|
||||||
The point [0.0, 0.0] represents the top-left angle of the screen.*/
|
The point [0.0, 0.0] represents the top-left corner of the screen.*/
|
||||||
dji_f32_t focusY; /*!< Specifies vertical zone coordinate. This parameter is between 0 and 1. */
|
dji_f32_t focusY; /*!< Specifies vertical zone coordinate. Range: 0 to 1. */
|
||||||
} T_DjiCameraPointInScreen;
|
} T_DjiCameraPointInScreen;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Camera time interval settings when in interval shootPhoto mode.
|
* @brief Camera time interval settings for interval shoot-photo mode.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t captureCount; /*!< Specifies the total capture count of interval settings.
|
uint8_t captureCount; /*!< Specifies the total capture count of interval settings.
|
||||||
* 0:reserve 1~254:number 255:keep capturing till stop */
|
* 0: reserved, 1-254: specific number, 255: continuous capture until stopped. */
|
||||||
uint16_t timeIntervalSeconds; /*!< Specifies the interval time between two captures, unit: s*/
|
uint16_t timeIntervalSeconds; /*!< Specifies the interval time between two captures, unit: s*/
|
||||||
} T_DjiCameraPhotoTimeIntervalSettings;
|
} T_DjiCameraPhotoTimeIntervalSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Camera zoom speed.
|
* @brief Camera zoom speeds.
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DJI_CAMERA_ZOOM_SPEED_SLOWEST = 72, /*!< Lens zooms in slowest speed. */
|
DJI_CAMERA_ZOOM_SPEED_SLOWEST = 72, /*!< Slowest zoom speed. */
|
||||||
DJI_CAMERA_ZOOM_SPEED_SLOW = 73, /*!< Lens zooms in slow speed. */
|
DJI_CAMERA_ZOOM_SPEED_SLOW = 73, /*!< Slow zoom speed. */
|
||||||
DJI_CAMERA_ZOOM_SPEED_MODERATELY_SLOW = 74, /*!< Lens zooms in speed slightly slower than normal speed. */
|
DJI_CAMERA_ZOOM_SPEED_MODERATELY_SLOW = 74, /*!< Slightly slower than normal zoom speed. */
|
||||||
DJI_CAMERA_ZOOM_SPEED_NORMAL = 75, /*!< Lens zooms in normal speed. */
|
DJI_CAMERA_ZOOM_SPEED_NORMAL = 75, /*!< Normal zoom speed. */
|
||||||
DJI_CAMERA_ZOOM_SPEED_MODERATELY_FAST = 76, /*!< Lens zooms very in speed slightly faster than normal speed. */
|
DJI_CAMERA_ZOOM_SPEED_MODERATELY_FAST = 76, /*!< Slightly faster than normal zoom speed. */
|
||||||
DJI_CAMERA_ZOOM_SPEED_FAST = 77, /*!< Lens zooms very in fast speed. */
|
DJI_CAMERA_ZOOM_SPEED_FAST = 77, /*!< Fast zoom speed. */
|
||||||
DJI_CAMERA_ZOOM_SPEED_FASTEST = 78, /*!< Lens zooms very in fastest speed. */
|
DJI_CAMERA_ZOOM_SPEED_FASTEST = 78, /*!< Fastest zoom speed. */
|
||||||
} E_DjiCameraZoomSpeed;
|
} E_DjiCameraZoomSpeed;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/*! The number of pictures to continuously take each time in BURST mode is 2
|
/*! The burst mode can capture 2 pictures per trigger. */
|
||||||
*/
|
|
||||||
DJI_CAMERA_BURST_COUNT_2 = 2,
|
DJI_CAMERA_BURST_COUNT_2 = 2,
|
||||||
/*! The number of pictures to continuously take each time in BURST mode is 3
|
/*! The burst mode can capture 3 pictures per trigger. */
|
||||||
*/
|
|
||||||
DJI_CAMERA_BURST_COUNT_3 = 3,
|
DJI_CAMERA_BURST_COUNT_3 = 3,
|
||||||
/*! The number of pictures to continuously take each time in BURST mode is 5
|
/*! The burst mode can capture 5 pictures per trigger. */
|
||||||
*/
|
|
||||||
DJI_CAMERA_BURST_COUNT_5 = 5,
|
DJI_CAMERA_BURST_COUNT_5 = 5,
|
||||||
/*! The number of pictures to continuously take each time in BURST mode is 7
|
/*! The burst mode can capture 7 pictures per trigger. */
|
||||||
*/
|
|
||||||
DJI_CAMERA_BURST_COUNT_7 = 7,
|
DJI_CAMERA_BURST_COUNT_7 = 7,
|
||||||
/*! The number of pictures to continuously take at one time in BURST mode is
|
/*! Supports capturing 10 pictures per trigger, only supported by X4S, X5S cameras, and Phantom 4 Pro. */
|
||||||
* 10, Only supported by X4S camera, X5S camera and Phantom 4 Pro camera.
|
|
||||||
*/
|
|
||||||
DJI_CAMERA_BURST_COUNT_10 = 10,
|
DJI_CAMERA_BURST_COUNT_10 = 10,
|
||||||
/*! The number of pictures to continuously take at one time in BURST mode is
|
/*! Supports capturing 14 pictures per trigger, only supported by X4S, X5S cameras, and Phantom 4 Pro. */
|
||||||
* 14, Only supported by X4S camera, X5S camera and Phantom 4 Pro camera.
|
|
||||||
*/
|
|
||||||
DJI_CAMERA_BURST_COUNT_14 = 14,
|
DJI_CAMERA_BURST_COUNT_14 = 14,
|
||||||
/*! The camera burst shoot count value is unknown.
|
/*! Unknown burst count. */
|
||||||
*/
|
|
||||||
DJI_CAMERA_BURST_COUNT_KNOWN = 0xFF,
|
DJI_CAMERA_BURST_COUNT_KNOWN = 0xFF,
|
||||||
} E_DjiCameraBurstCount;
|
} E_DjiCameraBurstCount;
|
||||||
|
|
||||||
@ -325,8 +314,8 @@ typedef enum {
|
|||||||
* @brief Camera zoom direction.
|
* @brief Camera zoom direction.
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DJI_CAMERA_ZOOM_DIRECTION_OUT = 0, /*!< The lens moves in the far direction, the zoom factor becomes smaller. */
|
DJI_CAMERA_ZOOM_DIRECTION_OUT = 0, /*!< Zooms out, reducing the zoom factor. */
|
||||||
DJI_CAMERA_ZOOM_DIRECTION_IN = 1, /*!< The lens moves in the near direction, the zoom factor becomes larger. */
|
DJI_CAMERA_ZOOM_DIRECTION_IN = 1, /*!< Zooms in, increasing the zoom factor. */
|
||||||
} E_DjiCameraZoomDirection;
|
} E_DjiCameraZoomDirection;
|
||||||
#pragma pack (1)
|
#pragma pack (1)
|
||||||
|
|
||||||
@ -354,55 +343,70 @@ typedef struct {
|
|||||||
bool busyState;
|
bool busyState;
|
||||||
} T_DjiDataChannelState;
|
} T_DjiDataChannelState;
|
||||||
|
|
||||||
typedef struct Vector3d {
|
/**
|
||||||
int32_t x; /*!< Specifies int32 value of x for vector. */
|
* @brief Represents a vector using int32 coordinates.
|
||||||
int32_t y; /*!< Specifies int32 value of y for vector. */
|
*/
|
||||||
int32_t z; /*!< Specifies int32 value of z for vector. */
|
typedef struct Vector3d{
|
||||||
|
int32_t x; /*!< X-coordinate of the vector. */
|
||||||
|
int32_t y; /*!< Y-coordinate of the vector. */
|
||||||
|
int32_t z; /*!< Z-coordinate of the vector. */
|
||||||
} T_DjiVector3d;
|
} T_DjiVector3d;
|
||||||
|
|
||||||
typedef struct Vector3f {
|
/**
|
||||||
dji_f32_t x; /*!< Specifies float value of x for vector. */
|
* @brief Represents a vector using floating-point coordinates.
|
||||||
dji_f32_t y; /*!< Specifies float value of y for vector. */
|
*/
|
||||||
dji_f32_t z; /*!< Specifies float value of z for vector. */
|
typedef struct Vector3f{
|
||||||
|
dji_f32_t x; /*!< X-coordinate of the vector. */
|
||||||
|
dji_f32_t y; /*!< Y-coordinate of the vector. */
|
||||||
|
dji_f32_t z; /*!< Z-coordinate of the vector. */
|
||||||
} T_DjiVector3f;
|
} T_DjiVector3f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Represents an attitude using int32 values for pitch, roll, and yaw.
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32_t pitch; /*!< Specifies int32 value of pitch for attitude. */
|
int32_t pitch; /*!< Pitch angle in degrees. */
|
||||||
int32_t roll; /*!< Specifies int32 value of roll for attitude */
|
int32_t roll; /*!< Roll angle in degrees. */
|
||||||
int32_t yaw; /*!< Specifies int32 value of yaw for attitude */
|
int32_t yaw; /*!< Yaw angle in degrees. */
|
||||||
} T_DjiAttitude3d;
|
} T_DjiAttitude3d;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Represents an attitude using floating-point values for pitch, roll, and yaw.
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
dji_f32_t pitch; /*!< Specifies float value of pitch for attitude. */
|
dji_f32_t pitch; /*!< Pitch angle in degrees. */
|
||||||
dji_f32_t roll; /*!< Specifies float value of roll for attitude */
|
dji_f32_t roll; /*!< Roll angle in degrees. */
|
||||||
dji_f32_t yaw; /*!< Specifies float value of yaw for attitude */
|
dji_f32_t yaw; /*!< Yaw angle in degrees. */
|
||||||
} T_DjiAttitude3f;
|
} T_DjiAttitude3f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Represents a quaternion, when converted to a rotation matrix or Euler angles.
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
dji_f32_t q0; /*!< w, when converted to a rotation matrix or Euler angles. */
|
dji_f32_t q0; /*!< Quaternion component w. */
|
||||||
dji_f32_t q1; /*!< x, when converted to a rotation matrix or Euler angles. */
|
dji_f32_t q1; /*!< Quaternion component x. */
|
||||||
dji_f32_t q2; /*!< y, when converted to a rotation matrix or Euler angles. */
|
dji_f32_t q2; /*!< Quaternion component y. */
|
||||||
dji_f32_t q3; /*!< z, when converted to a rotation matrix or Euler angles. */
|
dji_f32_t q3; /*!< Quaternion component z. */
|
||||||
} T_DjiQuaternion4f;
|
} T_DjiQuaternion4f;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Timestamp data structure.
|
* @brief Timestamp data structure.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t millisecond; /*!< Millisecond. */
|
uint32_t millisecond;
|
||||||
uint32_t microsecond; /*!< Microsecond. */
|
uint32_t microsecond;
|
||||||
} T_DjiDataTimestamp;
|
} T_DjiDataTimestamp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The firmware version of payload.
|
* @brief The firmware version of payload.
|
||||||
* @note If majorVersion = AA, minorVersion = BB, modifyVersion = CC, debugVersion = DD, The version show in
|
* @note The firmware version is displayed as AA.BB.CC.DD where AA is majorVersion,
|
||||||
* terminal APP is AA.BB.CC.DD
|
* BB is minorVersion, CC is modifyVersion, and DD is debugVersion.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t majorVersion; /*!< The major version of firmware, the range is 0 ~ 99. */
|
uint8_t majorVersion; /*!< Major version number, ranging from 0 to 99. */
|
||||||
uint8_t minorVersion; /*!< The minor version of firmware, the range is 0 ~ 99. */
|
uint8_t minorVersion; /*!< Minor version number, ranging from 0 to 99. */
|
||||||
uint8_t modifyVersion; /*!< The modify version of firmware, the range is 0 ~ 99. */
|
uint8_t modifyVersion; /*!< Modification version number, ranging from 0 to 99. */
|
||||||
uint8_t debugVersion; /*!< The debug version of firmware, the range is 0 ~ 99. */
|
uint8_t debugVersion; /*!< Debug version number, ranging from 0 to 99. */
|
||||||
} T_DjiFirmwareVersion;
|
} T_DjiFirmwareVersion;
|
||||||
|
|
||||||
#pragma pack ()
|
#pragma pack ()
|
||||||
|
|||||||
@ -35,9 +35,9 @@ extern "C" {
|
|||||||
/* Exported constants --------------------------------------------------------*/
|
/* Exported constants --------------------------------------------------------*/
|
||||||
#define DJI_VERSION_MAJOR 3 /*!< DJI SDK major version num, when have incompatible API changes. Range from 0 to 99. */
|
#define DJI_VERSION_MAJOR 3 /*!< DJI SDK major version num, when have incompatible API changes. Range from 0 to 99. */
|
||||||
#define DJI_VERSION_MINOR 9 /*!< DJI SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */
|
#define DJI_VERSION_MINOR 9 /*!< DJI SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */
|
||||||
#define DJI_VERSION_MODIFY 0 /*!< DJI SDK modify version num, when have backwards compatible bug fixes changes. Range from 0 to 99. */
|
#define DJI_VERSION_MODIFY 1 /*!< DJI SDK modify version num, when have backwards compatible bug fixes changes. Range from 0 to 99. */
|
||||||
#define DJI_VERSION_BETA 0 /*!< DJI SDK version beta info, release version will be 0, when beta version release changes. Range from 0 to 255. */
|
#define DJI_VERSION_BETA 0 /*!< DJI SDK version beta info, release version will be 0, when beta version release changes. Range from 0 to 255. */
|
||||||
#define DJI_VERSION_BUILD 2044 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
|
#define DJI_VERSION_BUILD 2090 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
|
||||||
|
|
||||||
/* Exported types ------------------------------------------------------------*/
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -51,17 +51,18 @@ start:
|
|||||||
|
|
||||||
std::cout
|
std::cout
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "| Available commands: |\n"
|
<< "| Available commands: |\n"
|
||||||
<< "| [0] Flight controller sample - control flying with keyboard |\n"
|
<< "| [0] Flight controller sample - control flying with keyboard |\n"
|
||||||
<< "| [1] Flight controller sample - take off landing |\n"
|
<< "| [1] Flight controller sample - take off landing |\n"
|
||||||
<< "| [2] Flight controller sample - take off position ctrl landing |\n"
|
<< "| [2] Flight controller sample - take off position ctrl landing |\n"
|
||||||
<< "| [3] Flight controller sample - take off go home force landing |\n"
|
<< "| [3] Flight controller sample - take off go home force landing |\n"
|
||||||
<< "| [4] Flight controller sample - take off velocity ctrl landing |\n"
|
<< "| [4] Flight controller sample - take off velocity ctrl landing |\n"
|
||||||
<< "| [5] Flight controller sample - arrest flying |\n"
|
<< "| [5] Flight controller sample - arrest flying |\n"
|
||||||
<< "| [6] Flight controller sample - set get parameters |\n"
|
<< "| [6] Flight controller sample - set get parameters |\n"
|
||||||
<< "| [7] Waypoint 2.0 sample - run airline mission by settings (only support on M300 RTK) |\n"
|
<< "| [7] Waypoint 2.0 sample - run airline mission by settings (only support on M300 RTK) |\n"
|
||||||
<< "| [8] Waypoint 3.0 sample - run airline mission by kmz file (not support on M300 RTK) |\n"
|
<< "| [8] Waypoint 3.0 sample - run airline mission by kmz file (not support on M300 RTK) |\n"
|
||||||
<< "| [9] Interest point sample - run interest point mission by settings (only support on M3E/M3T) |\n"
|
<< "| [9] Interest point sample - run interest point mission by settings (only support on M3E/M3T) |\n"
|
||||||
|
<< "| [a] EU-C6 FTS trigger sample - receive fts callback to trigger parachute function (only support on M3D/M3DT) |\n"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
std::cin >> inputSelectSample;
|
std::cin >> inputSelectSample;
|
||||||
@ -96,6 +97,9 @@ start:
|
|||||||
case '9':
|
case '9':
|
||||||
DjiTest_InterestPointRunSample();
|
DjiTest_InterestPointRunSample();
|
||||||
break;
|
break;
|
||||||
|
case 'a':
|
||||||
|
DjiTest_FlightControlRunSample(E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_FTS_TRIGGER);
|
||||||
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#define TEST_CAMERA_MAX_INFRARED_ZOOM_FACTOR 8
|
#define TEST_CAMERA_MAX_INFRARED_ZOOM_FACTOR 8
|
||||||
#define TEST_CAMERA_MIN_INFRARED_ZOOM_FACTOR 2
|
#define TEST_CAMERA_MIN_INFRARED_ZOOM_FACTOR 2
|
||||||
#define TEST_CAMERA_MOP_CHANNEL_SUBSCRIBE_POINT_CLOUD_CHANNEL_ID 49152
|
#define TEST_CAMERA_MOP_CHANNEL_SUBSCRIBE_POINT_CLOUD_CHANNEL_ID 49154
|
||||||
#define TEST_CAMERA_MOP_CHANNEL_SUBSCRIBE_POINT_CLOUD_RECV_BUFFER (512 * 1024)
|
#define TEST_CAMERA_MOP_CHANNEL_SUBSCRIBE_POINT_CLOUD_RECV_BUFFER (512 * 1024)
|
||||||
#define TEST_CAMERA_MOP_CHANNEL_COLOR_POINTS_BUFFER (512 * 1024)
|
#define TEST_CAMERA_MOP_CHANNEL_COLOR_POINTS_BUFFER (512 * 1024)
|
||||||
#define TEST_CAMERA_MOP_CHANNEL_WAIT_TIME_MS (3 * 1000)
|
#define TEST_CAMERA_MOP_CHANNEL_WAIT_TIME_MS (3 * 1000)
|
||||||
|
|||||||
@ -43,6 +43,8 @@ typedef struct {
|
|||||||
static T_DjiOsalHandler *s_osalHandler = NULL;
|
static T_DjiOsalHandler *s_osalHandler = NULL;
|
||||||
static const double s_earthCenter = 6378137.0;
|
static const double s_earthCenter = 6378137.0;
|
||||||
static const double s_degToRad = 0.01745329252;
|
static const double s_degToRad = 0.01745329252;
|
||||||
|
static bool s_isFtsCallbackRegistered = false;
|
||||||
|
static int32_t s_ftsTriggerCount = 0;
|
||||||
|
|
||||||
static const T_DjiTestFlightControlDisplayModeStr s_flightControlDisplayModeStr[] = {
|
static const T_DjiTestFlightControlDisplayModeStr s_flightControlDisplayModeStr[] = {
|
||||||
{.displayMode = DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ATTITUDE, .displayModeStr = "attitude mode"},
|
{.displayMode = DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ATTITUDE, .displayModeStr = "attitude mode"},
|
||||||
@ -95,6 +97,9 @@ static void DjiTest_FlightControlPositionControlSample(void);
|
|||||||
static void DjiTest_FlightControlGoHomeForceLandingSample(void);
|
static void DjiTest_FlightControlGoHomeForceLandingSample(void);
|
||||||
static void DjiTest_FlightControlVelocityControlSample(void);
|
static void DjiTest_FlightControlVelocityControlSample(void);
|
||||||
static void DjiTest_FlightControlArrestFlyingSample(void);
|
static void DjiTest_FlightControlArrestFlyingSample(void);
|
||||||
|
static void DjiTest_FlightControlSetGetParamSample(void);
|
||||||
|
static void DjiTest_FlightControlPassiveTriggerFtsSample(void);
|
||||||
|
static T_DjiReturnCode DjiTest_TriggerFtsEventCallback(void);
|
||||||
static void DjiTest_FlightControlSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampleSelect);
|
static void DjiTest_FlightControlSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampleSelect);
|
||||||
|
|
||||||
/* Exported functions definition ---------------------------------------------*/
|
/* Exported functions definition ---------------------------------------------*/
|
||||||
@ -883,6 +888,42 @@ out:
|
|||||||
DjiTest_WidgetLogAppend("Flight control set-get-param sample end");
|
DjiTest_WidgetLogAppend("Flight control set-get-param sample end");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
T_DjiReturnCode DjiTest_TriggerFtsEventCallback(void)
|
||||||
|
{
|
||||||
|
USER_LOG_INFO("Received FTS Trigger event, count = %d.", s_ftsTriggerCount);
|
||||||
|
if (s_ftsTriggerCount == 0) {
|
||||||
|
USER_LOG_WARN("Note: Simulate a trigger failure scenario and return an error value, this function will be invoked again.");
|
||||||
|
s_ftsTriggerCount++;
|
||||||
|
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
|
||||||
|
} else {
|
||||||
|
USER_LOG_WARN("Note: This is an empty implementation, and the FTS signal needs to be triggered by the PWM signal.");
|
||||||
|
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DjiTest_FlightControlPassiveTriggerFtsSample(void)
|
||||||
|
{
|
||||||
|
T_DjiReturnCode returnCode;
|
||||||
|
|
||||||
|
USER_LOG_INFO("Flight control passive trigger FTS sample start.");
|
||||||
|
|
||||||
|
if (s_isFtsCallbackRegistered == false) {
|
||||||
|
returnCode = DjiFlightController_RegTriggerFtsEventCallback(DjiTest_TriggerFtsEventCallback);
|
||||||
|
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||||
|
USER_LOG_ERROR("Register trigger FTS event callback failed.");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
s_isFtsCallbackRegistered = true;
|
||||||
|
USER_LOG_INFO("Register trigger FTS event callback successfully."
|
||||||
|
"Please wait for the aircraft to trigger the payload to execute FTS action.");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
USER_LOG_WARN("FTS trigger event callback has been registered, no need to register again.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DjiTest_FlightControlSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampleSelect)
|
void DjiTest_FlightControlSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampleSelect)
|
||||||
{
|
{
|
||||||
switch (flightCtrlSampleSelect) {
|
switch (flightCtrlSampleSelect) {
|
||||||
@ -910,6 +951,10 @@ void DjiTest_FlightControlSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampl
|
|||||||
DjiTest_FlightControlSetGetParamSample();
|
DjiTest_FlightControlSetGetParamSample();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_FTS_TRIGGER: {
|
||||||
|
DjiTest_FlightControlPassiveTriggerFtsSample();
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,7 @@ typedef enum {
|
|||||||
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_TAKE_OFF_VELOCITY_CTRL_LANDING,
|
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_TAKE_OFF_VELOCITY_CTRL_LANDING,
|
||||||
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_ARREST_FLYING,
|
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_ARREST_FLYING,
|
||||||
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_SET_GET_PARAM,
|
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_SET_GET_PARAM,
|
||||||
|
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_FTS_TRIGGER,
|
||||||
} E_DjiTestFlightCtrlSampleSelect;
|
} E_DjiTestFlightCtrlSampleSelect;
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|||||||
@ -40,9 +40,9 @@ extern "C" {
|
|||||||
|
|
||||||
#define CONFIG_MODULE_SAMPLE_WIDGET_SPEAKER_ON
|
#define CONFIG_MODULE_SAMPLE_WIDGET_SPEAKER_ON
|
||||||
|
|
||||||
#define CONFIG_MODULE_SAMPLE_DATA_TRANSMISSION_ON
|
// #define CONFIG_MODULE_SAMPLE_DATA_TRANSMISSION_ON
|
||||||
|
|
||||||
#define CONFIG_MODULE_SAMPLE_FC_SUBSCRIPTION_ON
|
// #define CONFIG_MODULE_SAMPLE_FC_SUBSCRIPTION_ON
|
||||||
|
|
||||||
#define CONFIG_MODULE_SAMPLE_GIMBAL_EMU_ON
|
#define CONFIG_MODULE_SAMPLE_GIMBAL_EMU_ON
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define CONFIG_MODULE_SAMPLE_UPGRADE_ON
|
#define CONFIG_MODULE_SAMPLE_UPGRADE_ON
|
||||||
|
|
||||||
#define CONFIG_MODULE_SAMPLE_HMS_CUSTOMIZATION_ON
|
// #define CONFIG_MODULE_SAMPLE_HMS_CUSTOMIZATION_ON
|
||||||
|
|
||||||
/*!< Attention: Please uncomment it in gps environment.
|
/*!< Attention: Please uncomment it in gps environment.
|
||||||
* */
|
* */
|
||||||
|
|||||||
@ -55,10 +55,6 @@ void Error_Handler(void);
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
__disable_irq();
|
|
||||||
SCB->VTOR = APPLICATION_ADDRESS;
|
|
||||||
__enable_irq();
|
|
||||||
|
|
||||||
/* STM32F4xx HAL library initialization:
|
/* STM32F4xx HAL library initialization:
|
||||||
- Configure the Flash prefetch, instruction and Data caches
|
- Configure the Flash prefetch, instruction and Data caches
|
||||||
- Configure the Systick to generate an interrupt each 1 msec
|
- Configure the Systick to generate an interrupt each 1 msec
|
||||||
|
|||||||
Reference in New Issue
Block a user