mavlink / qgroundcontrol

Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)
http://qgroundcontrol.io
3.32k stars 3.64k forks source link

Mission file spec #4291

Closed phrohdoh closed 7 years ago

phrohdoh commented 7 years ago

Hello, I apologize if this is a duplicate I was unable to find any tickets relating to this already.

Is there a spec for the json .mission filetype exported by the flightplan creation interface?

I am working to convert .mission files to .mavlink (which I believe my Bebop2 needs). To do this I have begun writing a quick and dirty python script that reads in mission files and outputs a .mavlink (writing the mavlink is done via mavwp.py).

Specifically, what are the paramN members and is there an enum somewhere in QGC's source to tell me which command int represents which command?

This is one of the flightplans I am trying to convert:

{
    "MAV_AUTOPILOT": 0,
    "complexItems": [
    ],
    "groundStation": "QGroundControl",
    "items": [
        {
            "autoContinue": true,
            "command": 22,
            "coordinate": [
                32.860911190000003,
                -96.94101551,
                15
            ],
            "frame": 0,
            "id": 1,
            "param1": 15,
            "param2": 0,
            "param3": 0,
            "param4": 0,
            "type": "missionItem"
        },
        {
            "autoContinue": true,
            "command": 16,
            "coordinate": [
                32.860961719999999,
                -96.94011141,
                15
            ],
            "frame": 0,
            "id": 2,
            "param1": 2,
            "param2": 0,
            "param3": 0,
            "param4": 0,
            "type": "missionItem"
        },
        {
            "autoContinue": true,
            "command": 16,
            "coordinate": [
                32.860564680000003,
                -96.940087349999999,
                15
            ],
            "frame": 0,
            "id": 3,
            "param1": 2,
            "param2": 0,
            "param3": 0,
            "param4": 0,
            "type": "missionItem"
        },
        {
            "autoContinue": true,
            "command": 16,
            "coordinate": [
                32.860535800000001,
                -96.941130670000007,
                15
            ],
            "frame": 0,
            "id": 4,
            "param1": 2,
            "param2": 0,
            "param3": 0,
            "param4": 0,
            "type": "missionItem"
        },
        {
            "autoContinue": true,
            "command": 16,
            "coordinate": [
                32.860869319999999,
                -96.941257870000001,
                15
            ],
            "frame": 0,
            "id": 5,
            "param1": 2,
            "param2": 0,
            "param3": 0,
            "param4": 0,
            "type": "missionItem"
        },
        {
            "autoContinue": true,
            "command": 20,
            "coordinate": [
                32.860872209999997,
                -96.941144420000001,
                25
            ],
            "frame": 2,
            "id": 6,
            "param1": 0,
            "param2": 0,
            "param3": 0,
            "param4": 0,
            "type": "missionItem"
        }
    ],
    "plannedHomePosition": {
        "autoContinue": true,
        "command": 16,
        "coordinate": [
            32.860906860423178,
            -96.941080299999996,
            15
        ],
        "frame": 0,
        "id": 0,
        "param1": 0,
        "param2": 0,
        "param3": 0,
        "param4": 0,
        "type": "missionItem"
    },
    "version": "1.0"
}
DonLakeFlyer commented 7 years ago

Mission commands are all COMMAND_LONG mavlink commands. Look for MAV_CMD and COMMAND_LONG here: http://mavlink.org/messages/common. Given that the format should be pretty self explanatory. As long as you don't want to try to deal with complexItems: https://github.com/mavlink/qgroundcontrol/issues/3800.