dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
996 stars 581 forks source link

Find my drone #1296

Closed huongta157 closed 7 months ago

huongta157 commented 7 months ago

Any interface to support finding my drone?

dji-dev commented 7 months ago

Agent comment from yating.liao in Zendesk ticket #105583:

What situation did you find your drone in? If the remote controller is properly connected to the aircraft, the SDK can retrieve the aircraft's location information and even make the drone emit sound.

°°°

huongta157 commented 7 months ago

the SDK can retrieve the aircraft's location information and even make the drone emit sound.

What is the interface or document to implement this?

danilofariadutra commented 7 months ago

If I'm right, you could use " setESCBeepEnabled" by an object Flight Controller

DJISampleApplication.getAircraftInstance().getFlightController().setESCBeepEnabled(true, djiError -> {
                // If you need to use a callback
            });

image

For more instructions, you could use this page:

https://developer.dji.com/api-reference/android-api/Components/FlightController/DJIFlightController.html?search=esc&i=6&#djiflightcontroller_setescbeepenabled_inline

dji-lyt commented 7 months ago

@danilofariadutra You are correct. This interface is used to make the drone emit sound.

The getAircraftLocation can get the location of drone. https://developer.dji.com/api-reference/android-api/Components/FlightController/DJIFlightController_DJIFlightControllerCurrentState.html#djiflightcontroller_djiflightcontrollercurrentstate_aircraftlocation_inline

huongta157 commented 7 months ago

photo_2024-04-24 08 43 29 @dji-lyt @danilofariadutra This feature I want to implement. So, how to get the aircraft location when not connected?

dji-dev commented 7 months ago

Agent comment from yating.liao in Zendesk ticket #105583:

The SDK is unable to retrieve the aircraft's position when not connected to the aircraft. If Pilot 2 can display the aircraft icon without being connected to the aircraft, then Pilot 2 may have cached the location information from the last time it was connected to the aircraft.

°°°

huongta157 commented 7 months ago

@dji-dev I think so, too. Thank you