### Execute Waypoint V3 Missions with KMZ Files in C Source: https://context7.com/dji-sdk/payload-sdk/llms.txt This C code snippet demonstrates how to initialize, configure, upload, and control waypoint missions using KMZ files. It includes registering callbacks for mission and action states, loading KMZ data from a file, uploading it, and then starting, pausing, resuming, or stopping the mission. Ensure the `dji_waypoint_v3.h` header is included and the necessary SDK is initialized. ```c #include "dji_waypoint_v3.h" // Mission state callback T_DjiReturnCode MissionStateCallback(T_DjiWaypointV3MissionState state) { printf("Mission state: %d, wayline: %d, waypoint: %d\n", state.state, state.wayLineId, state.currentWaypointIndex); switch (state.state) { case DJI_WAYPOINT_V3_MISSION_STATE_IDLE: printf("Mission idle\n"); break; case DJI_WAYPOINT_V3_MISSION_STATE_PREPARE: printf("Mission preparing\n"); break; case DJI_WAYPOINT_V3_MISSION_STATE_MISSION: printf("Mission executing\n"); break; case DJI_WAYPOINT_V3_MISSION_STATE_BREAK: printf("Mission paused\n"); break; } return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; } // Action state callback T_DjiReturnCode ActionStateCallback(T_DjiWaypointV3ActionState state) { printf("Action: group=%d, action=%d, state=%d\n", state.actionGroupId, state.actionId, state.state); return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; } // Initialize waypoint module DjiWaypointV3_Init(); // Register callbacks DjiWaypointV3_RegMissionStateCallback(MissionStateCallback); DjiWaypointV3_RegActionStateCallback(ActionStateCallback); // Load KMZ file FILE *kmzFile = fopen("mission.kmz", "rb"); fseek(kmzFile, 0, SEEK_END); uint32_t kmzLen = ftell(kmzFile); fseek(kmzFile, 0, SEEK_SET); uint8_t *kmzData = malloc(kmzLen); fread(kmzData, 1, kmzLen, kmzFile); fclose(kmzFile); // Upload KMZ mission file T_DjiReturnCode ret = DjiWaypointV3_UploadKmzFile(kmzData, kmzLen); if (ret == DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { printf("Mission uploaded successfully\n"); } free(kmzData); // Start mission DjiWaypointV3_Action(DJI_WAYPOINT_V3_ACTION_START); // Mission control DjiWaypointV3_Action(DJI_WAYPOINT_V3_ACTION_PAUSE); // Pause mission DjiWaypointV3_Action(DJI_WAYPOINT_V3_ACTION_RESUME); // Resume mission DjiWaypointV3_Action(DJI_WAYPOINT_V3_ACTION_STOP); // Stop mission DjiWaypointV3_DeInit(); ``` -------------------------------- ### Control Onboard Cameras with DJI Payload SDK (C) Source: https://context7.com/dji-sdk/payload-sdk/llms.txt This snippet demonstrates how to control onboard cameras using the DJI Payload SDK in C. It covers initialization, getting camera status, setting modes, capturing photos (single and interval), recording video, controlling optical zoom, adjusting focus, and configuring exposure settings. Ensure the DJI camera manager library is included and initialized before use. ```c #include "dji_camera_manager.h" #include // Initialize camera manager DjiCameraManager_Init(); // Get camera type and connection status E_DjiCameraType cameraType; bool connected; DjiCameraManager_GetCameraType(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, &cameraType); DjiCameraManager_GetCameraConnectStatus(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, &connected); // Set camera work mode DjiCameraManager_SetMode(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_WORK_MODE_SHOOT_PHOTO); // Take a single photo DjiCameraManager_StartShootPhoto(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_SHOOT_PHOTO_MODE_SINGLE); // Configure interval shooting T_DjiCameraPhotoTimeIntervalSettings interval = { .captureCount = 10, // Number of photos (255 = continuous) .timeIntervalSeconds = 3, // Interval between photos .timeIntervalMilliseconds = 0 }; DjiCameraManager_SetPhotoTimeIntervalSettings(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, interval); DjiCameraManager_StartShootPhoto(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_SHOOT_PHOTO_MODE_INTERVAL); // Stop interval shooting DjiCameraManager_StopShootPhoto(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1); // Video recording DjiCameraManager_SetMode(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_WORK_MODE_RECORD_VIDEO); DjiCameraManager_StartRecordVideo(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1); sleep(10); // Record for 10 seconds DjiCameraManager_StopRecordVideo(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1); // Optical zoom control DjiCameraManager_StartContinuousOpticalZoom(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_ZOOM_DIRECTION_IN, DJI_CAMERA_ZOOM_SPEED_NORMAL); usleep(500000); // Zoom for 0.5 seconds DjiCameraManager_StopContinuousOpticalZoom(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1); // Set zoom to specific factor DjiCameraManager_SetOpticalZoomParam(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_ZOOM_DIRECTION_IN, 5.0f); // Focus control DjiCameraManager_SetFocusMode(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_FOCUS_MODE_AUTO); T_DjiCameraManagerFocusPosData focusTarget = {.focusX = 0.5f, .focusY = 0.5f}; DjiCameraManager_SetFocusTarget(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, focusTarget); // Exposure settings DjiCameraManager_SetExposureMode(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_EXPOSURE_MODE_EXPOSURE_MANUAL); DjiCameraManager_SetISO(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_ISO_400); DjiCameraManager_SetShutterSpeed(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_SHUTTER_SPEED_1_500); DjiCameraManager_SetAperture(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_APERTURE_F_2_DOT_8); // Cleanup DjiCameraManager_DeInit(); ``` -------------------------------- ### Control Gimbal Rotation and Settings - C Source: https://context7.com/dji-sdk/payload-sdk/llms.txt Provides C code examples for controlling the DJI gimbal, including setting its work mode, rotating it to absolute or relative angles, and adjusting speed-based movements. It also covers resetting the gimbal, enabling extended pitch range, setting speed and smoothing factors, and restoring factory settings. Requires 'dji_gimbal_manager.h'. ```c #include "dji_gimbal_manager.h" // Initialize gimbal manager DjiGimbalManager_Init(); // Set gimbal work mode DjiGimbalManager_SetMode(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_GIMBAL_MODE_YAW_FOLLOW); // Rotate gimbal to absolute angle T_DjiGimbalManagerRotation rotation = { .rotationMode = DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE, .pitch = -30.0f, // Look down 30 degrees .roll = 0.0f, .yaw = 45.0f, // Turn 45 degrees right .time = 1.0 // Execute over 1 second }; DjiGimbalManager_Rotate(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, rotation); // Rotate gimbal by relative offset T_DjiGimbalManagerRotation relativeRotation = { .rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, .pitch = -10.0f, // Tilt down 10 degrees from current .roll = 0.0f, .yaw = 0.0f, .time = 0.5 }; DjiGimbalManager_Rotate(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, relativeRotation); // Speed-based rotation T_DjiGimbalManagerRotation speedRotation = { .rotationMode = DJI_GIMBAL_ROTATION_MODE_SPEED, .pitch = -20.0f, // Pitch speed in deg/s .roll = 0.0f, .yaw = 30.0f, // Yaw speed in deg/s .time = 0.0 }; DjiGimbalManager_Rotate(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, speedRotation); usleep(500000); // Rotate for 0.5 seconds // Stop rotation (set speed to 0) T_DjiGimbalManagerRotation stopRotation = { .rotationMode = DJI_GIMBAL_ROTATION_MODE_SPEED, .pitch = 0.0f, .roll = 0.0f, .yaw = 0.0f, .time = 0.0 }; DjiGimbalManager_Rotate(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, stopRotation); // Reset gimbal to center DjiGimbalManager_Reset(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_GIMBAL_RESET_MODE_YAW); // Enable extended pitch range DjiGimbalManager_SetPitchRangeExtensionEnabled(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, true); // Set max speed and smoothing DjiGimbalManager_SetControllerMaxSpeedPercentage(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_GIMBAL_AXIS_PITCH, 80); DjiGimbalManager_SetControllerSmoothFactor(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_GIMBAL_AXIS_PITCH, 15); // Restore factory settings DjiGimbalManager_RestoreFactorySettings(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1); DjiGimbalManager_Deinit(); ``` -------------------------------- ### CMake Project Setup and Compiler Flags Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/linux/raspberry_pi/CMakeLists.txt Initializes the CMake project, sets C and C++ compiler flags for specific standards and threading, and defines the C and C++ compilers. It also adds a preprocessor definition for GNU source compatibility. ```cmake cmake_minimum_required(VERSION 3.5) project(dji_sdk_demo_on_rpi C) set(CMAKE_C_FLAGS "-pthread -std=gnu99") set(CMAKE_CXX_FLAGS "-std=c++11 -pthread") set(CMAKE_EXE_LINKER_FLAGS "-pthread") set(CMAKE_C_COMPILER "gcc") set(CMAKE_CXX_COMPILER "g++") add_definitions(-D_GNU_SOURCE) ``` -------------------------------- ### Receive Live H264 Video Streams and Decoded Images in C Source: https://context7.com/dji-sdk/payload-sdk/llms.txt This C code snippet shows how to initialize the liveview module, start receiving H264 video streams or decoded image data from cameras, and process them. It includes callbacks for handling H264 frames and decoded images, requesting keyframes for synchronization, and stopping the streams. This functionality is crucial for real-time video analysis and AI inference. Note that decoded image callbacks are specific to DJI Manifold3. ```c #include "dji_liveview.h" // H264 stream callback void H264Callback(E_DjiLiveViewCameraPosition position, const uint8_t *buf, uint32_t len) { static FILE *h264File = NULL; if (!h264File) { h264File = fopen("stream.h264", "wb"); } fwrite(buf, 1, len, h264File); printf("Received H264 frame: %d bytes from camera %d\n", len, position); } // Decoded image callback (for DJI Manifold3 only) void ImageCallback(E_DjiLiveViewCameraPosition position, const uint8_t *buf, uint32_t len, T_DjiLiveviewImageInfo imageInfo) { printf("Image: %dx%d, frame=%d, format=%d\n", imageInfo.width, imageInfo.height, imageInfo.frameId, imageInfo.pixFmt); // Process RGB/NV12 image data for AI inference // buf contains raw pixel data } // Initialize liveview DjiLiveview_Init(); // Start H264 stream from camera DjiLiveview_StartH264Stream(DJI_LIVEVIEW_CAMERA_POSITION_NO_1, DJI_LIVEVIEW_CAMERA_SOURCE_DEFAULT, H264Callback); // Request keyframe for decoder sync DjiLiveview_RequestIntraframeFrameData(DJI_LIVEVIEW_CAMERA_POSITION_NO_1, DJI_LIVEVIEW_CAMERA_SOURCE_DEFAULT); // For M30T thermal camera DjiLiveview_StartH264Stream(DJI_LIVEVIEW_CAMERA_POSITION_NO_1, DJI_LIVEVIEW_CAMERA_SOURCE_M30T_IR, H264Callback); // Start decoded image stream (Manifold3 only) DjiLiveview_StartImageStream(DJI_LIVEVIEW_CAMERA_POSITION_NO_1, DJI_LIVEVIEW_CAMERA_SOURCE_M30_ZOOM, PIXFMT_RGB_PACKED, ImageCallback); // Stop streams DjiLiveview_StopH264Stream(DJI_LIVEVIEW_CAMERA_POSITION_NO_1, DJI_LIVEVIEW_CAMERA_SOURCE_DEFAULT); DjiLiveview_StopImageStream(DJI_LIVEVIEW_CAMERA_POSITION_NO_1, DJI_LIVEVIEW_CAMERA_SOURCE_M30_ZOOM); DjiLiveview_Deinit(); ``` -------------------------------- ### Integrate Optional Dependencies (OpenCV and FFMPEG) Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c++/platform/linux/manifold3/CMakeLists.txt This section demonstrates how to conditionally include OpenCV and FFMPEG dependencies in the build. It uses find_package and pkg_check_modules to detect system installations and updates target definitions and link libraries accordingly. ```cmake # OpenCV find_package(OpenCV QUIET) if (OpenCV_FOUND) add_definitions(-DOPEN_CV_INSTALLED) target_include_directories(${PROJECT_NAME} PRIVATE ${OpenCV_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} PRIVATE ${OpenCV_LIBRARIES}) endif () # FFMPEG find_package(PkgConfig) pkg_check_modules(FFMPEG REQUIRED libavcodec libavformat libavutil libswscale) if (FFMPEG_FOUND) target_link_libraries(${PROJECT_NAME} PRIVATE ${FFMPEG_LIBRARIES}) target_include_directories(${PROJECT_NAME} PRIVATE ${FFMPEG_INCLUDE_DIRS}) target_compile_definitions(${PROJECT_NAME} PRIVATE FFMPEG_INSTALLED) endif() ``` -------------------------------- ### Find and Configure OPUS Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c++/platform/linux/manifold2/CMakeLists.txt This CMake code finds the OPUS library, which is necessary for audio encoding. It checks if OPUS is installed, reports its include paths and library file, and defines a preprocessor macro. It then links a specific static OPUS library file to the project. If OPUS is not found, it prints a message indicating its absence. ```cmake find_package(OPUS REQUIRED) if (OPUS_FOUND) message(STATUS "Found OPUS installed in the system") message(STATUS " - Includes: ${OPUS_INCLUDE_DIR}") message(STATUS " - Libraries: ${OPUS_LIBRARY}") add_definitions(-DOPUS_INSTALLED) target_link_libraries(${PROJECT_NAME} /usr/local/lib/libopus.a) else () message(STATUS "Cannot Find OPUS") endif (OPUS_FOUND) ``` -------------------------------- ### Define Platform-Specific Build Targets Source: https://github.com/dji-sdk/payload-sdk/blob/master/CMakeLists.txt Configures subdirectories and library paths based on the detected system architecture. It includes logic to identify the host machine type and install necessary SDK libraries. ```cmake if (USE_SYSTEM_ARCH MATCHES LINUX) add_definitions(-DSYSTEM_ARCH_LINUX) add_subdirectory(samples/sample_c/platform/linux/manifold2) execute_process(COMMAND uname -m OUTPUT_VARIABLE DEVICE_SYSTEM_ID) if (DEVICE_SYSTEM_ID MATCHES x86_64) set(LIBRARY_PATH psdk_lib/lib/x86_64-linux-gnu-gcc) elseif (DEVICE_SYSTEM_ID MATCHES aarch64) set(LIBRARY_PATH psdk_lib/lib/aarch64-linux-gnu-gcc) endif () install(FILES ${LIBRARY_PATH}/libpayloadsdk.a DESTINATION "${CMAKE_INSTALL_PREFIX}/lib") elseif (USE_SYSTEM_ARCH MATCHES RTOS) add_definitions(-DSYSTEM_ARCH_RTOS) add_subdirectory(samples/sample_c/platform/rtos_freertos/stm32f4_discovery/project/armgcc) endif () ``` -------------------------------- ### Initialize PSDK Core Module Source: https://context7.com/dji-sdk/payload-sdk/llms.txt Initializes the core PSDK module, establishing communication with the aircraft and validating developer credentials. This is a prerequisite for all other PSDK features. It takes 2-4 seconds to complete. ```c #include "dji_core.h" #include "dji_platform.h" // Define user application information from DJI Developer Portal T_DjiUserInfo userInfo = { .appName = "MyPayloadApp", .appId = "123456", .appKey = "your_app_key_here", .appLicense = "your_license_key_here", .developerAccount = "developer@example.com", .baudRate = "921600" }; // Initialize PSDK core (blocking, takes 2-4 seconds) T_DjiReturnCode returnCode = DjiCore_Init(&userInfo); if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { printf("Core init failed: 0x%08llX\n", returnCode); return -1; } // Optional: Set product alias displayed in DJI Pilot DjiCore_SetAlias("Custom Payload v1.0"); // Optional: Set firmware version T_DjiFirmwareVersion version = {1, 0, 0, 0}; DjiCore_SetFirmwareVersion(version); // Start application after all modules are initialized DjiCore_ApplicationStart(); // Cleanup when done DjiCore_DeInit(); ``` -------------------------------- ### Configure and Retrieve Thermal Camera Data in C Source: https://context7.com/dji-sdk/payload-sdk/llms.txt Demonstrates how to initialize the camera manager, configure infrared settings like FFC mode and gain, and perform point or area thermometry. It retrieves temperature statistics and coordinates for specific regions of interest. ```c #include "dji_camera_manager.h" DjiCameraManager_Init(); // Select IR camera stream source DjiCameraManager_SetStreamSource(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_SOURCE_IR_CAM); // Configure FFC (Flat Field Correction) mode DjiCameraManager_SetFfcMode(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_FFC_MODE_AUTO); // Manually trigger FFC DjiCameraManager_TriggerFfc(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1); // Set IR camera gain mode DjiCameraManager_SetInfraredCameraGainMode(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_IR_GAIN_MODE_HIGH); // Get temperature measurement range T_DjiCameraManagerIrTempMeterRange tempRange; DjiCameraManager_GetInfraredCameraGainModeTemperatureRange( DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, &tempRange); printf("Temp range: Low[%.1f to %.1f] High[%.1f to %.1f]\n", tempRange.lowGainTempMin, tempRange.lowGainTempMax, tempRange.highGainTempMin, tempRange.highGainTempMax); // Set point thermometry coordinate (normalized 0-1) T_DjiCameraManagerPointThermometryCoordinate point = { .pointX = 0.5f, // Center of screen .pointY = 0.5f }; DjiCameraManager_SetPointThermometryCoordinate(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, point); // Get point temperature reading T_DjiCameraManagerPointThermometryData pointData; DjiCameraManager_GetPointThermometryData(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, &pointData); printf("Point temperature: %.1f C at (%.2f, %.2f)\n", pointData.pointTemperature, pointData.pointX, pointData.pointY); // Set area thermometry region T_DjiCameraManagerAreaThermometryCoordinate area = { .areaTempLtX = 0.25f, .areaTempLtY = 0.25f, // Top-left .areaTempRbX = 0.75f, .areaTempRbY = 0.75f // Bottom-right }; DjiCameraManager_SetAreaThermometryCoordinate(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, area); // Get area temperature statistics T_DjiCameraManagerAreaThermometryData areaData; DjiCameraManager_GetAreaThermometryData(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, &areaData); printf("Area temp - Avg: %.1f, Min: %.1f at (%.2f,%.2f), Max: %.1f at (%.2f,%.2f)\n", areaData.areaAveTemp, areaData.areaMinTemp, areaData.areaMinTempPointX, areaData.areaMinTempPointY, areaData.areaMaxTemp, areaData.areaMaxTempPointX, areaData.areaMaxTempPointY); // Set infrared zoom DjiCameraManager_SetInfraredZoomParam(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, 2.0f); DjiCameraManager_DeInit(); ``` -------------------------------- ### Subscribe to and Retrieve Flight Controller Telemetry Data in C Source: https://context7.com/dji-sdk/payload-sdk/llms.txt Demonstrates how to initialize the subscription module, register callbacks for real-time data updates, and poll for the latest values of specific flight controller topics. It covers essential telemetry including quaternion, velocity, GPS position, and battery status. ```c #include "dji_fc_subscription.h" // Callback function for real-time quaternion updates T_DjiReturnCode QuaternionCallback(const uint8_t *data, uint16_t dataSize, const T_DjiDataTimestamp *timestamp) { T_DjiFcSubscriptionQuaternion *quat = (T_DjiFcSubscriptionQuaternion *)data; printf("Quaternion: w=%.3f x=%.3f y=%.3f z=%.3f\n", quat->q0, quat->q1, quat->q2, quat->q3); return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; } // Initialize subscription module DjiFcSubscription_Init(); // Subscribe to topics with callback DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_QUATERNION, DJI_DATA_SUBSCRIPTION_TOPIC_50_HZ, QuaternionCallback); // Subscribe to other topics without callback DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_VELOCITY, DJI_DATA_SUBSCRIPTION_TOPIC_50_HZ, NULL); DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GPS_POSITION, DJI_DATA_SUBSCRIPTION_TOPIC_10_HZ, NULL); DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_BATTERY_INFO, DJI_DATA_SUBSCRIPTION_TOPIC_1_HZ, NULL); DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_STATUS_FLIGHT, DJI_DATA_SUBSCRIPTION_TOPIC_10_HZ, NULL); DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION, DJI_DATA_SUBSCRIPTION_TOPIC_10_HZ, NULL); DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_POSITION_FUSED, DJI_DATA_SUBSCRIPTION_TOPIC_10_HZ, NULL); // Poll for latest values T_DjiFcSubscriptionVelocity velocity; T_DjiDataTimestamp timestamp; DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_VELOCITY, (uint8_t *)&velocity, sizeof(velocity), ×tamp); printf("Velocity: x=%.2f y=%.2f z=%.2f m/s\n", velocity.data.x, velocity.data.y, velocity.data.z); T_DjiFcSubscriptionPositionFused position; DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_POSITION_FUSED, (uint8_t *)&position, sizeof(position), ×tamp); printf("Position: lat=%.6f lon=%.6f alt=%.2f satellites=%d\n", position.latitude * 57.2957795, position.longitude * 57.2957795, position.altitude, position.visibleSatelliteNumber); T_DjiFcSubscriptionWholeBatteryInfo battery; DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_BATTERY_INFO, (uint8_t *)&battery, sizeof(battery), ×tamp); printf("Battery: %d%% voltage=%dmV current=%dmA\n", battery.percentage, battery.voltage, battery.current); // Cleanup DjiFcSubscription_DeInit(); ``` -------------------------------- ### Download Camera Media Files - C Source: https://context7.com/dji-sdk/payload-sdk/llms.txt Demonstrates how to download media files from the camera's SD card to the payload device using the DJI Camera Manager API. It includes registering a callback for download progress, initiating downloads, and managing file rights. Dependencies include the 'dji_camera_manager.h' header. ```c #include "dji_camera_manager.h" // Download callback T_DjiReturnCode DownloadCallback(T_DjiDownloadFilePacketInfo packetInfo, const uint8_t *data, uint16_t dataLen) { static FILE *file = NULL; if (packetInfo.downloadFileEvent == DJI_DOWNLOAD_FILE_EVENT_START) { char filename[64]; snprintf(filename, sizeof(filename), "media_%d.jpg", packetInfo.fileIndex); file = fopen(filename, "wb"); printf("Starting download: %s (size: %d bytes)\n", filename, packetInfo.fileSize); } if (packetInfo.downloadFileEvent == DJI_DOWNLOAD_FILE_EVENT_TRANSFER && file) { fwrite(data, 1, dataLen, file); printf("Progress: %.1f%%\n", packetInfo.progressInPercent); } if (packetInfo.downloadFileEvent == DJI_DOWNLOAD_FILE_EVENT_END && file) { fclose(file); file = NULL; printf("Download complete\n"); } return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; } // Initialize and get download rights DjiCameraManager_Init(); DjiCameraManager_ObtainDownloaderRights(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1); // Download file list T_DjiCameraManagerFileList fileList = {0}; DjiCameraManager_DownloadFileList(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, &fileList); printf("Found %d files\n", fileList.totalCount); for (int i = 0; i < fileList.totalCount; i++) { printf("File %d: %s (%d bytes)\n", fileList.fileListInfo[i].fileIndex, fileList.fileListInfo[i].fileName, fileList.fileListInfo[i].fileSize); } // Register callback and download specific file DjiCameraManager_RegDownloadFileDataCallback(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DownloadCallback); DjiCameraManager_DownloadFileByIndex(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, fileList.fileListInfo[0].fileIndex); // Release rights when done DjiCameraManager_ReleaseDownloaderRights(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1); // Optional: delete file DjiCameraManager_DeleteFileByIndex(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, fileList.fileListInfo[0].fileIndex); DjiCameraManager_DeInit(); ``` -------------------------------- ### Create Executable and Post-Build Commands (CMake) Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/rtos_freertos/stm32f4_discovery/project/armgcc/CMakeLists.txt This CMake snippet defines the main executable target and specifies post-build commands to generate HEX and BIN file formats from the ELF executable using `objcopy`. This is essential for flashing the firmware onto the target microcontroller. ```cmake add_executable(${PROJECT_NAME}.elf ${SOURCES} ${MODULE_SAMPLE_SRC} ${APP_SRC} ${LINKER_SCRIPT}) set(HEX_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.hex) set(BIN_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.bin) add_custom_command(TARGET ${PROJECT_NAME}.elf POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Oihex $ ${HEX_FILE} COMMAND ${CMAKE_OBJCOPY} -Obinary $ ${BIN_FILE} COMMENT "Building ${HEX_FILE} Building ${BIN_FILE}") ``` -------------------------------- ### Set Executable Output Path and Link Standard Libraries Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c++/platform/linux/manifold2/CMakeLists.txt This CMake code ensures that the executable output path is set, creating a 'bin' directory in the build directory if it doesn't exist. It also links the standard C math library ('m') and the dynamic linking library ('dl') to the project. This is a common practice for ensuring executables are placed correctly and have access to essential system libraries. ```cmake if (NOT EXECUTABLE_OUTPUT_PATH) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) endif () target_link_libraries(${PROJECT_NAME} m) target_link_libraries(${PROJECT_NAME} dl) ``` -------------------------------- ### Camera Control API Source: https://context7.com/dji-sdk/payload-sdk/llms.txt Functions for managing camera state, capture modes, and hardware settings. ```APIDOC ## Camera Manager API ### Description The Camera Manager allows developers to control camera hardware, including switching work modes, capturing media, and adjusting optical parameters. ### Method C Function Calls ### Parameters #### Path Parameters - **mountPosition** (enum) - Required - The physical port of the payload (e.g., DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1) #### Request Body - **mode** (enum) - Required - Camera work mode (e.g., SHOOT_PHOTO, RECORD_VIDEO) - **settings** (struct) - Optional - Configuration for specific tasks like interval shooting or focus targets ### Request Example // Set camera to photo mode DjiCameraManager_SetMode(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_WORK_MODE_SHOOT_PHOTO); ### Response #### Success Response (200) - **status** (bool) - Returns true if the command was successfully sent to the camera. #### Response Example // Returns status via callback or direct return value depending on function { "status": true } ``` -------------------------------- ### Glob C Source Files for Module Samples Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/rtos_freertos/gd32f527_development_board/project/armgcc/CMakeLists.txt This CMake command uses `file(GLOB_RECURSE)` to find all C source files (`*.c`) within various subdirectories under `../../../../../module_sample/`. The found files are collected into the `MODULE_SAMPLE_SRC` variable. This allows for dynamic inclusion of sample code for different modules like camera manager, payload collaboration, and flight control. ```cmake file(GLOB_RECURSE MODULE_SAMPLE_SRC ../../../../../module_sample/camera_manager/*.c ../../../../../module_sample/payload_collaboration/*.c ../../../../../module_sample/camera_emu/test_payload_cam_emu_base.c ../../../../../module_sample/xport/*.c ../../../../../module_sample/gimbal_emu/*.c ../../../../../module_sample/data_transmission/*.c ../../../../../module_sample/fc_subscription/*.c ../../../../../module_sample/flight_control/*.c ../../../../../module_sample/gimbal_manager/*.c ../../../../../module_sample/waypoint_v2/*.c ../../../../../module_sample/hms/*.c ../../../../../module_sample/hotpoint/*.c ../../../../../module_sample/liveview/*.c ../../../../../module_sample/mop_channel/*.c ../../../../../module_sample/perception/*.c ../../../../../module_sample/waypoint_v2/*.c ../../../../../module_sample/upgrade/*.c ../../../../../module_sample/widget/*.c ../../../../../module_sample/utils/*.c ../../../../../module_sample/positioning/*.c ../../../../../module_sample/time_sync/*.c ../../../../../module_sample/waypoint_v3/*.c ../../../../../module_sample/power_management/*.c ../../../../../module_sample/tethered_battery/*.c ) ``` -------------------------------- ### Find and Configure OpenCV Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c++/platform/linux/manifold2/CMakeLists.txt This snippet demonstrates how to find the OpenCV library using CMake's find_package command. If found, it prints the include directories and libraries, defines a preprocessor macro, and adds OpenCV include directories to the target. This is used for advanced sensing APIs that require image processing. ```cmake find_package(OpenCV QUIET) if (OpenCV_FOUND) message("\n${PROJECT_NAME}...") message(STATUS "Found OpenCV installed in the system, will use it to display image in AdvancedSensing APIs") message(STATUS " - Includes: ${OpenCV_INCLUDE_DIRS}") message(STATUS " - Libraries: ${OpenCV_LIBRARIES}") add_definitions(-DOPEN_CV_INSTALLED) target_include_directories(${PROJECT_NAME} PRIVATE ${OpenCV_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS}) else () message(STATUS "Did not find OpenCV in the system, image data is inside RecvContainer as raw data") endif () ``` -------------------------------- ### Link Project Libraries Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/rtos_freertos/gd32f527_development_board/project/armgcc/CMakeLists.txt This CMake snippet specifies the directories where the linker should search for libraries and then links a specific static library. `${CMAKE_CURRENT_LIST_DIR}/../../../../../../../out/lib/arm-none-eabi-gcc` is the path to the library directory, and `lib${PACKAGE_NAME}.a` is the library file to be linked. This ensures that the necessary pre-compiled code is included in the final executable. ```cmake link_directories(${CMAKE_CURRENT_LIST_DIR}/../../../../../../../out/lib/arm-none-eabi-gcc) link_libraries(${CMAKE_CURRENT_LIST_DIR}/../../../../../../../out/lib/arm-none-eabi-gcc/lib${PACKAGE_NAME}.a) ``` -------------------------------- ### Source File Discovery and Include Directories Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/linux/raspberry_pi/CMakeLists.txt Uses GLOB_RECURSE to find all C source files in common, HAL, application, and module sample directories. It then sets include directories for these modules and external libraries. ```cmake file(GLOB_RECURSE MODULE_COMMON_SRC ../common/*.c) file(GLOB_RECURSE MODULE_HAL_SRC hal/*.c) file(GLOB_RECURSE MODULE_APP_SRC application/*.c) file(GLOB_RECURSE MODULE_SAMPLE_SRC ../../../module_sample/*.c) include_directories(../../../module_sample) include_directories(../common) include_directories(application) include_directories(../../../../../psdk_lib/include) link_directories(../../../../../psdk_lib/lib/${TOOLCHAIN_NAME}) link_libraries(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/lib/${TOOLCHAIN_NAME}/lib${PACKAGE_NAME}.a) ``` -------------------------------- ### Find and Configure FFMPEG Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c++/platform/linux/manifold2/CMakeLists.txt This CMake script finds the FFMPEG library, which is required for media operations. It checks for FFMPEG's presence, prints its include directories and libraries, and verifies the FFMPEG version. If the version is not supported (specifically checking for version 5.x.x), it raises a fatal error. It then links FFMPEG libraries and includes its directories to the project. ```cmake find_package(FFMPEG REQUIRED) if (FFMPEG_FOUND) message(STATUS "Found FFMPEG installed in the system") message(STATUS " - Includes: ${FFMPEG_INCLUDE_DIR}") message(STATUS " - Libraries: ${FFMPEG_LIBRARIES}") EXECUTE_PROCESS(COMMAND ffmpeg -version OUTPUT_VARIABLE ffmpeg_version_output OUTPUT_STRIP_TRAILING_WHITESPACE ) string(REGEX MATCH "version.*Copyright" ffmpeg_version_line ${ffmpeg_version_output}) string(REGEX MATCH " .* " ffmpeg_version ${ffmpeg_version_line}) string(REGEX MATCH "^ 5.*$" ffmpeg_major_version ${ffmpeg_version}) if (HEAD${ffmpeg_major_version} STREQUAL "HEAD") message(STATUS " - Version: ${ffmpeg_version}") else () message(FATAL_ERROR " - Not support FFMPEG version: ${ffmpeg_major_version}, please install 4.x.x instead.") 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) ``` -------------------------------- ### Laser Ranging API Source: https://context7.com/dji-sdk/payload-sdk/llms.txt Interface for retrieving real-time distance and positioning data from laser rangefinders. ```APIDOC ## C API: Laser Ranging ### Description Polls the laser rangefinder to obtain distance, latitude, longitude, and altitude data. ### Method N/A (C Function Calls) ### Parameters - **mountPosition** (enum) - Required - The payload port (e.g., DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1) ### Request Example T_DjiCameraManagerLaserRangingInfo laserInfo; DjiCameraManager_GetLaserRangingInfo(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, &laserInfo); ### Response #### Success Response - **distance** (float) - Measured distance in meters - **latitude/longitude** (double) - Geographic coordinates of the target - **altitude** (int) - Target altitude in decimeters ``` -------------------------------- ### Linking Standard Libraries and Custom Command Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/linux/raspberry_pi/CMakeLists.txt Links the standard C math library (m) and dynamic linking library (dl) to the project. It also defines a custom command to run CMake again before linking, likely for configuration updates. ```cmake target_link_libraries(${PROJECT_NAME} m dl) add_custom_command(TARGET ${PROJECT_NAME} PRE_LINK COMMAND cmake .. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) ``` -------------------------------- ### Glob Source Files for Build (CMake) Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/rtos_freertos/stm32f4_discovery/project/armgcc/CMakeLists.txt These CMake commands use `file(GLOB_RECURSE)` to dynamically find source files within specified directories. This is used to gather application sources, module samples, and common SDK sources, simplifying the build process by automatically including new files added to these directories. ```cmake file(GLOB_RECURSE APP_SRC ../../application/*.c) file(GLOB_RECURSE MODULE_SAMPLE_SRC ../../../../../module_sample/camera_emu/test_payload_cam_emu_common.c ../../../../../module_sample/gimbal_emu/*.c ../../../../../module_sample/data_transmission/*.c ../../../../../module_sample/fc_subscription/*.c ../../../../../module_sample/mop_channel/*.c ../../../../../module_sample/time_sync/*.c ../../../../../module_sample/positioning/*.c ../../../../../module_sample/xport/*.c ../../../../../module_sample/widget/*.c ../../../../../module_sample/upgrade/*.c ../../../../../module_sample/payload_collaboration/*.c ../../../../../module_sample/utils/*.c ../../../../../module_sample/power_management/*.c ) file(GLOB_RECURSE SOURCES "../../../common/osal/*.*" "../../drivers/BSP/*.*" "../../hal/*.*" "../../drivers/USB_HOST/*.*" "../../middlewares/ST/*.*" "../../middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c" "../../middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c" "../../middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c" "../../middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c" "../../middlewares/Third_Party/FreeRTOS/Source/crpsdk_libine.c" "../../middlewares/Third_Party/FreeRTOS/Source/event_groups.c" "../../middlewares/Third_Party/FreeRTOS/Source/list.c" "../../middlewares/Third_Party/FreeRTOS/Source/queue.c" "../../middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c" "../../middlewares/Third_Party/FreeRTOS/Source/timers.c" "../../middlewares/Third_Party/FreeRTOS/Source/tasks.c" "../../drivers/STM32F4xx_HAL_Driver/*.*" ) ``` -------------------------------- ### Control DJI Flight Operations Source: https://context7.com/dji-sdk/payload-sdk/llms.txt Manages core flight operations including takeoff, landing, go-home, motor control, and setting home locations. It also allows configuration of RC lost actions and obstacle avoidance systems. Initialization requires Remote ID information. ```c #include "dji_flight_controller.h" #include "dji_fc_subscription.h" // Initialize with Remote ID information T_DjiFlightControllerRidInfo ridInfo = { .latitude = 22.542812, // degrees .longitude = 113.958902, // degrees .altitude = 10 // meters }; T_DjiReturnCode returnCode = DjiFlightController_Init(ridInfo); if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { printf("Flight controller init failed: 0x%08llX\n", returnCode); return -1; } // Basic flight operations DjiFlightController_StartTakeoff(); // Initiate takeoff DjiFlightController_StartLanding(); // Initiate landing DjiFlightController_CancelLanding(); // Cancel landing DjiFlightController_StartGoHome(); // Return to home point DjiFlightController_CancelGoHome(); // Cancel go-home // Motor control DjiFlightController_TurnOnMotors(); // Start motors on ground DjiFlightController_TurnOffMotors(); // Stop motors on ground // Set go-home altitude (20-1500 meters) DjiFlightController_SetGoHomeAltitude(100); // Set home location using GPS coordinates T_DjiFlightControllerHomeLocation home = { .latitude = 22.542812 * 0.01745329252, // Convert to radians .longitude = 113.958902 * 0.01745329252 }; DjiFlightController_SetHomeLocationUsingGPSCoordinates(home); // Or use current aircraft location as home DjiFlightController_SetHomeLocationUsingCurrentAircraftLocation(); // Configure RC lost action DjiFlightController_SetRCLostAction(DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_GOHOME); // Enable obstacle avoidance DjiFlightController_SetHorizontalVisualObstacleAvoidanceEnableStatus( DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE); DjiFlightController_SetUpwardsVisualObstacleAvoidanceEnableStatus( DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE); DjiFlightController_SetDownwardsVisualObstacleAvoidanceEnableStatus( DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE); // Cleanup DjiFlightController_DeInit(); ``` -------------------------------- ### Define Preprocessor Macros Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/rtos_freertos/gd32f527_development_board/project/armgcc/CMakeLists.txt This command adds preprocessor definitions to be used during compilation. `-DDEBUG`, `-DUSE_HAL_DRIVER`, and `-DGD32F527` enable specific features or configurations within the codebase, such as enabling debug output, using the HAL driver, and targeting the GD32F527 microcontroller. ```cmake add_definitions(-DDEBUG -DUSE_HAL_DRIVER -DGD32F527) ``` -------------------------------- ### Glob C Source Files for Application Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/rtos_freertos/gd32f527_development_board/project/armgcc/CMakeLists.txt This CMake command uses `file(GLOB_RECURSE)` to find all files ending with `.c` within the specified directory `../../application/`. The found files are then stored in the `APP_SRC` variable. This is a convenient way to automatically include all source files from a directory without listing them individually. ```cmake file(GLOB_RECURSE APP_SRC ../../application/*.c) ``` -------------------------------- ### LIBUSB Library Integration Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/linux/raspberry_pi/CMakeLists.txt Finds the LIBUSB library using find_package. If found, it prints status messages, adds a preprocessor definition, and links the LIBUSB library to the target executable. If not found, it prints a status message. ```cmake find_package(LIBUSB REQUIRED) if (LIBUSB_FOUND) message(STATUS "Found LIBUSB installed in the system") message(STATUS " - Includes: ${LIBUSB_INCLUDE_DIR}") message(STATUS " - Libraries: ${LIBUSB_LIBRARY}") add_definitions(-DLIBUSB_INSTALLED) target_link_libraries(${PROJECT_NAME} usb-1.0) else () message(STATUS "Cannot Find LIBUSB") endif (LIBUSB_FOUND) ``` -------------------------------- ### Include Project Header Directories Source: https://github.com/dji-sdk/payload-sdk/blob/master/samples/sample_c/platform/rtos_freertos/gd32f527_development_board/project/armgcc/CMakeLists.txt This section adds multiple directories to the compiler's include path. These directories contain header files for various modules and components of the project, such as application code, common OSAL, hardware abstraction layers, and FreeRTOS. This allows source files to include headers from these locations using relative paths. ```cmake include_directories ( ../../../../../module_sample ../../application ../../../common/osal ../../hal ../../osal ) include_directories ( ../../application ../../hal ../../../common/osal ../../middlewares/FreeRTOS-10.3.1/include ../../middlewares/FreeRTOS-10.3.1/portable/GCC/ARM_CM33_NTZ ../../middlewares/FreeRTOS-10.3.1/portable/GCC/ARM_CM33_NTZ/non_secure ../../../../../module_sample ../../../../../../../modules/aircraft_info/include ../../../../../../../modules/error/include ../../../../../../../modules/camera_manager/include ../../../../../../../modules/core/include ../../../../../../../modules/xxx_template/include ../../../../../../../modules/widget/include ../../../../../../../modules/waypoint_v3/include ../../../../../../../modules/waypoint_v2/include ../../../../../../../modules/upgrade/include ../../../../../../../modules/time_sync/include ../../../../../../../modules/power_management ../../../../../../../modules/positioning/include ../../../../../../../modules/platform/include ../../../../../../../modules/perception/include ../../../../../../../modules/payload_xport/include ../../../../../../../modules/payload_gimbal/include ../../../../../../../modules/payload_camera/include ../../../../../../../modules/payload_camera/payload_collaboration ../../../../../../../modules/fc_subscription/include ../../../../../../../modules/logger/include ../../../../../../../modules/data_channel/include ../../../../../../../modules/data_channel/high_speed_data_channel ../../../../../../../modules/data_channel/low_speed_data_channel ../../../../../../../modules/data_channel/stream_channel ../../../../../../../modules/data_channel/mop_channel/mop ../../../../../../../modules/flight_controller/include ../../../../../../../modules/liveview ../../../../../../../modules/gimbal_manager/include ../../../../../../../modules/hms/include ../../../../../../../modules/data_channel/mop_channel/mop/inc ../../../../../../../modules/battery/include ../../../../../../../modules/authentication/ciu98/huada_lib/inc ../../../../../../../modules/authentication ../../../../../../../modules/authentication/ciu98 ../../../../../../../modules/network_rtk/include ../../../../../../../modules/fts/include ../../drivers/CMSIS/include ../../drivers/CMSIS/GD/GD32F5xx/Include ../../drivers/BSP ../../drivers/GD32F5xx_standard_peripheral/Include ../../drivers/GD32F5xx_usb_library/device/core/Include ../../drivers/GD32F5xx_usb_library/driver/Include ../../drivers/GD32F5xx_usb_library/device/class/cdc/Include ../../drivers/GD32F5xx_usb_library/ustd/common ../../drivers/GD32F5xx_usb_library/ustd/class/cdc ) ```