Skip to content

Commit

Permalink
NEW: release DJI Payload-SDK version 3.7
Browse files Browse the repository at this point in the history
Signed-off-by: Martin <Martin@dji.com>
  • Loading branch information
Martin authored and Martin committed Oct 31, 2023
1 parent 5c4ba38 commit be3a925
Show file tree
Hide file tree
Showing 44 changed files with 1,940 additions and 1,729 deletions.
55 changes: 19 additions & 36 deletions README.md
@@ -1,6 +1,6 @@
# DJI Payload SDK (PSDK)

![](https://img.shields.io/badge/version-V3.6.0-purple.svg)
![](https://img.shields.io/badge/version-V3.7.0-green.svg)
![](https://img.shields.io/badge/platform-linux_|_rtos-green.svg)
![](https://img.shields.io/badge/license-MIT-blue.svg)

Expand All @@ -15,44 +15,30 @@ Flight Controller, Payload Controller, Video Image Analysis Platform, Mapping Ca
## Documentation

For full documentation, please visit
the [DJI Developer Documentation](https://developer.dji.com/doc/payload-sdk-tutorial/en/). Documentation
regarding the code can be found in the [PSDK API Reference](https://developer.dji.com/doc/payload-sdk-api-reference/en/)
the [DJI Developer Documentation](https://developer.dji.com/doc/payload-sdk-tutorial/en/). Documentation regarding the
code can be found in the [PSDK API Reference](https://developer.dji.com/doc/payload-sdk-api-reference/en/)
section of the developer's website. Please visit
the [Latest Version Information](https://developer.dji.com/doc/payload-sdk-tutorial/en/)
to get the latest version information.

## Latest Release

PSDK 3.6.0 was released on 18 Sep 2023. 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.

* Added support for multi-language display in HMS management.
* Added support for PSDK Non-RC flight.
* Added support for aircraft version number retrieval.
* Added support for RTCM data subscription.
* Added support for cloud-based custom small data communication on Matrice 30/30T PSDK.
* Added Support for Matrice 30/30T PSDK speaker cloud integration.
* Added support for custom widgets wayline actions on Matrice 30/30T and Mavic 3E/3T aircraft.
* Added support for grayscale image retrieval on M350 RTK.
* Added support for time synchronization on M300 RTK and Matrice 30/30T.
* Added support for third-party firmware upgrades through M350 RTK E-Port.
* Added support for SDK interconnection on Mavic 3E/3T.
* Added support for hotspot orbit function on Mavic 3E/3T.
* Added support for expanded camera and gimbal management interfaces.
* Fixed issue with the 500m altitude limit for flight control across all models.
* Fixed issue with incomplete small data transmission on specific models.
* Fixed issue with H20 I-frame retrieval on M300 RTK.
* Fixed issue with occasional custom widget display failure in DJI Pilot.
* Fixed issues with multiple live stream retrieval on Matrice 30/30T.
* Fixed issues with camera mode retrieval on Matrice 30/30T.
* Fixed issues with camera focal length value retrieval on Matrice 30/30T.
* Fixed issue with X-Port failed to self-check when both X-Port and SkyPort V2 were equipped on M300 RTK.
* Fixed issue with gimbal angle subscription data mismatching App display on M300 RTK.
* Fixed issue with flight control feature initialization failure on specific models after multiple calls.
* Fixed compatibility issues with initialization failures on some HiSilicon platforms.
* Optimized PSDK startup delays in single UART mode.
* Optimized slow media file download speeds for Mavic 3E/3T on ethernet links.
PSDK 3.7.0 was released on 31 Oct 2023. 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.

* Added L2 new camera model support
* Added FlyCart 30 new drone model support
* Added support for L2 subscription 3D point cloud data function
* Added L2 support for downloading original point cloud files
* Fixed the issue where M300 RTK and M350 RTK occasionally failed to negotiate load
* Fixed an issue where some open source library conflicts caused flight control module registration to fail
* Fixed the issue where PSDK obtains aircraft version numbers and displays them in reverse order
* Fixed an issue where the zoom value range of some camera zoom rings was incorrect
* Fixed the problem that the Sample value not updated when repeatedly running the M30/M3 series drone data subscription
* Fixed compatibility issues on some ESP32 platforms
* Optimize the return value prompt of MOP channel closing and destruction
* Optimize the point of interest surround function Sample log prompt
* Optimize compilation warning level

## License

Expand All @@ -73,6 +59,3 @@ You can also communicate with other developers by the following methods:

- Post questions on [**Stackoverflow**](http://stackoverflow.com) using [**
dji-sdk**](http://stackoverflow.com/questions/tagged/dji-sdk) tag

## About Pull Request
As always, the DJI Dev Team is committed to improving your developer experience, and we also welcome your contribution, but the code review of any pull request maybe not timely, when you have any questionplease send an email to dev@dji.com
40 changes: 40 additions & 0 deletions psdk_lib/include/dji_camera_manager.h
Expand Up @@ -704,6 +704,30 @@ typedef struct {
uint32_t remainCapacity; /* MByte */
} T_DjiCameraManagerStorageInfo;

typedef struct {
uint32_t flag; /* 0xFFFFFFFF */
uint32_t seqNum;
uint64_t timestamp;
uint32_t dataByte; /* actual num of bytes used for points */
} T_DjiCameraManagerPointCloudHeader;

typedef struct {
float x; /* the x-axis of NED coordinate system */
float y; /* the y-axis of NED coordinate system */
float z; /* the z-axis of NED coordinate system */
uint8_t intensity;
uint8_t r;
uint8_t g;
uint8_t b;
} T_DjiCameraManagerPointXYZRGBInfo;

typedef struct {
T_DjiCameraManagerPointCloudHeader pointCloudHeader;
uint32_t crc_header;
uint32_t crc_rest;
T_DjiCameraManagerPointXYZRGBInfo points[1];
} T_DjiCameraManagerColorPointCloud;

typedef T_DjiReturnCode (*DjiCameraManagerDownloadFileDataCallback)(T_DjiDownloadFilePacketInfo packetInfo,
const uint8_t *data,
uint16_t dataLen);
Expand Down Expand Up @@ -1663,6 +1687,22 @@ T_DjiReturnCode DjiCameraManager_SetMeteringPoint(E_DjiMountPosition position,
T_DjiReturnCode DjiCameraManager_GetMeteringPoint(E_DjiMountPosition position,
uint8_t *x, uint8_t *y);


/**
* @brief Start to record point cloud of the selected camera mounted position.
* @param position: camera mounted position
* @return Execution result.
*/
T_DjiReturnCode DjiCameraManager_StartRecordPointCloud(E_DjiMountPosition position);

/**
* @brief Stop to record point cloud of the selected camera mounted position.
* @note Precondition: The camera is recording currently.
* @param position: camera mounted position
* @return Execution result.
*/
T_DjiReturnCode DjiCameraManager_StopRecordPointCloud(E_DjiMountPosition position);

#ifdef __cplusplus
}
#endif
Expand Down
7 changes: 6 additions & 1 deletion psdk_lib/include/dji_typedef.h
Expand Up @@ -75,7 +75,8 @@ typedef uint64_t T_DjiReturnCode;
typedef enum {
DJI_MOUNT_POSITION_TYPE_UNKNOWN = 0,
DJI_MOUNT_POSITION_TYPE_PAYLOAD_PORT = 1,
DJI_MOUNT_POSITION_TYPE_EXTENSION_PORT = 2
DJI_MOUNT_POSITION_TYPE_EXTENSION_PORT = 2,
DJI_MOUNT_POSITION_TYPE_EXTENSION_LITE_PORT = 3,
} E_DjiMountPositionType;

typedef enum {
Expand All @@ -84,6 +85,7 @@ typedef enum {
DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2 = 2,
DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3 = 3,
DJI_MOUNT_POSITION_EXTENSION_PORT = 4,
DJI_MOUNT_POSITION_EXTENSION_LITE_PORT = 5,
} E_DjiMountPosition;

typedef enum {
Expand All @@ -93,6 +95,7 @@ typedef enum {
DJI_AIRCRAFT_SERIES_M30 = 3,
DJI_AIRCRAFT_SERIES_M3 = 4,
DJI_AIRCRAFT_SERIES_M350 = 5,
DJI_AIRCRAFT_SERIES_FC30 = 7,
} E_DjiAircraftSeries;

typedef enum {
Expand All @@ -104,6 +107,7 @@ typedef enum {
DJI_AIRCRAFT_TYPE_M30 = 67, /*!< Aircraft type is Matrice 30. */
DJI_AIRCRAFT_TYPE_M30T = 68, /*!< Aircraft type is Matrice 30T. */
DJI_AIRCRAFT_TYPE_M3E = 77, /*!< Aircraft type is Mavic 3E. */
DJI_AIRCRAFT_TYPE_FC30 = 78, /* !<Aircraft type is FlyCart 30> */
DJI_AIRCRAFT_TYPE_M3T = 79, /*!< Aircraft type is Mavic 3T. */
DJI_AIRCRAFT_TYPE_M350_RTK = 89, /*!< Aircraft type is Matrice 350 RTK. */
} E_DjiAircraftType;
Expand All @@ -122,6 +126,7 @@ typedef enum {
DJI_CAMERA_TYPE_H20N = 61, /*!< Camera type is H20N. */
DJI_CAMERA_TYPE_P1 = 50, /*!< Camera type is P1. */
DJI_CAMERA_TYPE_L1, /*!< Camera type is L1. */
DJI_CAMERA_TYPE_L2, /*!< Camera type is L2. */
DJI_CAMERA_TYPE_M30, /*!< Camera type is M30. */
DJI_CAMERA_TYPE_M30T, /*!< Camera type is M30T. */
DJI_CAMERA_TYPE_M3E, /*!< Camera type is M3E. */
Expand Down
4 changes: 2 additions & 2 deletions psdk_lib/include/dji_version.h
Expand Up @@ -34,10 +34,10 @@ 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 6 /*!< DJI SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */
#define DJI_VERSION_MINOR 7 /*!< 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_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 1883 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
#define DJI_VERSION_BUILD 1906 /*!< 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-himix100-linux-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/aarch64-linux-android-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/aarch64-linux-gnu-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/arm-himix100-linux-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/arm-himix200-linux-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/arm-hisiv300-linux-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/arm-hisiv400-linux-gcc/libpayloadsdk.a
Binary file not shown.
Binary file removed psdk_lib/lib/arm-hisiv500-linux-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/arm-hisiv600-linux-gcc/libpayloadsdk.a
Binary file not shown.
Binary file modified psdk_lib/lib/arm-linux-androideabi-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/arm-none-eabi-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.
Binary file modified psdk_lib/lib/xtensa-esp32-elf-gcc/libpayloadsdk.a
Binary file not shown.
Expand Up @@ -70,6 +70,7 @@ static const char *s_cameraManagerSampleSelectList[] = {
[E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_FFC_MODE_AND_TRRIGER] = "Set FFC mode and trriger a FFC |",
[E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SET_GAIN_MODE] = "Set infrared camera gain mode |",
[E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_GET_CAMERA_STATUS] = "Get camera status, capturing & recording status etc |",
[E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SUBSCRIBE_POINT_CLOUD] = "Subscribe point cloud |",
};

/* Private types -------------------------------------------------------------*/
Expand Down
Expand Up @@ -32,6 +32,7 @@
#include "dji_flight_controller.h"
#include "dji_logger.h"
#include "dji_fc_subscription.h"
#include "cmath"

#ifdef OPEN_CV_INSTALLED

Expand Down Expand Up @@ -814,6 +815,8 @@ static T_DjiReturnCode DjiUser_FlightControlUpdateConfig(void)
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
}

memset(jsonData, 0, fileSize);

UtilFile_GetFileDataByPath(tempFileDirPath, 0, fileSize, jsonData, &readRealSize);

jsonData[readRealSize] = '\0';
Expand Down
Expand Up @@ -40,9 +40,17 @@
#include "../manifold2/hal/hal_uart.h"
#include "../manifold2/hal/hal_network.h"

#include <gimbal_emu/test_payload_gimbal_emu.h>
#include <camera_emu/test_payload_cam_emu_media.h>
#include <camera_emu/test_payload_cam_emu_base.h>
#include "widget/test_widget.h"
#include "widget/test_widget_speaker.h"
#include <power_management/test_power_management.h>
#include "data_transmission/test_data_transmission.h"

/* Private constants ---------------------------------------------------------*/
#define DJI_LOG_PATH "Logs/DJI"
#define DJI_LOG_INDEX_FILE_NAME "Logs/latest"
#define DJI_LOG_INDEX_FILE_NAME "Logs/index"
#define DJI_LOG_FOLDER_NAME "Logs"
#define DJI_LOG_PATH_MAX_SIZE (128)
#define DJI_LOG_FOLDER_NAME_MAX_SIZE (32)
Expand All @@ -63,6 +71,8 @@ static FILE *s_djiLogFileCnt;

/* Private functions declaration ---------------------------------------------*/
static void DjiUser_NormalExitHandler(int signalNum);
static T_DjiReturnCode DjiTest_HighPowerApplyPinInit();
static T_DjiReturnCode DjiTest_WriteHighPowerApplyPin(E_DjiPowerManagementPinState pinState);

/* Exported functions definition ---------------------------------------------*/
Application::Application(int argc, char **argv)
Expand Down Expand Up @@ -266,7 +276,8 @@ void Application::DjiUser_ApplicationStart()
throw std::runtime_error("Get aircraft base info error.");
}

if (aircraftInfoBaseInfo.mountPosition != DJI_MOUNT_POSITION_EXTENSION_PORT) {
if (aircraftInfoBaseInfo.mountPosition != DJI_MOUNT_POSITION_EXTENSION_PORT
&& DJI_MOUNT_POSITION_EXTENSION_LITE_PORT != aircraftInfoBaseInfo.mountPosition) {
throw std::runtime_error("Please run this sample on extension port.");
}

Expand All @@ -285,6 +296,65 @@ void Application::DjiUser_ApplicationStart()
throw std::runtime_error("Set serial number error");
}

#ifdef CONFIG_MODULE_SAMPLE_CAMERA_EMU_ON
returnCode = DjiTest_CameraEmuBaseStartService();
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("camera emu common init error");
}
#endif

#ifdef CONFIG_MODULE_SAMPLE_CAMERA_MEDIA_ON
returnCode = DjiTest_CameraEmuMediaStartService();
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("camera emu media init error");
}
#endif

#ifdef CONFIG_MODULE_SAMPLE_GIMBAL_EMU_ON
returnCode = DjiTest_GimbalStartService();
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("psdk gimbal init error");
}
#endif

#ifdef CONFIG_MODULE_SAMPLE_WIDGET_ON
returnCode = DjiTest_WidgetStartService();
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("widget sample init error");
}
#endif

#ifdef CONFIG_MODULE_SAMPLE_WIDGET_SPEAKER_ON
returnCode = DjiTest_WidgetSpeakerStartService();
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("widget speaker test init error");
}
#endif

#ifdef CONFIG_MODULE_SAMPLE_POWER_MANAGEMENT_ON
T_DjiTestApplyHighPowerHandler applyHighPowerHandler = {
.pinInit = DjiTest_HighPowerApplyPinInit,
.pinWrite = DjiTest_WriteHighPowerApplyPin,
};

returnCode = DjiTest_RegApplyHighPowerHandler(&applyHighPowerHandler);
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("regsiter apply high power handler error");
}

returnCode = DjiTest_PowerManagementStartService();
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("power management init error");
}
#endif

#ifdef CONFIG_MODULE_SAMPLE_DATA_TRANSMISSION_ON
returnCode = DjiTest_DataTransmissionStartService();
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
USER_LOG_ERROR("widget sample init error");
}
#endif

returnCode = DjiCore_ApplicationStart();
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
throw std::runtime_error("Start sdk application error.");
Expand Down Expand Up @@ -440,6 +510,8 @@ T_DjiReturnCode Application::DjiUser_LocalWriteFsInit(const char *path)
}
}

sprintf(systemCmd, "ln -sfrv %s " DJI_LOG_FOLDER_NAME "/latest.log", filePath);
system(systemCmd);
return djiReturnCode;
}

Expand All @@ -449,4 +521,15 @@ static void DjiUser_NormalExitHandler(int signalNum)
exit(0);
}

