Skip to content

Commit

Permalink
Merge pull request dji-sdk#188 from dji-sdk/release/v3.9.1
Browse files Browse the repository at this point in the history
NEW: release DJI Payload-SDK version 3.9.1
  • Loading branch information
dji-dev authored Jul 18, 2024
2 parents 0ef7855 + eba05f2 commit 159708e
Show file tree
Hide file tree
Showing 17 changed files with 172 additions and 113 deletions.
29 changes: 11 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# DJI Payload SDK (PSDK)

![](https://img.shields.io/badge/version-V3.9.0-pink.svg)
![](https://img.shields.io/badge/platform-linux_|_rtos-cyan.svg)
![](https://img.shields.io/badge/license-MIT-blue.svg)
![](https://img.shields.io/badge/version-V3.9.1-red.svg)
![](https://img.shields.io/badge/platform-linux_|_rtos-blue.svg)
![](https://img.shields.io/badge/license-MIT-purple.svg)

## What is the DJI Payload SDK?

Expand All @@ -23,23 +23,16 @@ to get the latest version information.

## 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.

* Supports the payload camera Zenmuse H30 series.
* FlyCart 30 aircraft supports the time synchronization function.
* FlyCart 30 aircraft supports HMS functions.
* FlyCart 30 aircraft supports the data subscription function.
* Fixed the issue with inaccurate zoom multiplier retrieval for the Mavic 3 Enterprise series cameras.
* Fixed data errors on the receiving end of small data transfers from MSDK to PSDK.
* 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.
* 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.
* GEO Caging feature supported for the M3D series models.
* Flight control function and waypoint mission supported for the FlyCart 30 model.
* Fixed an issue with subscribing to the flight control topics for M300 RTK and M350 RTK models.
* Resolved a problem with DJI Smart Controller Enterprise not recognizing PSDK payload devices on M300 RTK.
* Fixed an issue with acquiring the camera stream without I-frames on M3D series models.
* 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.
> 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.
## License

Expand Down
20 changes: 10 additions & 10 deletions psdk_lib/include/dji_aircraft_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ typedef struct {
} 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 {
E_DjiAircraftSeries aircraftSeries; /*!< Aircraft series. */
Expand All @@ -68,31 +68,31 @@ typedef struct {

/* Exported functions --------------------------------------------------------*/
/**
* @brief Get base information of aircraft system, including aircraft type and DJI adapter type.
* @param baseInfo: pointer to memory space used to store base information of the aircraft system.
* @brief Basic information about the aircraft system, including aircraft type and DJI adapter type.
* @param baseInfo: Pointer to a memory space where the aircraft's basic information will be stored.
* @return Execution result.
*/
T_DjiReturnCode DjiAircraftInfo_GetBaseInfo(T_DjiAircraftInfoBaseInfo *baseInfo);

/**
* @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.
* @param mobileAppInfo: pointer to memory space used to store information related to mobile APP.
* @brief Get information related to mobile app.
* @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 a memory space where the mobile app information will be stored.
* @return Execution result.
*/
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
* @param isConnected: pointer to connection status.
* @param isConnected: Pointer to connection status.
* @return Execution result.
*/
T_DjiReturnCode DjiAircraftInfo_GetConnectionStatus(bool *isConnected);

/**
* @brief Get version of aircraft.
* @param aircraftVersion: pointer to aircraft version.
* @brief Get version of the aircraft.
* @param aircraftVersion: Pointer to aircraft version.
* @return Execution result.
*/
T_DjiReturnCode DjiAircraftInfo_GetAircraftVersion(T_DjiAircraftVersion *aircraftVersion);
Expand Down
18 changes: 17 additions & 1 deletion psdk_lib/include/dji_flight_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ typedef T_DjiReturnCode (*JoystickCtrlAuthorityEventCbFunc)(
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)
* 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.
Expand Down Expand Up @@ -633,6 +639,16 @@ DjiFlightController_SetRCLostActionEnableStatus(E_DjiFlightControllerRCLostActio
T_DjiReturnCode
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
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion psdk_lib/include/dji_gimbal_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct {
/* Exported functions --------------------------------------------------------*/
/**
* @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.
*/
T_DjiReturnCode DjiGimbalManager_Init(void);
Expand Down
128 changes: 66 additions & 62 deletions psdk_lib/include/dji_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,8 @@ typedef enum {
*/
typedef enum {
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
* size greater than or equal to 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. */
DJI_MOBILE_APP_SCREEN_TYPE_BIG_SCREEN = 0, /*!< Screen size is 6 inches or larger. */
DJI_MOBILE_APP_SCREEN_TYPE_LITTLE_SCREEN = 1, /*!< Screen size is less than 6 inches. */
} E_DjiMobileAppScreenType;

/**
Expand Down Expand Up @@ -250,7 +248,7 @@ typedef enum {
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_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;

typedef enum {
Expand All @@ -268,65 +266,56 @@ typedef enum {
* @brief Camera focus target point when in focus mode.
*/
typedef struct {
dji_f32_t focusX; /*!< Specifies horizontal zone coordinate. This parameter is between 0 and 1.
The point [0.0, 0.0] represents the top-left angle of the screen.*/
dji_f32_t focusY; /*!< Specifies vertical 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 corner of the screen.*/
dji_f32_t focusY; /*!< Specifies vertical zone coordinate. Range: 0 to 1. */
} T_DjiCameraPointInScreen;

/**
* @brief Camera time interval settings when in interval shootPhoto mode.
* @brief Camera time interval settings for interval shoot-photo mode.
*/
typedef struct {
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*/
} T_DjiCameraPhotoTimeIntervalSettings;

/**
* @brief Camera zoom speed.
* @brief Camera zoom speeds.
*/
typedef enum {
DJI_CAMERA_ZOOM_SPEED_SLOWEST = 72, /*!< Lens zooms in slowest speed. */
DJI_CAMERA_ZOOM_SPEED_SLOW = 73, /*!< Lens zooms in slow speed. */
DJI_CAMERA_ZOOM_SPEED_MODERATELY_SLOW = 74, /*!< Lens zooms in speed slightly slower than normal speed. */
DJI_CAMERA_ZOOM_SPEED_NORMAL = 75, /*!< Lens zooms in normal speed. */
DJI_CAMERA_ZOOM_SPEED_MODERATELY_FAST = 76, /*!< Lens zooms very in speed slightly faster than normal speed. */
DJI_CAMERA_ZOOM_SPEED_FAST = 77, /*!< Lens zooms very in fast speed. */
DJI_CAMERA_ZOOM_SPEED_FASTEST = 78, /*!< Lens zooms very in fastest speed. */
DJI_CAMERA_ZOOM_SPEED_SLOWEST = 72, /*!< Slowest zoom speed. */
DJI_CAMERA_ZOOM_SPEED_SLOW = 73, /*!< Slow zoom speed. */
DJI_CAMERA_ZOOM_SPEED_MODERATELY_SLOW = 74, /*!< Slightly slower than normal zoom speed. */
DJI_CAMERA_ZOOM_SPEED_NORMAL = 75, /*!< Normal zoom speed. */
DJI_CAMERA_ZOOM_SPEED_MODERATELY_FAST = 76, /*!< Slightly faster than normal zoom speed. */
DJI_CAMERA_ZOOM_SPEED_FAST = 77, /*!< Fast zoom speed. */
DJI_CAMERA_ZOOM_SPEED_FASTEST = 78, /*!< Fastest zoom speed. */
} E_DjiCameraZoomSpeed;

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,
/*! 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,
/*! 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,
/*! 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,
/*! The number of pictures to continuously take at one time in BURST mode is
* 10, Only supported by X4S camera, X5S camera and Phantom 4 Pro camera.
*/
/*! Supports capturing 10 pictures per trigger, only supported by X4S, X5S cameras, and Phantom 4 Pro. */
DJI_CAMERA_BURST_COUNT_10 = 10,
/*! The number of pictures to continuously take at one time in BURST mode is
* 14, Only supported by X4S camera, X5S camera and Phantom 4 Pro camera.
*/
/*! Supports capturing 14 pictures per trigger, only supported by X4S, X5S cameras, and Phantom 4 Pro. */
DJI_CAMERA_BURST_COUNT_14 = 14,
/*! The camera burst shoot count value is unknown.
*/
/*! Unknown burst count. */
DJI_CAMERA_BURST_COUNT_KNOWN = 0xFF,
} E_DjiCameraBurstCount;

/**
* @brief Camera zoom direction.
*/
typedef enum {
DJI_CAMERA_ZOOM_DIRECTION_OUT = 0, /*!< The lens moves in the far direction, the zoom factor becomes smaller. */
DJI_CAMERA_ZOOM_DIRECTION_IN = 1, /*!< The lens moves in the near direction, the zoom factor becomes larger. */
DJI_CAMERA_ZOOM_DIRECTION_OUT = 0, /*!< Zooms out, reducing the zoom factor. */
DJI_CAMERA_ZOOM_DIRECTION_IN = 1, /*!< Zooms in, increasing the zoom factor. */
} E_DjiCameraZoomDirection;
#pragma pack (1)

Expand Down Expand Up @@ -354,55 +343,70 @@ typedef struct {
bool busyState;
} T_DjiDataChannelState;

typedef struct Vector3d {
int32_t x; /*!< Specifies int32 value of x for vector. */
int32_t y; /*!< Specifies int32 value of y for vector. */
int32_t z; /*!< Specifies int32 value of z for vector. */
/**
* @brief Represents a vector using int32 coordinates.
*/
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;

typedef struct Vector3f {
dji_f32_t x; /*!< Specifies float value of x for vector. */
dji_f32_t y; /*!< Specifies float value of y for vector. */
dji_f32_t z; /*!< Specifies float value of z for vector. */
/**
* @brief Represents a vector using floating-point coordinates.
*/
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;

/**
* @brief Represents an attitude using int32 values for pitch, roll, and yaw.
*/
typedef struct {
int32_t pitch; /*!< Specifies int32 value of pitch for attitude. */
int32_t roll; /*!< Specifies int32 value of roll for attitude */
int32_t yaw; /*!< Specifies int32 value of yaw for attitude */
int32_t pitch; /*!< Pitch angle in degrees. */
int32_t roll; /*!< Roll angle in degrees. */
int32_t yaw; /*!< Yaw angle in degrees. */
} T_DjiAttitude3d;

/**
* @brief Represents an attitude using floating-point values for pitch, roll, and yaw.
*/
typedef struct {
dji_f32_t pitch; /*!< Specifies float value of pitch for attitude. */
dji_f32_t roll; /*!< Specifies float value of roll for attitude */
dji_f32_t yaw; /*!< Specifies float value of yaw for attitude */
dji_f32_t pitch; /*!< Pitch angle in degrees. */
dji_f32_t roll; /*!< Roll angle in degrees. */
dji_f32_t yaw; /*!< Yaw angle in degrees. */
} T_DjiAttitude3f;

/**
* @brief Represents a quaternion, when converted to a rotation matrix or Euler angles.
*/
typedef struct {
dji_f32_t q0; /*!< w, when converted to a rotation matrix or Euler angles. */
dji_f32_t q1; /*!< x, when converted to a rotation matrix or Euler angles. */
dji_f32_t q2; /*!< y, when converted to a rotation matrix or Euler angles. */
dji_f32_t q3; /*!< z, when converted to a rotation matrix or Euler angles. */
dji_f32_t q0; /*!< Quaternion component w. */
dji_f32_t q1; /*!< Quaternion component x. */
dji_f32_t q2; /*!< Quaternion component y. */
dji_f32_t q3; /*!< Quaternion component z. */
} T_DjiQuaternion4f;

/**
* @brief Timestamp data structure.
*/
typedef struct {
uint32_t millisecond; /*!< Millisecond. */
uint32_t microsecond; /*!< Microsecond. */
uint32_t millisecond;
uint32_t microsecond;
} T_DjiDataTimestamp;

/**
* @brief The firmware version of payload.
* @note If majorVersion = AA, minorVersion = BB, modifyVersion = CC, debugVersion = DD, The version show in
* terminal APP is AA.BB.CC.DD
* @note The firmware version is displayed as AA.BB.CC.DD where AA is majorVersion,
* BB is minorVersion, CC is modifyVersion, and DD is debugVersion.
*/
typedef struct {
uint8_t majorVersion; /*!< The major version of firmware, the range is 0 ~ 99. */
uint8_t minorVersion; /*!< The minor version of firmware, the range is 0 ~ 99. */
uint8_t modifyVersion; /*!< The modify version of firmware, the range is 0 ~ 99. */
uint8_t debugVersion; /*!< The debug version of firmware, the range is 0 ~ 99. */
uint8_t majorVersion; /*!< Major version number, ranging from 0 to 99. */
uint8_t minorVersion; /*!< Minor version number, ranging from 0 to 99. */
uint8_t modifyVersion; /*!< Modification version number, ranging from 0 to 99. */
uint8_t debugVersion; /*!< Debug version number, ranging from 0 to 99. */
} T_DjiFirmwareVersion;

#pragma pack ()
Expand Down
4 changes: 2 additions & 2 deletions psdk_lib/include/dji_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ extern "C" {
/* 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_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_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 ------------------------------------------------------------*/

Expand Down
Binary file modified psdk_lib/lib/aarch64-linux-gnu-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/arm-linux-gnueabi-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/arm-linux-gnueabihf-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/armcc_cortex-m4/libpayload.lib
Binary file not shown.
Binary file modified psdk_lib/lib/x86_64-linux-gnu-gcc/libpayloadsdk.a
Binary file not shown.
Loading

0 comments on commit 159708e

Please sign in to comment.