dji-sdk / Mobile-SDK-Android-V5

MSDK V5 Sample
Other
267 stars 143 forks source link

Cannot build 2D Mapping Waypoint Mission #318

Closed tkocik92 closed 3 days ago

tkocik92 commented 5 months ago

SDK Version: 5.8.0 WPMZ SDK: 1.0.1.5

I'm not sure this is the relevant place to ask this, but it's an issue within this codebase.

I am attempting to create/upload a 2D Mapping mission (Ortho Collection) while utilizing WPMZManager.getInstance().generateKMZFile(). There are 2 problems with this.

  1. A 2D Mapping mission requires me to implement a WaylineTemplate instead of a Template (from what I can tell looking at the source code at least). A Template does not support the various fields used in a 2D Mapping mission (as seen by looking at the raw XML generated by a mission in the Pilot app)
  2. generateKMZFile() does not take WaylineTemplate as a possible parameter. It takes either a Template or a Wayline (ignoring the other parameters in this case).

I did find a helper method in TemplateTransform defined as fun transFromWaylineTemplate(waylineTemplate: WaylineTemplate): Template? but this just creates a Template with no waypoints.

If this is intended behavior, that's fine. Are there helper functions/classes that can convert a 2D Mapping Polgyon into a real waypoint mission?

If this is not intended behavior, what should I be doing?

dji-dev commented 5 months ago

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

The current capability of WPMZSDK does not include the ability to generate 2D Mapping waypoint tasks because it has not been integrated with the WaylineTemplate to create corresponding waylines in the WPML library. The method transFromWaylineTemplate is used to generate a Template from WaylineTemplate, which only supports regular waypoint missions. The transToWaylineTemplate function can convert a Template to WaylineTemplate, but upon reviewing its internal implementation, the templateType is default set to waypoint, and WaylineTemplate cannot be used to generate KMZ files.

If you wish to create a Mapping waypoint mission file, you can generate the corresponding KML file based on the information provided on the official website, and then import this file into Pilot 2 to generate a complete KMZ file.

°°°