static T_DjiReturnCode DjiTest_HighPowerApplyPinInit()
{
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}

static T_DjiReturnCode DjiTest_WriteHighPowerApplyPin(E_DjiPowerManagementPinState pinState)
{
//attention: please pull up the HWPR pin state by hardware.
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}

/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/
Expand Up @@ -125,6 +125,8 @@ static T_DjiReturnCode DjiUserConfigManager_GetAppInfoInner(const char *path, T_
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}

memset(jsonData, 0, fileSize);

UtilFile_GetFileDataByPath(path, 0, fileSize, jsonData, &readRealSize);

jsonData[readRealSize] = '\0';
Expand Down Expand Up @@ -223,6 +225,8 @@ static T_DjiReturnCode DjiUserConfigManager_GetLinkConfigInner(const char *path,
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}

memset(jsonData, 0, fileSize);

UtilFile_GetFileDataByPath(path, 0, fileSize, jsonData, &readRealSize);

jsonData[readRealSize] = '\0';
Expand Down
Expand Up @@ -42,6 +42,18 @@ extern "C" {
* */
#define CONFIG_HARDWARE_CONNECTION DJI_USE_ONLY_UART

/*!< Attention: Select the sample you want to run here.
* */
#define CONFIG_MODULE_SAMPLE_GIMBAL_EMU_ON

#define CONFIG_MODULE_SAMPLE_WIDGET_ON

#define CONFIG_MODULE_SAMPLE_WIDGET_SPEAKER_ON

#define CONFIG_MODULE_SAMPLE_POWER_MANAGEMENT_ON

#define CONFIG_MODULE_SAMPLE_DATA_TRANSMISSION_ON

/* Exported types ------------------------------------------------------------*/

/* Exported functions --------------------------------------------------------*/
Expand Down
@@ -1,11 +1,11 @@
{
"dji_sdk_app_info": {
"user_app_name": "PSDK_APPNAME",
"user_app_id": "53453",
"user_app_key": "871bf75511531682636f0db7243a9e7",
"user_app_license": "BO86stxOf200Sv9FMEZUSFCZhJhWxKG1jVYBACSnFvz42nnWEnc8vU+GKGHc/OUTxuFH+5TizymlZkuIxq6WAonqut3Y58KAcmTU6HHCVCW5HJSidwbNv0Gf3Gm+O7tc18lpHiSNRr/uEbSTJeVPkshOlcEEwpSc4tUUlRBb37BkUpZQFAPKaykyznLdxdYDlFh5OAqSl6kLltdt+A3/VOiZavKfsKHM7J9jbjsTDETe3fRRRiauE5K+s8yO6uAFLE0fwHWnanl7gPkzgNJJ53qVqnKiGwEtlim5E8WvnnaiEoxLOWrDijFOEmh9tLOU7Kx/oDEM2l9O/idaqmLxKA==",
"user_develop_account": "payloadsdk_account@163.com",
"user_baud_rate": "921600"
"user_app_name": "your_app_name",
"user_app_id": "your_app_id",
"user_app_key": "your_app_key",
"user_app_license": "your_app_license",
"user_develop_account": "your_developer_account",
"user_baud_rate": "460800"
},
"dji_sdk_link_config": {
"link_available": "use_only_uart/use_uart_and_usb_bulk_device/use_uart_and_network_device",
Expand Down

0 comments on commit be3a925

Please sign in to comment.