NEW: release DJI Payload-SDK version 3.4
Signed-off-by: DJI-Martin <DJI-Martin@dji.com>
This commit is contained in:
@ -19,7 +19,9 @@ include_directories(../manifold2/application)
|
||||
|
||||
file(GLOB_RECURSE MODULE_SAMPLE_SRC
|
||||
../../../module_sample/liveview/*.c*
|
||||
../../../module_sample/camera_manager/*.c*
|
||||
../../../module_sample/perception/*.c*
|
||||
../../../module_sample/gimbal/*.c*
|
||||
../../../../sample_c/module_sample/*.c
|
||||
)
|
||||
file(GLOB_RECURSE MODULE_COMMON_SRC ../common/*.c*)
|
||||
@ -49,7 +51,7 @@ add_executable(${PROJECT_NAME}
|
||||
${MODULE_COMMON_SRC}
|
||||
${MODULE_HAL_SRC})
|
||||
|
||||
# Try to see if user has OpenCV installed因为额
|
||||
# Try to see if user has OpenCV installed
|
||||
# if yes, default callback will display the image
|
||||
find_package(OpenCV QUIET)
|
||||
if (OpenCV_FOUND)
|
||||
@ -58,6 +60,12 @@ if (OpenCV_FOUND)
|
||||
message(STATUS " - Includes: ${OpenCV_INCLUDE_DIRS}")
|
||||
message(STATUS " - Libraries: ${OpenCV_LIBRARIES}")
|
||||
add_definitions(-DOPEN_CV_INSTALLED)
|
||||
execute_process(COMMAND opencv_version OUTPUT_VARIABLE OPENCV_VERSION)
|
||||
if (${OPENCV_VERSION} STRLESS "4.0.0")
|
||||
add_definitions(-DOPEN_CV_VERSION_3)
|
||||
else()
|
||||
add_definitions(-DOPEN_CV_VERSION_4)
|
||||
endif()
|
||||
else ()
|
||||
message(STATUS "Did not find OpenCV in the system, image data is inside RecvContainer as raw data")
|
||||
endif ()
|
||||
@ -83,10 +91,11 @@ if (FFMPEG_FOUND)
|
||||
endif ()
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ${FFMPEG_LIBRARIES})
|
||||
include_directories(${FFMPEG_INCLUDE_DIR})
|
||||
add_definitions(-DFFMPEG_INSTALLED)
|
||||
else ()
|
||||
message(STATUS "Cannot Find FFMPEG")
|
||||
endif (FFMPEG_FOUND)
|
||||
include_directories(${FFMPEG_INCLUDE_DIR})
|
||||
include_directories(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/include)
|
||||
|
||||
find_package(OPUS REQUIRED)
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <dji_logger.h>
|
||||
#include <dji_core.h>
|
||||
#include <dji_aircraft_info.h>
|
||||
#include <csignal>
|
||||
#include "dji_sdk_config.h"
|
||||
|
||||
#include "../common/osal/osal.h"
|
||||
@ -58,6 +59,7 @@ static FILE *s_djiLogFile;
|
||||
static FILE *s_djiLogFileCnt;
|
||||
|
||||
/* Private functions declaration ---------------------------------------------*/
|
||||
static void DjiUser_NormalExitHandler(int signalNum);
|
||||
|
||||
/* Exported functions definition ---------------------------------------------*/
|
||||
Application::Application(int argc, char **argv)
|
||||
@ -206,6 +208,15 @@ void Application::DjiUser_ApplicationStart()
|
||||
T_DjiUserInfo userInfo;
|
||||
T_DjiReturnCode returnCode;
|
||||
T_DjiAircraftInfoBaseInfo aircraftInfoBaseInfo;
|
||||
T_DjiFirmwareVersion firmwareVersion = {
|
||||
.majorVersion = 1,
|
||||
.minorVersion = 0,
|
||||
.modifyVersion = 0,
|
||||
.debugVersion = 0,
|
||||
};
|
||||
|
||||
// attention: when the program is hand up ctrl-c will generate the coredump file
|
||||
signal(SIGTERM, DjiUser_NormalExitHandler);
|
||||
|
||||
returnCode = DjiUser_FillInUserInfo(&userInfo);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
@ -231,6 +242,16 @@ void Application::DjiUser_ApplicationStart()
|
||||
throw std::runtime_error("Set alias error.");
|
||||
}
|
||||
|
||||
returnCode = DjiCore_SetFirmwareVersion(firmwareVersion);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
throw std::runtime_error("Set firmware version error.");
|
||||
}
|
||||
|
||||
returnCode = DjiCore_SetSerialNumber("PSDK12345678XX");
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
throw std::runtime_error("Set serial number error");
|
||||
}
|
||||
|
||||
returnCode = DjiCore_ApplicationStart();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
throw std::runtime_error("Start sdk application error.");
|
||||
@ -389,4 +410,10 @@ T_DjiReturnCode Application::DjiUser_LocalWriteFsInit(const char *path)
|
||||
return djiReturnCode;
|
||||
}
|
||||
|
||||
static void DjiUser_NormalExitHandler(int signalNum)
|
||||
{
|
||||
USER_UTIL_UNUSED(signalNum);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <liveview/test_liveview_entry.hpp>
|
||||
#include <perception/test_perception_entry.hpp>
|
||||
#include <flight_control/test_flight_control.h>
|
||||
#include <gimbal/test_gimbal_entry.hpp>
|
||||
#include <hms/test_hms.h>
|
||||
#include <waypoint_v2/test_waypoint_v2.h>
|
||||
#include <waypoint_v3/test_waypoint_v3.h>
|
||||
@ -41,6 +42,7 @@
|
||||
#include <power_management/test_power_management.h>
|
||||
#include "data_transmission/test_data_transmission.h"
|
||||
#include <camera_manager/test_camera_manager.h>
|
||||
#include "camera_manager/test_camera_manager_entry.h"
|
||||
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
|
||||
@ -75,8 +77,7 @@ start:
|
||||
<< "| [7] Hms info sample - get health manger system info |\n"
|
||||
<< "| [8] Waypoint 2.0 sample - run airline mission by settings (only support on M300 RTK) |\n"
|
||||
<< "| [9] Waypoint 3.0 sample - run airline mission by kmz file (not support on M300 RTK) |\n"
|
||||
<< "| [a] Gimbal manager sample - rotate gimbal on free mode |\n"
|
||||
<< "| [b] Gimbal manager sample - rotate gimbal on yaw follow mode |\n"
|
||||
<< "| [a] Gimbal manager sample |\n"
|
||||
<< "| [c] Camera stream view sample - display the camera video stream |\n"
|
||||
<< "| [d] Stereo vision view sample - display the stereo image |\n"
|
||||
<< "| [e] Start camera all features sample - you can operate the camera on DJI Pilot |\n"
|
||||
@ -85,8 +86,7 @@ start:
|
||||
<< "| [h] Start widget speaker sample - you can operate the speaker on DJI Pilot2 |\n"
|
||||
<< "| [i] Start power management sample - you will see notification when aircraft power off |\n"
|
||||
<< "| [j] Start data transmission sample - you can send or recv custom data on MSDK demo |\n"
|
||||
<< "| [l] Run camera manager sample - shoot photo by the selected camera mounted position |\n"
|
||||
<< "| [m] Run camera manager download sample - download camera media file (not support on M3E/M3T) |\n"
|
||||
<< "| [k] Run camera manager sample - you can test camera's functions interactively |\n"
|
||||
<< std::endl;
|
||||
|
||||
std::cin >> inputChar;
|
||||
@ -122,10 +122,7 @@ start:
|
||||
DjiTest_WaypointV3RunSample();
|
||||
break;
|
||||
case 'a':
|
||||
DjiTest_GimbalManagerRunSample(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_GIMBAL_MODE_FREE);
|
||||
break;
|
||||
case 'b':
|
||||
DjiTest_GimbalManagerRunSample(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_GIMBAL_MODE_YAW_FOLLOW);
|
||||
DjiUser_RunGimbalManagerSample();
|
||||
break;
|
||||
case 'c':
|
||||
DjiUser_RunCameraStreamViewSample();
|
||||
@ -203,14 +200,8 @@ start:
|
||||
|
||||
USER_LOG_INFO("Start data transmission sample successfully");
|
||||
break;
|
||||
case 'l':
|
||||
DjiTest_CameraManagerRunSample(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1,
|
||||
E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_SHOOT_SINGLE_PHOTO);
|
||||
break;
|
||||
case 'm':
|
||||
DjiTest_CameraManagerRunSample(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1,
|
||||
E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_DOWNLOAD_AND_DELETE_MEDIA_FILE);
|
||||
exit(1);
|
||||
case 'k':
|
||||
DjiUser_RunCameraManagerSample();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -40,7 +40,7 @@ extern "C" {
|
||||
* NIC name micro define as #define 'LINUX_NETWORK_DEV "your NIC name"'.
|
||||
*/
|
||||
#ifdef PLATFORM_ARCH_x86_64
|
||||
#define LINUX_NETWORK_DEV "enx000ec6688213"
|
||||
#define LINUX_NETWORK_DEV "enxf8e43b7bbc2c"
|
||||
#else
|
||||
#define LINUX_NETWORK_DEV "l4tbr0"
|
||||
#endif
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#ifdef LIBUSB_INSTALLED
|
||||
|
||||
#include <libusb-1.0/libusb.h>
|
||||
|
Reference in New Issue
Block a user