-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Labels
backendRelated to backend codeRelated to backend codeeffort:highBroader scope task with unclear timeline (consider splitting)Broader scope task with unclear timeline (consider splitting)enhancementNew feature or requestNew feature or requestpriority:highShould be addressed as a priorityShould be addressed as a priorityrepo:drone-tm
Description
Requirement
- Rather than develop a mobile app ourselves, we could use a QField plugin.
- QML plugins can use JavaScript, so we would need to convert the login in the
drone-flightplanpackage to JS.
User Story
- Go to QField project, with plugin already synced.
- Click on the task area square on the map --> the plugin button 'Generate flightplan' appears.
- User clicks button to generate flightplan, and the file is generated and downloaded to their phone.
- (bonus) instead of downloading the file, the user already has the drone controller plugged into their phone via USB. Clicking 'Generate flightplan' copies the file to the relevant place on the external storage of the controller, making it immediately flyable!
Implementation
DEM raster pixel value extraction
- One key barrier is the elevation extraction from the DEM layer - can we do this within the plugin?
- The DEM is cut out from a global DEM using our AOI, then will be included in the QField project files.
- Alternatively we could make a web query for this, but (1) I'm not sure how feasible it is (2) it's less robust than bundling a <50MB DEM file.
Flightplan generation in JavaScript
- We also need to call the
.jslogic within the QML, return the geojson, and load it as a layer into the project. - The actual logic for this is mostly Python, with some basic geospatial algorithms, e.g. generating a grid of squares over an area. So we need to convert to JavaScript and QGIS engine (geospatial queries) logic for this.
- I hope we can easily hook into the QGIS engine for this.
Getting the flightplan file
- Ideally we can also convert the geojson --> WPML XML, then download onto the users device to loading on the drone.
- We could just download this file to the users device, then they follow the usual method of copying the file to the connected drone flight controller filesystem (Android).
- Alternatively, it looks like we have
WRITE_EXTERNAL_STORAGEpermission for QField already: https://github.com/opengisch/QField/blob/master/platform/android/AndroidManifest.xml.in#L32, so is anything stopping us doing this directly from the plugin, as long as the drone controller is plugged into the phone via USB?
WIP at https://github.com/hotosm/drone-tm/tree/develop/src/qfield-plugin
Additional considerations
- If the QML plugin setup doesn't work for our needs, do we have other options?
- Extend the plugin capabilities in QField core via contribution?
- Write a plugin in C++? Does QField support this?
- It may actually be possible to write to external storage using: https://github.com/opengisch/QField/blob/cc510873c4aab441f9d36812b8724b2196b9e01f/src/core/utils/fileutils.h#L95 (however looks like this will only work on Android, not iOS).
Metadata
Metadata
Assignees
Labels
backendRelated to backend codeRelated to backend codeeffort:highBroader scope task with unclear timeline (consider splitting)Broader scope task with unclear timeline (consider splitting)enhancementNew feature or requestNew feature or requestpriority:highShould be addressed as a priorityShould be addressed as a priorityrepo:drone-tm