Comments (10)
Hmm, when you say "ignores" what happens? Does it not upload anything? Do you get an error?
from mavsdk-python.
No error occurs, it just doesn't appear to upload the rally items to the drone. I can still run the mission items and the drone will go to the waypoints but it won't ever go to the rally points and they aren't visible in AMC.
from mavsdk-python.
Can you check whether the rally point import actually works. just check the length of the out.rally_items
. And if it is not working, can you share an example plan that I can use to test the import with?
from mavsdk-python.
The rally import works, printing the length of out.rally_items
returns 2
, which is the number of rally items in this mission file.
For reference, the code I am running is:
# ...connect to drone
out = await drone.mission_raw.import_qgroundcontrol_mission("sample_mission.plan")
print(len(out.rally_items)) # prints 2
await drone.mission_raw.upload_rally_points(out.rally_items)
await drone.mission_raw.upload_mission(out.mission_items)
This is the mission plan I am testing with:
{
"UUID": "c79a2c853872309b8dd462791474cb323d936af2",
"fileType": "Plan",
"geoFence": {
"circles": [
],
"polygons": [
{
"inclusion": true,
"polygon": [
[
43.85722818608631,
-79.61147095948077
],
[
43.85722818608631,
-79.60492835311206
],
[
43.85429874744504,
-79.60492835311206
],
[
43.85429874744504,
-79.61147095948077
]
],
"version": 1
}
],
"version": 2
},
"groundStation": "QGroundControl",
"mission": {
"cruiseSpeed": 15,
"firmwareType": 12,
"globalPlanAltitudeMode": 1,
"hoverSpeed": 5,
"items": [
{
"MISSION_ITEM_ID": "0",
"autoContinue": true,
"command": 178,
"doJumpId": 1,
"frame": 2,
"params": [
1,
5,
-1,
0,
0,
0,
0
],
"type": "SimpleItem"
},
{
"AMSLAltAboveTerrain": 100,
"Altitude": 100,
"AltitudeMode": 1,
"MISSION_ITEM_ID": "2",
"autoContinue": true,
"command": 16,
"doJumpId": 2,
"frame": 3,
"params": [
0,
0,
0,
null,
43.85613586,
-79.60898841,
100
],
"type": "SimpleItem"
},
{
"AMSLAltAboveTerrain": 100,
"Altitude": 100,
"AltitudeMode": 1,
"MISSION_ITEM_ID": "3",
"autoContinue": true,
"command": 16,
"doJumpId": 3,
"frame": 3,
"params": [
0,
0,
0,
null,
43.85572471,
-79.60793674,
100
],
"type": "SimpleItem"
},
{
"AMSLAltAboveTerrain": 100,
"Altitude": 100,
"AltitudeMode": 1,
"MISSION_ITEM_ID": "4",
"autoContinue": true,
"command": 16,
"doJumpId": 4,
"frame": 3,
"params": [
0,
0,
0,
null,
43.85642823,
-79.60695476,
100
],
"type": "SimpleItem"
},
{
"AMSLAltAboveTerrain": 100,
"Altitude": 100,
"AltitudeMode": 1,
"MISSION_ITEM_ID": "5",
"autoContinue": true,
"command": 16,
"doJumpId": 5,
"frame": 3,
"params": [
0,
0,
0,
null,
43.85687592,
-79.6084499,
100
],
"type": "SimpleItem"
},
{
"autoContinue": true,
"command": 20,
"doJumpId": 6,
"frame": 2,
"params": [
0,
0,
0,
0,
0,
0,
0
],
"type": "SimpleItem"
}
],
"plannedHomePosition": [
43.856405656176875,
-79.60898841,
217
],
"vehicleType": 2,
"version": 2
},
"rallyPoints": {
"points": [
[
43.85535468,
-79.6069801,
0
],
[
43.8566064,
-79.60628322,
0
]
],
"version": 2
},
"version": 1
}
Thank you!
from mavsdk-python.
Great, thanks for that.
from mavsdk-python.
Ok, I tried this and I get this:
File "/home/julianoes/src/upstream/MAVSDK-Python/examples/mission_import.py", line 32, in <module>
asyncio.run(run())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/julianoes/src/upstream/MAVSDK-Python/examples/mission_import.py", line 25, in run
await drone.mission_raw.upload_rally_points(mission_import_data.rally_items)
File "/home/julianoes/.local/lib/python3.10/site-packages/mavsdk/mission_raw.py", line 831, in upload_rally_points
raise MissionRawError(result, "upload_rally_points()", mission_items)
mavsdk.mission_raw.MissionRawError: BUSY: 'Busy'; origin: upload_rally_points(); params: ([<mavsdk.mission_raw.MissionItem object at 0x7f77f831b400>, <mavsdk.mission_raw.MissionItem object at 0x7f77f831b430>],)
As soon as I add in a sleep before doing the rally points, it starts working. That's a workaround but hopefully gets you unblocked.
await drone.mission_raw.upload_mission(out.mission_items)
await asyncio.sleep(0.1)
await drone.mission_raw.upload_rally_points(out.rally_items)
from mavsdk-python.
And the real fix is over here: mavlink/MAVSDK#2311
from mavsdk-python.
Thank you for providing updated code, I tested it and while the rally point uploads don't crash, the rally points in the file still don't seem to be actually uploaded to the drone. The .plan
file I shared above also contains a geofence, and I can confirm that uploading the waypoints and the geofence boundaries work, it just seems to be the rally points that don't get uploaded.
Code:
...
out = await drone.mission_raw.import_qgroundcontrol_mission("sample_mission.plan")
await drone.mission_raw.upload_mission(out.mission_items) # this is sent to the drone
await asyncio.sleep(0.1)
assert len(out.geofence_items) > 0
await drone.mission_raw.upload_geofence(out.geofence_items) # this is sent to the drone
await asyncio.sleep(0.1)
assert len(out.rally_items) > 0
await drone.mission_raw.upload_rally_points(out.rally_items) # this isn't sent to the drone, no error occurs
Is this something that is fixed in mavlink/MAVSDK#2311 or is this a separate issue?
Thanks
from mavsdk-python.
They were uploaded in my testing just fine, so that's confusing.
from mavsdk-python.
One other thing to consider is whether your version of PX4 has this: PX4/PX4-Autopilot#22309
If you're using v1.14.0 it will not. If you use v1.14.3 it would include it.
from mavsdk-python.
Related Issues (20)
- getting mavsdk version HOT 5
- RuntimeError: aclose(): asynchronous generator is already running
- System.connect with time out HOT 3
- Running mavsdk server on Windows HOT 4
- How to manual control
- Unable to start a mission a second time HOT 3
- How to detect offboard command completion HOT 3
- One `mavsdk_server`, multiple drones HOT 2
- install mavsdk on py zero HOT 6
- "import_qgroundcontrol_mission_from_string" function not parsing the altitude correctly HOT 1
- drone.info.get_version() INFORMATION_NOT_RECEIVED_YET HOT 8
- FILE_DOES_NOT_EXIST on calling the drone.ftp.list_directory() to fetch internal directories file HOT 13
- The use of drone.offboard.set_position_ned HOT 9
- Error when uploading mission: INVALID_PARAM1 HOT 6
- `aiogrpc` RuntimeError HOT 35
- Running missions in ArduPilot HOT 12
- How to use mavsdk-python to takeoff without GPS HOT 4
- How do I use `telemetry_server` correctly? HOT 4
- Analyzing log files or Distance travelled data from mavsdk python HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mavsdk-python.