Implement download_geofence mirroring download_mission#2804
Implement download_geofence mirroring download_mission#2804julianoes merged 4 commits intomavlink:mainfrom
Conversation
78333e0 to
b40b567
Compare
| // Integration test against PX4 SITL. | ||
| // Requires PX4 SITL running on udp://:14540 | ||
| // Run with: --gtest_filter='SitlTest.*' | ||
| TEST(SitlTest, GeofenceUploadDownloadRoundTrip) |
There was a problem hiding this comment.
Same comment as in other PR. We don't use integration tests anymore. Either remove, or better support using the mission_server plugin and test against itself.
There was a problem hiding this comment.
NP. Will be taken care of.
There was a problem hiding this comment.
Done — rewrote it as a self-contained system test with MissionRawServer, no SITL. Also split the telemetry stuff out of the proto PR.
e6d9339 to
804085a
Compare
|
@PavelGuzenfeld sorry I have been a bit slow with reviewing and merging. Going after it today. |
N.P |
|
@PavelGuzenfeld proto merged. You should be able to rebase and update this PR, so we can get it in. |
818ebe2 to
81b63ce
Compare
|
Rebased on main with merged proto #400. Ready for review. |
|
The style check CI failure is a pre-existing issue — running fix_style.py on current main produces 87 files of diff across all C bindings. Not caused by this PR. The docs check failure is because docs weren't regenerated after the proto merge. I can regenerate if you want, or this can be handled post-merge. |
|
Hm, the diff that's wrong is from your additions, right? |
|
Got it. Hopefully. |
289c9de to
76d25db
Compare
76d25db to
c9e694e
Compare
|
I've rebased this PR on top of #2829 to fix the style kerfuffle. |
Add download_geofence() and download_geofence_async() to the Geofence plugin. Uses MAV_MISSION_TYPE_FENCE with MavlinkMissionTransferClient to download fence items, then converts them back to GeofenceData (polygons and circles). The disassemble_items() function reverses assemble_items(): - MAV_CMD_NAV_FENCE_POLYGON_VERTEX_* items are grouped by vertex count (stored in param1) and converted to Polygon structs - MAV_CMD_NAV_FENCE_CIRCLE_* items are converted to Circle structs with radius from param1 Fixes mavlink#2403
Self-contained test using GroundStation + Autopilot MAVSDK instances over local UDP with MissionRawServer. No PX4 SITL dependency.
Run generate_from_protos and fix_style to sync generated C++, C, and Python code with the updated geofence proto.
c9e694e to
7b91119
Compare
Summary
download_geofence()anddownload_geofence_async()to the Geofence plugindisassemble_items()to reverseassemble_items()— converts MAVLink fence items back toGeofenceDataDownloadGeofencehandler in geofence_service_impl.hMotivation
Fixes #2403 — The Geofence plugin has
upload_geofencebut nodownload_geofence. The underlying MAVLink protocol supports both via the mission protocol withMAV_MISSION_TYPE_FENCE.Implementation
MavlinkMissionTransferClient::download_items_async()withMAV_MISSION_TYPE_FENCEdisassemble_items()parses items by command type:MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION/EXCLUSION: groups vertices by count (param1), converts x/y from 1e7 to degreesMAV_CMD_NAV_FENCE_CIRCLE_INCLUSION/EXCLUSION: extracts center point and radius (param1)weak_ptr(same pattern as mission download)Companion PR
Proto changes: mavlink/MAVSDK-Proto#400
Test Results