WPMZManager: lost or missing data
Hello,
I'm using `WPMZManager` to read, modify, and save mission files. I'm creating some missions in the DJI Pilot 2 app, exporting them to read/modify in my app, and then reimport them back to Pilot 2 app.
WMPZ SDK Version: `com.dji:wpmzsdk:1.0.1.5`. (I did not find any newer versions)
MSDK version: 5.9.2
When using `WPMZManager`, I'm experiencing the following issues:
1. Unable to get `templateType`
When reading mission files using `WPMZManager.getKMZInfo(path)`, `KMZInfo` object is returned, which contains the `Template` object without `templateType` field. Internally, `WaylineTemplate` object is used which contains `templateType`, but it's transformed to `Template` for `KMZInfo`. I need this info to know if the mission is 'waypoints' or `mapping2d` etc. Is there a way to get around this and get access to `templateType`?
2. When `templateType == "mapping2d"` there are boundary coordinates in the `template.kml` under
<Placemark>
...
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
(coordinates I would like to access)
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
Is there a way to access the coordinates above?
3. Mission data is changed when loaded and saved
If I load mission files using `WPMZManager.getKMZInfo()` and save them using
WPMZManager.generateKMZFile(String kmzPath, WaylineMission waylineMission, WaylineMissionConfig config, Wayline wayline)
then most of the information in the template.kml is lost.
If I save using
WPMZManager.generateKMZFile(String kmzPath , WaylineMission waylineMission , WaylineMissionConfig config , Template waylineTemplate)
In this case, the template file contains more of the initial data, but not all. For example, `templateType` is always `waypoint`, but should be `mapping2d` in my case. So when the mission file is imported back to Pilot 2, it's detected as waypoint mission instead of mapping mission. What is the best approach to retain al the initial data when saving missions? Note that for testing purposes I did not modify any of the files from `KMZInfo`, I just saved them again, but the data is still lost.
I hope I provided enough information - if there's anything else that would be helpful please let me know and I'll try to add more context.
Thank you for your help.
-
Dear developer, Hello, thank you for contacting DJI Innovations. May I ask what exactly WaylineTemplate object you are referring to? Can you provide a detailed explanation? GetKMZInfo does not provide feedback on the template type. How was the kml file generated? Did you test the problem using the 5.9.2 example code? I suggest you use 5.11 for testing as it fixes some issues. Thank you for your email. Wishing you a happy life! Best Regards, DJI Innovation SDK Technical Support
请先登录再写评论。
评论
1 条评论