Skip to content

Commit

Permalink
Merge pull request #702 from mavlink/pr-rally-points
Browse files Browse the repository at this point in the history
examples: add rally points to import
  • Loading branch information
julianoes authored May 23, 2024
2 parents 7a78033 + a254e5b commit 789eaf1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
32 changes: 21 additions & 11 deletions examples/example-mission.plan
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
0,
0,
null,
47.397742,
8.5455939,
47.397763168426465,
8.545600849401296,
50
],
"type": "SimpleItem"
Expand All @@ -46,8 +46,8 @@
0,
0,
null,
47.39822664479198,
8.545560383312846,
47.39871817095695,
8.545497855290222,
50
],
"type": "SimpleItem"
Expand All @@ -65,8 +65,8 @@
0,
0,
null,
47.398249311957585,
8.544924206259822,
47.398700886684885,
8.544924200005596,
50
],
"type": "SimpleItem"
Expand All @@ -84,8 +84,8 @@
0,
0,
null,
47.397741626132294,
8.544924213007533,
47.39774277601443,
8.544925937372682,
50
],
"type": "SimpleItem"
Expand All @@ -108,15 +108,25 @@
}
],
"plannedHomePosition": [
47.397742,
8.5455939,
488.787199104001
47.397763168426465,
8.545600849401296,
null
],
"vehicleType": 2,
"version": 2
},
"rallyPoints": {
"points": [
[
47.3975777095593,
8.545262530782963,
0
],
[
47.39882862292046,
8.545234383318984,
0
]
],
"version": 2
},
Expand Down
14 changes: 9 additions & 5 deletions examples/mission_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ async def run():
print(f"-- Connected to drone!")
break

mission_import_data = await \
drone.mission_raw.import_qgroundcontrol_mission(
"example-mission.plan")
print(f"{len(mission_import_data.mission_items)} mission items imported")
await drone.mission_raw.upload_mission(mission_import_data.mission_items)
out = await drone.mission_raw.import_qgroundcontrol_mission(
"example-mission.plan")

print(f"{len(out.mission_items)} mission items and"
f"{len(out.rally_items)} rally items imported.")

await drone.mission_raw.upload_mission(out.mission_items)
await drone.mission_raw.upload_rally_points(out.rally_items)

print("Mission uploaded")


Expand Down

0 comments on commit 789eaf1

Please sign in to comment.