Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"import_qgroundcontrol_mission_from_string" function not parsing the altitude correctly #688

Open
jhadevansh0809 opened this issue Apr 23, 2024 · 1 comment
Labels

Comments

@jhadevansh0809
Copy link

Steps to Reproduce:

  1. Use the provided mission JSON string.
{
    "fileType": "Plan",
    "geoFence": {
        "circles": [
        ],
        "polygons": [
        ],
        "version": 2
    },
    "groundStation": "QGroundControl",
    "mission": {
        "cruiseSpeed": 15,
        "firmwareType": 12,
        "globalPlanAltitudeMode": 3,
        "hoverSpeed": 30,
        "items": [
            {
                "AMSLAltAboveTerrain": null,
                "Altitude": 16,
                "AltitudeMode": 1,
                "autoContinue": true,
                "command": 22,
                "doJumpId": 1,
                "frame": 3,
                "params": [
                    0,
                    0,
                    0,
                    null,
                    47.3977507,
                    8.5456074,
                    16
                ],
                "type": "SimpleItem"
            },
            {
                "AMSLAltAboveTerrain": 499,
                "Altitude": 16,
                "AltitudeMode": 3,
                "autoContinue": true,
                "command": 16,
                "doJumpId": 2,
                "frame": 0,
                "params": [
                    0,
                    0,
                    0,
                    null,
                    47.39919907,
                    8.54621452,
                    499
                ],
                "type": "SimpleItem"
            },
            {
                "AMSLAltAboveTerrain": 506,
                "Altitude": 16,
                "AltitudeMode": 3,
                "autoContinue": true,
                "command": 16,
                "doJumpId": 3,
                "frame": 0,
                "params": [
                    0,
                    0,
                    0,
                    null,
                    47.39886457,
                    8.54962802,
                    506
                ],
                "type": "SimpleItem"
            },
            {
                "AMSLAltAboveTerrain": 520,
                "Altitude": 16,
                "AltitudeMode": 3,
                "autoContinue": true,
                "command": 16,
                "doJumpId": 4,
                "frame": 0,
                "params": [
                    0,
                    0,
                    0,
                    null,
                    47.39631855,
                    8.54939923,
                    520
                ],
                "type": "SimpleItem"
            },
            {
                "AMSLAltAboveTerrain": 512,
                "Altitude": 16,
                "AltitudeMode": 3,
                "autoContinue": true,
                "command": 16,
                "doJumpId": 5,
                "frame": 0,
                "params": [
                    0,
                    0,
                    0,
                    null,
                    47.39524064,
                    8.54611386,
                    512
                ],
                "type": "SimpleItem"
            },
            {
                "AMSLAltAboveTerrain": 501,
                "Altitude": 16,
                "AltitudeMode": 3,
                "autoContinue": true,
                "command": 16,
                "doJumpId": 6,
                "frame": 0,
                "params": [
                    0,
                    0,
                    0,
                    null,
                    47.39696281,
                    8.54248073,
                    501
                ],
                "type": "SimpleItem"
            },
            {
                "AMSLAltAboveTerrain": 493,
                "Altitude": 16,
                "AltitudeMode": 3,
                "autoContinue": true,
                "command": 16,
                "doJumpId": 7,
                "frame": 0,
                "params": [
                    0,
                    0,
                    0,
                    null,
                    47.39861678,
                    8.54218788,
                    493
                ],
                "type": "SimpleItem"
            },
            {
                "autoContinue": true,
                "command": 20,
                "doJumpId": 8,
                "frame": 2,
                "params": [
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0
                ],
                "type": "SimpleItem"
            }
        ],
        "plannedHomePosition": [
            47.3977507,
            8.5456074,
            491
        ],
        "vehicleType": 2,
        "version": 2
    },
    "rallyPoints": {
        "points": [
        ],
        "version": 2
    },
    "version": 1
}
  1. Upload the mission JSON string to the system.
  2. Observe the altitude mode selected for waypoints with non-null AMSLAltAboveTerrain values.

Expected Behavior:

The system should recognize waypoints with non-null AMSLAltAboveTerrain values and set the altitude mode as "Calculated above Terrain".

Actual Behavior:

The altitude mode for waypoints with non-null AMSLAltAboveTerrain values is being set as RTL altitude mode instead of "Calculated above Terrain".

@julianoes
Copy link
Collaborator

Thanks for the issue. It looks like AMSLAltAboveTerrain is not supported.

I will put this on my todo list, but if anyone is faster than me, here are some hints:

Tests:
https://github.com/mavlink/MAVSDK/blob/7b9655e512b326c7a8f807b4b5caecdd893e8e9c/src/mavsdk/plugins/mission_raw/mission_import_test.cpp

Import logic:
https://github.com/mavlink/MAVSDK/blob/7b9655e512b326c7a8f807b4b5caecdd893e8e9c/src/mavsdk/plugins/mission_raw/mission_import.cpp

If this is urgent for you and you want to move it up my todo list, consider sponsoring me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants