Skip to content

Uploading .plan to ArduPilot using import_qgroundcontrol_mission corrupts parameter #2543

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

Closed
matthieu-db opened this issue Apr 16, 2025 · 3 comments · Fixed by #2560
Closed
Labels

Comments

@matthieu-db
Copy link

matthieu-db commented Apr 16, 2025

For the DIGICAM_CONTROL message, when uploading the .plan (attached as a .json) parameter 5 comes back when downloaded as 1.28e-5 instead of 1. The drone also doesn't take a picture (which it should because I am setting it to 1)

What could cause this? Is there a workaround?

before upload to drone: testpretty.json

after being downloaded from the drone: testdownloaded.json

Script I used to upload to the drone:

import asyncio

from mavsdk import System
import mavsdk.mission_raw


async def run():
    drone = System()
    await drone.connect(system_address="udp://0.0.0.0:14555")

    print("Waiting for drone to connect...")
    async for state in drone.core.connection_state():
        if state.is_connected:
            print(f"-- Connected to drone!")
            break

    out = await drone.mission_raw.import_qgroundcontrol_mission(
        "testpretty.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)

    print("Mission uploaded")


if __name__ == "__main__":
    # Run the asyncio loop
    asyncio.run(run())
@matthieu-db
Copy link
Author

I noticed this when testing our software (using MAVSDK-Java) with a real drone running ArduPilot 4.4.4. Then reproduced it with this minimal example using the Mission Planner SITL. and the above python script.

@julianoes
Copy link
Collaborator

Not optimal, thanks for the issue.

Any chance you can make a unit test that shows it and fails?
https://github.com/mavlink/MAVSDK/blob/main/src/mavsdk/plugins/mission_raw/mission_import_test.cpp

@julianoes
Copy link
Collaborator

Fix coming: #2560.

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

Successfully merging a pull request may close this issue.

2 participants