Skip to content

Commit 789eaf1

Browse files
authored
Merge pull request #702 from mavlink/pr-rally-points
examples: add rally points to import
2 parents 7a78033 + a254e5b commit 789eaf1

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

examples/example-mission.plan

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
0,
2828
0,
2929
null,
30-
47.397742,
31-
8.5455939,
30+
47.397763168426465,
31+
8.545600849401296,
3232
50
3333
],
3434
"type": "SimpleItem"
@@ -46,8 +46,8 @@
4646
0,
4747
0,
4848
null,
49-
47.39822664479198,
50-
8.545560383312846,
49+
47.39871817095695,
50+
8.545497855290222,
5151
50
5252
],
5353
"type": "SimpleItem"
@@ -65,8 +65,8 @@
6565
0,
6666
0,
6767
null,
68-
47.398249311957585,
69-
8.544924206259822,
68+
47.398700886684885,
69+
8.544924200005596,
7070
50
7171
],
7272
"type": "SimpleItem"
@@ -84,8 +84,8 @@
8484
0,
8585
0,
8686
null,
87-
47.397741626132294,
88-
8.544924213007533,
87+
47.39774277601443,
88+
8.544925937372682,
8989
50
9090
],
9191
"type": "SimpleItem"
@@ -108,15 +108,25 @@
108108
}
109109
],
110110
"plannedHomePosition": [
111-
47.397742,
112-
8.5455939,
113-
488.787199104001
111+
47.397763168426465,
112+
8.545600849401296,
113+
null
114114
],
115115
"vehicleType": 2,
116116
"version": 2
117117
},
118118
"rallyPoints": {
119119
"points": [
120+
[
121+
47.3975777095593,
122+
8.545262530782963,
123+
0
124+
],
125+
[
126+
47.39882862292046,
127+
8.545234383318984,
128+
0
129+
]
120130
],
121131
"version": 2
122132
},

examples/mission_import.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ async def run():
1616
print(f"-- Connected to drone!")
1717
break
1818

19-
mission_import_data = await \
20-
drone.mission_raw.import_qgroundcontrol_mission(
21-
"example-mission.plan")
22-
print(f"{len(mission_import_data.mission_items)} mission items imported")
23-
await drone.mission_raw.upload_mission(mission_import_data.mission_items)
19+
out = await drone.mission_raw.import_qgroundcontrol_mission(
20+
"example-mission.plan")
21+
22+
print(f"{len(out.mission_items)} mission items and"
23+
f"{len(out.rally_items)} rally items imported.")
24+
25+
await drone.mission_raw.upload_mission(out.mission_items)
26+
await drone.mission_raw.upload_rally_points(out.rally_items)
27+
2428
print("Mission uploaded")
2529

2630

0 commit comments

Comments
 (0)