dji-sdk / Mobile-SDK-Android

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

Getting local position of drone #1323

Closed HEEJUN-SHIN closed 1 month ago

HEEJUN-SHIN commented 1 month ago

Hello, Is there any way to get local position of the drone from the reference (from home position) ?

As I look through the API document, I only see

  1. getAircraftLocation : getting GPS based location described as (lat, lon, att)
  2. getVelocity : get velocity of drones (x,y,z)
  3. getAttitude : get roll, pitch, yaw in angle.

Thanks

dji-dev commented 1 month ago

Agent comment from SHENRONG.LE in Zendesk ticket #118677:

Dear Client Thank you for contacting DJI.

The local location of the drone can be obtained in several ways:

  1. You can use KeyAircraftLocation3D to get the location of the drone. This interface returns the location based on the GPS module.
  2. if the uav is equipped with RTK module, you can use RTKLocationInfo. GetRtkLocation RTK antenna module 1 to obtain the location, Or use RTKLocationInfo. GetReal3DLocation for aircraft flight control module and the location of the RTK module after fusion algorithm.
  3. if you need to obtain the local position from the reference point (main position), you can subscribe to the GPS coordinates, and then calculate the offset of the drone and the target position for comparison. When the distance from the target position is lower than a certain threshold, the aircraft can be considered to have reached the specified target position.

Thank you. Kindly Regards, DJI Developer Support

°°°

HEEJUN-SHIN commented 1 month ago

Is the "KeyAircraftLocation3D" also the MSDK v4 API's class?

DO you mean "LocationCoordinate3D getAircraftLocation()" ??

If so, does this method returns the raw GPS value or computed location of drone (maybe fused with vision system)?

dji-dev commented 1 month ago

Agent comment from SHENRONG.LE in Zendesk ticket #118677:

Dear Client Thank you for contacting DJI.

KeyAircraftLocation3D returns the original GPS value, not the calculated position after merging with the vision system. If you need to get after fusion calculation of position, can use RTKLocationInfo. GetReal3DLocation interface.

Thank you. Kindly Regards, DJI Developer Support

°°°

HEEJUN-SHIN commented 1 month ago

okay thank you!!