P1 image suffix MSDK and PSDK

评论

10 条评论

  • Dear Developer, Hello and thank you for reaching out to DJI Innovations. Which API are you using to set the image suffix? For MSDK, I was able to set the image suffix to "test" using the _KeyCustomExpandFileNameSettings_ in the MSDK sample app, and after retrieving the media list via _pullMediaFileListFromCamera_, I could see that the image file names had the "test" suffix. You can see the details in the attached picture. Note that the _KeyCustomExpandFileNameSettings_ operation only takes effect once. If you want all media files to have the same extension name during one flight, you need to set the same extension name before taking each photo. For more API usage requirements and instructions, please refer to: https://developer.dji.com/api-reference-v5/android-api/Components/IKeyManager/Key_Camera_CameraKey.html?search=keycustomexpandfilenamesettings&i=0key_camera_customexpandfilenamesettings_inline We appreciate your email and wish you a wonderful day! Best Regards, DJI Innovations SDK Technical Support Team
    0
    评论操作 固定链接
  • Rinto

    Hey! thanks for your swift response. I set the image suffix using DjiCameraManager_SetCustomExpandName in the PSDK (3.10). This works, since I see the images have the correct suffix on the SD card. When I try to pull the images from the MSDK, using _pullMediaFileListFromCamera_, I do see the images, but not with the suffix.

    0
    评论操作 固定链接
  • Dear Developer, I hope this email finds you well Before using _pullMediaFileListFromCamera_, did you first set the media file data source using _setMediaFileDataSource_? The parameters for _setMediaFileDataSource_ can specify the storage location with _setStorageLocation_ and the payload location with _setComponentIndexType_. You need to ensure that these settings are consistent with the location of the images to which you added the suffix and their camera payload location. _setMediaFileDataSource_ API:https://developer.dji.com/api-reference-v5/android-api/Components/IMediaDataCenter/IMediaManager.html?search=setmediafiledatasource&i=0imediamanager_setmediafiledatasource_inline Best Regards, DJI Innovations SDK Technical Support Team
    0
    评论操作 固定链接
  • Rinto

    Hey! I can confirm the location is set correctly. I see the same images as on the SD-card, I'm just missing the suffixes. Can you confirm that if you set the suffix from the PSDK you can then read it from the MSDK? Or at least that if you set it from the PSDK, you can read it from the PSDK (in the media file list, not in the get suffix function)? Dji m300 rtk and p1.

     

     

    0
    评论操作 固定链接
  • Dear Developer, I hope this email finds you well We set the file name suffix of the P1 camera of the M300 through the _DjiCameraManager_SetCustomExpandName_ in the PSDK. Then, by obtaining the media file list through the PSDK, we can indeed read the set suffix naming. Best Regards, DJI Innovations SDK Technical Support Team
    0
    评论操作 固定链接
  • Rinto

    I have set the custom expand name like this :
    const size_t kMaxSuffixSize = 100;
    std::array<uint8_t, kMaxSuffixSize> file_suffix = {};
    std::string prefix = "sometext";
    size_t suffix_size = std::min(prefix.size(), kMaxSuffixSize - 1);
    if (suffix_size >= (kMaxSuffixSize - 1))
    {
        ROS_WARN_STREAM("Suffix: " << prefix << " was too big. Clipped at " << kMaxSuffixSize << " chars.");
    }
    std::copy_n(prefix.begin(), suffix_size, file_suffix.begin());
    file_suffix[suffix_size] = '\0';
    auto return_code = DjiCameraManager_SetCustomExpandName(
        DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_EXPAND_NAME_TYPE_FILE, file_suffix.data(), suffix_size);
    if (return_code != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
    {
        ROS_WARN_STREAM("Failed to set the following suffix to the image: " << prefix);
    }
    And I have validated that the custom expand name is correctly set with :
        uint8_t getNameString[100] = {0};
    uint32_t getNameStringSize;
    getNameStringSize = sizeof(getNameString) - 1;
    return_code = DjiCameraManager_GetCustomExpandName(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1,
                                                       DJI_CAMERA_MANAGER_EXPAND_NAME_TYPE_FILE, getNameString, &getNameStringSize);
    if (return_code != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
    {
        ROS_WARN_STREAM("Failed to read suffix of the image");
    }
    else
    {
        getNameString[getNameStringSize] = '\0';
        std::vector<uint8_t> data(getNameString, getNameString + getNameStringSize);
        std::string prefix(data.begin(), data.end());
        ROS_WARN_STREAM("prefix: " << prefix);
    }
    Then I shoot a photo with :
        DjiCameraManager_SetShootPhotoMode(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, DJI_CAMERA_MANAGER_SHOOT_PHOTO_MODE_SINGLE)
            And lastly I fetch the media file list with :
        T_DjiCameraManagerFileList mediaFileList;
    if (auto return_code = DjiCameraManager_DownloadFileList(DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, &mediaFileList);
        return_code != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
    {
        ROS_FATAL_STREAM("DjiCameraManager_DownloadFileList failed. Return code = " << std::to_string(return_code));
    }
    else
    {
        for (int i = 0; i < mediaFileList.totalCount; i++)
        {
            ROS_WARN_STREAM(mediaFileList.fileListInfo[i].fileName);
        }
    }
    But the image name I get is always of the format DJI_90428.jpg.I can expect it to be DJI_90428_sometext.jpg, right ?
                                                                                                                       What am I doing wrong
        ?

    0
    评论操作 固定链接
  • Hello, thank you for your patience. We noticed that your interface has other packages and is not using the official PSDK version. Can you try it with the latest PSDK 3.11? We have already supported the verification of your function in the C++ sample. You can directly select the corresponding sample to set the suffix name and obtain the media file and download it.
    0
    评论操作 固定链接
  • Rinto

    Hey! Not sure what you mean with not the official PSDK version. ROS_WARN_STREAM is only logging related. You can replace by std::cout<< if you want to test. We are using PSDK 3.11. I do not see how this is different than the sample.

    0
    评论操作 固定链接
  • Rinto

    Perhaps the difference is in T_DjiCameraManagerSubFileListInf vs T_DjiCameraManagerFileListInfo. Will check and let you know! That's the only difference I see wrt the sample. Edit: Never mind, you only do this for LDRT.

    0
    评论操作 固定链接
  • Hello, thank you for your supplement. We are sorry to confuse you. Our main concern is the version you are using. Are all the interfaces consistent with the original PSDK? We are not sure whether it has secondary packaging. If it has secondary packaging, it is possible that the problem comes from its packaging. Therefore, we recommend that you use the officially released PSDK version, so that you can confirm whether it is a problem with the PSDK itself.
    0
    评论操作 固定链接

请先登录再写评论。