Skip to content

Fix order of parameters in call to _addTimeDistance when using a RTL waypoint #12729

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

Merged
merged 1 commit into from
Apr 27, 2025

Conversation

AsensioL
Copy link
Contributor

Fix order of parameters in call to _addTimeDistance when using a RTH waypoint

Description

This corrects the order of parameters when calling MissionController::_addTimeDistance
Note that the last 3 parameters are time, distance and sequenceNumber (in that order), and they are used correctly everywhere except where corrected by this PR, where previously they had been ordered distance, time and sequenceNumber (note time and distance were swapped).

This escaped the compiler because both parameters are double.

As a result:

  • Before, when creating a route that included a Return To Launch waypoint the "Total Mission" "Distance" shown on top was -.-.
    • For some reason this does not happen when downloading the route from the Drone to QGC.
  • After the fix, when creating a route that includes a Return To Launch/Home waypoint the "Total Mission" "Distance" shown is the correct value.

Test Steps

Create a new Plan from scratch in the Plan View:

  1. IMPORTANT: Manually add Take Off point
  2. Add 2 or 3 waypoints
  3. Add a Return to Launch waypoint
  4. Observe the "Total Mission" Distance on the top toolstrip

Checklist:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@HTRamsey HTRamsey merged commit 18bbab9 into mavlink:master Apr 27, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants