dji-sdk / Mobile-SDK-iOS

DJI Mobile SDK for iOS: http://developer.dji.com/mobile-sdk/
Other
577 stars 256 forks source link

DJICamera object is not available when fpvViewController delegate didUpdateCurrentFPVViewCurrentCameraIndexTo method is called after drone reconnects #453

Open YaroTs opened 3 years ago

YaroTs commented 3 years ago

Drone: Mavic 2 Zoom Mobile SDK: 4.14

My ViewController extends DUXDefaultLayoutViewController and confirms to DUXFPVViewControllerDelegate protocol.

When func fpvViewController(_ fpvViewController: DUXFPVViewController, didUpdateCurrentFPVViewCurrentCameraIndexTo updatedFPVViewCurrentCameraIndex: UInt) is called after drone reconnect, DJIAircraft.cameras array is empty, and DJIAircraft.camera is nil.

Steps to reproduce:

  1. Connect remote controller
  2. Turn remote controller and drone on
  3. Turn drone off
  4. Turn drone on
dji-dev commented 3 years ago

Agent comment from Luce Luo in Zendesk ticket #46561:

Dear Customer,

Thank you for contacting DJI. If the MSDK needs some time to connect each component(flight controller, camera, etc) after reconnecting the drone. So recommended using componentConnectedWithKey:andIndex method to ensure the component connected first and then fetch it.

Thanks,

Luce Luo DJI Developer Support

dji-dev commented 3 years ago

Agent comment from Hummels Lei in Zendesk ticket #46561:

Dear YaroTs,

In regards to your request, we haven't received any replies from you for 2 days.

If your request has been resolved, please ignore this email.

If not, please reply to this email directly so that we can provide you with further assistance.

Thank you for choosing DJI.

Best regards,

DJI Developer Support

YaroTs commented 3 years ago

If the MSDK needs some time to connect each component(flight controller, camera, etc) after reconnecting the drone. So recommended using componentConnectedWithKey:andIndex method to ensure the component connected first and then fetch it.

Well, I understand your point, but still we have a situation that dji sdk ux components and its api like DUXFPVViewController and DUXFPVViewControllerDelegate are not consistent with the main sdk part.

It seems it's unexpected behaviour for sdk users. Could you please fix it or, at least, update documentation of appropriate components?