dji-sdk / Payload-SDK

DJI Payload SDK Official Repository
https://github.com/dji-sdk/Payload-SDK
Other
265 stars 118 forks source link

PSDK commands timesout after multiple calls M30 #151

Open stevedanomodolor opened 8 months ago

stevedanomodolor commented 8 months ago

For bit of context, currently we use flying the m30 with the psdk software. After running multiple missions with streaming, we notice that all of a sudden, randomly the service call to the psdk times out. I also noticed this behavior when I set the camera source to the m30T based on the enum in the payload sdk. It seems that the enum is incorrect and that the zoom for the m30/m30T is 2 like the h20 while the wide is 1. Please confirm if this is indeed the case.

typedef enum {
    DJI_LIVEVIEW_CAMERA_SOURCE_DEFAULT = 0,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20_WIDE = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20_ZOOM = 2,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20T_WIDE = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20T_ZOOM = 2,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20T_IR = 3,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20N_WIDE = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20N_ZOOM = 2,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20N_IR = 3,
    DJI_LIVEVIEW_CAMERA_SOURCE_M30_ZOOM = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_M30_WIDE = 2,
    DJI_LIVEVIEW_CAMERA_SOURCE_M30T_ZOOM = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_M30T_WIDE = 2,
    DJI_LIVEVIEW_CAMERA_SOURCE_M30T_IR = 3,
    DJI_LIVEVIEW_CAMERA_SOURCE_M3E_VIS = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_M3T_VIS = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_M3T_IR = 2,
} E_DjiLiveViewCameraSource;

I am not sure it is a problem related to the baudrate or the frequency we set for each of the subscriber. Currently for the M30, we use the following information. Also, it seem the documentation on your payload page on the frequency and topics available for each drone is incorrect ->https://developer.dji.com/doc/payload-sdk-tutorial/en/function-set/basic-function/info-management.html


      baudrate: "921600"
      data_frequency:
        imu: 50
        attitude: 50
        acceleration: 50
        velocity: 50
        angular_velocity: 50
        position: 50
        altitude: 50
        gps_fused_position: 10
        gps_data: 10
        rtk_data: 5
        magnetometer: 50
        rc_channels_data: 1
        gimbal_data: 50
        flight_status: 1
        battery_level: 1
        control_information: 1
dji-dev commented 8 months ago

Agent comment from Leon in Zendesk ticket #102367:

Dear Developer,

Hello, thank you for contacting DJI.

the m30/m30T is 2 like the h20 while the wide is 1 This is normal and by design.

If your command times out, it is likely that your serial port cannot handle the large amount of data. We noticed that you subscribed to too many TOPICs, and the frequency is generally 50Hz. We recommend that you lower the frequency and try to see if there is an improvement, or reduce the number of TOPICs you subscribe to.

In addition, can you upload your PSDK operation log? File containing Debug information.

Thank you for your support of DJI products.

Best Regards, DJI Dajiang innovation SDK technical support

°°°

stevedanomodolor commented 8 months ago

how can i get the PSDK operation log?

stevedanomodolor commented 8 months ago

the m30/m30T is 2 like the h20 while the wide is 1

Sorry what do you mean by this, do you mean the following is incorrect ?

 DJI_LIVEVIEW_CAMERA_SOURCE_DEFAULT = 0,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20_WIDE = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20_ZOOM = 2,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20T_WIDE = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20T_ZOOM = 2,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20T_IR = 3,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20N_WIDE = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20N_ZOOM = 2,
    DJI_LIVEVIEW_CAMERA_SOURCE_H20N_IR = 3,
    DJI_LIVEVIEW_CAMERA_SOURCE_M30_ZOOM = 2,
    DJI_LIVEVIEW_CAMERA_SOURCE_M30_WIDE = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_M30T_ZOOM = 2,
    DJI_LIVEVIEW_CAMERA_SOURCE_M30T_WIDE = 1,
    DJI_LIVEVIEW_CAMERA_SOURCE_M30T_IR = 3,

So the enum in the payload sdk code is wrong? so for the m30/m30t, the wide is 2 while for the m20, the wide is 1?

dji-dev commented 8 months ago

Agent comment from Leon in Zendesk ticket #102367:

Dear Developer,

Hello, thank you for contacting DJI.

Thank you for your patience. The complete log on how to obtain the PSDK can be found at this path: Payload-SDK-release-v3.8/build/bin/Logs

No, what I mean is that this enumeration is correct. We set the wide-angle lens to 1, the zoom lens to 2, and the infrared lens to 3. Does it currently have any impact on your use or functions?

Thank you for your support of DJI products.

Best Regards, DJI Dajiang innovation SDK technical support

°°°

stevedanomodolor commented 8 months ago

I am saying in your code https://github.com/dji-sdk/Payload-SDK/blob/db9d05ee2b3289b957522d49b919861d33020c74/psdk_lib/include/dji_liveview.h#L65 it is wrong, it is put the other way around.

dji-dev commented 8 months ago

Agent comment from Leon in Zendesk ticket #102367:

Dear Developer,

Hello, thank you for contacting DJI.

Thank you for your patience and additional information. I'm very sorry that I didn't fully understand what you meant before. I fully understand it now. There is a problem with the corresponding numbers in the video source column of the M30's zoom camera and wide-angle camera. I just tested it. The acquisition of these two video sources is corresponding and normal. It should not affect your use currently. Regarding your feedback, we will simultaneously send it to the R&D team for confirmation and correction. Thank you again~!

Thank you for your support of DJI products.

Best Regards, DJI Dajiang innovation SDK technical support

°°°