Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add "Restart Mission" checkbox to "Set Current Waypoint" action#14345

Open
jnomikos wants to merge 1 commit into
mavlink:mastermavlink/qgroundcontrol:masterfrom
jnomikos:dev-restart-missionjnomikos/qgroundcontrol:dev-restart-missionCopy head branch name to clipboard
Open

Add "Restart Mission" checkbox to "Set Current Waypoint" action#14345
jnomikos wants to merge 1 commit into
mavlink:mastermavlink/qgroundcontrol:masterfrom
jnomikos:dev-restart-missionjnomikos/qgroundcontrol:dev-restart-missionCopy head branch name to clipboard

Conversation

@jnomikos

@jnomikos jnomikos commented May 8, 2026

Copy link
Copy Markdown
Contributor

Description

On firmware which supports MAV_CMD_DO_SET_MISSION_CURRENT (ArduPilot), "Set Current Waypoint" command now has a checkbox to optionally "Restart Mission".

To summarize, when "Restart Mission" is checked, MAV_CMD_DO_SET_MISSION_CURRENT will be sent with the restart param set to true which will restart the mission and any jump counters. This is useful for two cases:

  1. User flew a mission to the end which does not contain a RTL and wants to restart their mission from a previous waypoint.

  2. User has a mission with jump counters and wishes to go to a previous waypoint and reset those counters too.

This solves the issue listed here: #13927 and was discussed in this closed PR here: #13934

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/Build changes
  • Other

Testing

  • Tested locally
  • Added/updated unit tests
  • Tested with simulator (SITL)
  • Tested with hardware

Platforms Tested

  • Linux
  • Windows
  • macOS
  • Android
  • iOS

Flight Stacks Tested

  • PX4
  • ArduPilot

Screenshots

2026-05-08.14-03-59.mp4
image
2026-05-24.14-37-28.mp4

Checklist

  • I have read the Contribution Guidelines
  • I have read the Code of Conduct
  • My code follows the project's coding standards
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally

Related Issues

#13927


By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).

@jnomikos
jnomikos requested a review from HTRamsey as a code owner May 8, 2026 18:13
Copilot AI review requested due to automatic review settings May 8, 2026 18:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Restart Mission” guided action to let operators reset mission execution back to the first waypoint while in flight (including when the mission is paused), aligning with the UX needs discussed in #13927/#13934.

Changes:

  • Extends Vehicle::setCurrentMissionSequence to optionally request a mission restart/reset via MAV_CMD_DO_SET_MISSION_CURRENT param2.
  • Adds a new guided action (Restart Mission) with confirmation text and wires it into the Fly View “Additional Actions” list.
  • Registers a new FlyView resource (restart-mission.svg) for the feature’s UI assets.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Vehicle/Vehicle.h Updates the invokable API to accept an optional restart/reset flag.
src/Vehicle/Vehicle.cc Sends the restart/reset flag as an extra MAVLink command parameter.
src/FlyView/GuidedActionsController.qml Introduces the new guided action (visibility, confirmation, execution).
src/FlyView/FlyViewAdditionalActionsList.qml Exposes “Restart Mission” in the additional actions panel model.
src/FlyView/CMakeLists.txt Adds an SVG resource entry intended for the new action.

Comment thread src/FlyView/CMakeLists.txt Outdated
Comment thread src/FlyView/GuidedActionsController.qml Outdated
property bool showLand: _guidedActionsEnabled && _activeVehicle.supports.guidedMode && _vehicleArmed && !_activeVehicle.fixedWing && !_vehicleInLandMode
property bool showStartMission: _guidedActionsEnabled && _missionAvailable && !_missionActive && !_vehicleFlying && _canStartMission
property bool showContinueMission: _guidedActionsEnabled && _missionAvailable && !_missionActive && _vehicleArmed && _vehicleFlying && (_currentMissionIndex < _visualItemsCount - 1)
property bool showRestartMission: _guidedActionsEnabled && _missionAvailable && _vehicleArmed && _vehicleFlying && !_fixedWingOnApproach

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot actionRestartMission basically does what actionSetWaypoint does, except it has the restart flag set to true. If we don't block actionSetWaypoint during RTL or Land, I don't see the need to hide actionRestartMission.

Comment thread src/Vehicle/Vehicle.h Outdated
Comment thread src/Vehicle/Vehicle.cc
@jnomikos
jnomikos force-pushed the dev-restart-mission branch from 496585a to 6af2d53 Compare May 8, 2026 18:40
@github-actions github-actions Bot removed the CMake label May 8, 2026
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.42%. Comparing base (f29efd3) to head (f2f0630).
⚠️ Report is 188 commits behind head on master.

Files with missing lines Patch % Lines
src/Vehicle/VehicleSupports.cc 0.00% 5 Missing ⚠️
src/Vehicle/Vehicle.cc 0.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (30.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14345      +/-   ##
==========================================
+ Coverage   25.47%   32.42%   +6.95%     
==========================================
  Files         769      781      +12     
  Lines       65912    67227    +1315     
  Branches    30495    31147     +652     
==========================================
+ Hits        16788    21796    +5008     
+ Misses      37285    30732    -6553     
- Partials    11839    14699    +2860     
Flag Coverage Δ
unittests 32.42% <0.00%> (+6.95%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Vehicle/Vehicle.h 68.75% <ø> (+28.12%) ⬆️
src/Vehicle/Vehicle.cc 29.08% <0.00%> (+7.68%) ⬆️
src/Vehicle/VehicleSupports.cc 58.53% <0.00%> (+33.53%) ⬆️

... and 469 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed7fb53...f2f0630. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Build Results

Platform Status

Platform Status Details
Linux Passed View
Windows Passed View
MacOS Passed View
Android Passed View

All builds passed.

Pre-commit

Check Status Details
pre-commit Failed (non-blocking) View

Pre-commit hooks: 0 passed, 0 failed, 0 skipped.

Test Results

linux-coverage-integration: 35 passed, 0 skipped
linux-coverage-unit: 111 passed, 0 skipped
Total: 146 passed, 0 skipped

Code Coverage

Coverage: 68.9%

No baseline available for comparison

Artifact Sizes

Artifact Size
QGroundControl 221.83 MB
QGroundControl-aarch64 179.44 MB
QGroundControl-installer-AMD64 137.93 MB
QGroundControl-installer-AMD64-ARM64 80.46 MB
QGroundControl-installer-ARM64 109.23 MB
QGroundControl-linux 87.11 MB
QGroundControl-mac 87.10 MB
QGroundControl-windows 86.15 MB
QGroundControl-x86_64 191.65 MB
No baseline available for comparison

Updated: 2026-07-24 21:37:19 UTC • Commit: f2f0630 • Triggered by: Android

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

I don't see how this works. You set the current sequence number to 1. But what if that is pointing to a takeoff item? To me this just requires manual control from the user. Manually pick the right point they want to restart from by clicking on the item. And start the mission. All this special stuff just seems doomed to failure.

@jnomikos

Copy link
Copy Markdown
Contributor Author

I don't see how this works. You set the current sequence number to 1. But what if that is pointing to a takeoff item? To me this just requires manual control from the user. Manually pick the right point they want to restart from by clicking on the item. And start the mission. All this special stuff just seems doomed to failure.

Good point. My current implementation is too error prone. I'll look into making it more similar to how the "set current waypoint" is done

@jnomikos
jnomikos force-pushed the dev-restart-mission branch from 06b3084 to b7b3f53 Compare May 24, 2026 18:40
@jnomikos

Copy link
Copy Markdown
Contributor Author

@DonLakeFlyer I updated the implementation so that the "Restart Mission" is a checkbox option with "Set Current Waypoint" which only shows if the vehicle firmware supports MAV_CMD_DO_SET_MISSION_CURRENT.

I also updated the PR description above

@jnomikos

Copy link
Copy Markdown
Contributor Author

Also confirmed the "Restart Mission" checkbox doesn't show on PX4 which does not support it. 👍

image

@jnomikos jnomikos changed the title Add "Restart Mission" additional guided action. Add "Restart Mission" checkbox to "Set Current Waypoint" action May 24, 2026
@DonLakeFlyer

Copy link
Copy Markdown
Contributor

I continue to not be thrilled with all of this. It all seems like an error prone hack which should be handled by the firmware side. Why isn't this a fix in the firmware so you can move the last waypoint? Isn't this working around a vehicle side problem?

@jnomikos

Copy link
Copy Markdown
Contributor Author

I continue to not be thrilled with all of this. It all seems like an error prone hack which should be handled by the firmware side. Why isn't this a fix in the firmware so you can move the last waypoint? Isn't this working around a vehicle side problem?

I initially thought this was a vehicle-side issue as well, which is why my first implementation attempted to work around it. However, I did more research, and now I don't see it as a hack or workaround for a vehicle-side bug. My understanding is that this is the intended use case of MAV_CMD_DO_SET_MISSION_CURRENT.

ArduPilot sets the mission state to MISSION_STATE_COMPLETE if you have reached the last waypoint. ArduPilot supports the newer MAV_CMD_DO_SET_MISSION_CURRENT command which explicitly has a "Reset Mission" flag which is intended to be set to true if you wish to go to a previous waypoint but the mission state is complete. PX4 does not currently support MAV_CMD_DO_SET_MISSION_CURRENT and uses MISSION_SET_CURRENT instead which does not have a "Reset Mission" flag and is less explicit about mission resetting. From the QGC perspective, the checkbox is simply exposing an existing capability provided by the firmware and MAVLink protocol rather than implementing custom restart behavior.

That said, I am open to other ideas and hearing your thoughts on it. We don't have to expose a checkbox in the UI for this.

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Ok, I understand now. I'll think some more about this when I get back in town. I'll be gone till start of July.

@DonLakeFlyer DonLakeFlyer added this to the Release V5.1 milestone Jul 6, 2026
@DonLakeFlyer

Copy link
Copy Markdown
Contributor

@jnomikos Did you test multi-rotor and fixed wing? ardupilot FW differs in a bunch of it's mission code

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Also note that even when restart mission is false ardupilot will reset jumps counters if the mission is complete when you set the new waypoint

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

After staring at this I'm still not super thrilled with the extra UI complexity but there doesn't seem to be any other decent solution. Thanks for this @jnomikos. If you've also tested with FW then I'll merge.

@jnomikos

Copy link
Copy Markdown
Contributor Author

After staring at this I'm still not super thrilled with the extra UI complexity but there doesn't seem to be any other decent solution. Thanks for this @jnomikos. If you've also tested with FW then I'll merge.

I have not tested with fixed wing yet. I'll do that

@jnomikos

Copy link
Copy Markdown
Contributor Author

After staring at this I'm still not super thrilled with the extra UI complexity but there doesn't seem to be any other decent solution. Thanks for this @jnomikos. If you've also tested with FW then I'll merge.

I'm on the same page, and I agree it makes the UI needlessly complex. The only other solution I can think of is automatically setting "restart mission" when changing current waypoint when you particularly have reached the last waypoint of a mission. But, the drawback of that is it makes the behavior of "set current waypoint" more implicit. I mentioned that idea in the original PR here: #13934 (comment).

But, now that you mention that the jump counters are always reset if you are on the last waypoint (I was not aware of that), I think the implicit solution may be more favorable, as it would not affect the user interface at all.

@rubenp02 do you have any insights?

@DonLakeFlyer

DonLakeFlyer commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

I think the implicit solution may be more favorable

I tried coding that. And ran into the fact that it means that whenever you change the waypoint the mission automatically restarts. Which isn't always expected. I tried a pile of different options and what you have was the worst of multiple evils.

@jnomikos

Copy link
Copy Markdown
Contributor Author

I think the implicit solution may be more favorable

I tried coding that. And ran into the fact that it means that whenever you change the waypoint the mission automatically restarts. Which isn't always expected. I tried a pile of different options and what you have was the worst of multiple evils.

Oh yeah good point, I forgot about that

@rubenp02

rubenp02 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Sorry, I may be a bit out of the loop on this. What would be wrong about a simple "Restart Mission" guided action? Given that this isn't strictly related to changing target waypoint. Yes, it's sometimes handy when doing that, but it can always also be done quite quickly right afterwards with an action, no? And if conditional mission logic is a concern, you can perhaps achieve what you want by doing the reset before changing the target waypoint, instead.

To me at least, this is enough of an advanced feature that I don't think it warrants any additional UI complexity or compromises in UX: It can afford to be slightly less automatic as long as the functionality itself is accessible.

Again, sorry if I'm missing anything obvious, please fill me in if that's the case.

When vehicle firmware supports restarting mission, set current waypoint
action now has a checkbox for "Restart Mission"
@jnomikos
jnomikos force-pushed the dev-restart-mission branch from b7b3f53 to f2f0630 Compare July 24, 2026 20:42
Copilot AI review requested due to automatic review settings July 24, 2026 20:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment on lines +491 to +494
if (_activeVehicle.supports.restartMission) {
confirmDialog.optionText = qsTr("Restart Mission")
confirmDialog.optionChecked = false
}
@jnomikos

Copy link
Copy Markdown
Contributor Author

@jnomikos Did you test multi-rotor and fixed wing? ardupilot FW differs in a bunch of it's mission code

@DonLakeFlyer You're right that fixed wing behaves differently. When texting with fixed wing SITL, the vehicle automatically goes into RTL mode and circles around the home position if you plot a mission without a landing sequence. When in this RTL mode, setting current waypoint with the "restart mission" checkbox does not make the vehicle automatically start flying the mission again. Instead you have to pause the mission first and then continue mission.

So, in short, with this current solution, due to differences in behavior on fixed wing, the end result is still pretty confusing. I am considering if there are any UI state updates to the guided actions controller we could make that would solve the issue on the fixed wing side without regressing copter.

fixedwingtest_muted.mp4

@jnomikos

jnomikos commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, I may be a bit out of the loop on this. What would be wrong about a simple "Restart Mission" guided action? Given that this isn't strictly related to changing target waypoint. Yes, it's sometimes handy when doing that, but it can always also be done quite quickly right afterwards with an action, no? And if conditional mission logic is a concern, you can perhaps achieve what you want by doing the reset before changing the target waypoint, instead.

To me at least, this is enough of an advanced feature that I don't think it warrants any additional UI complexity or compromises in UX: It can afford to be slightly less automatic as long as the functionality itself is accessible.

Again, sorry if I'm missing anything obvious, please fill me in if that's the case.

It was an option that was considered, and the initial direction I took this PR before modifying it. Originally, my implementation was a "Restart Mission" guided action. However, we ended up going the direction of manually choosing the point to restart to. One of the main reasons, if I recall correctly, was because the first waypoint of a mission is not always at the same index, depending on firmware.

#14345 (comment)

Honestly, I wish I could just go in and change the MAVLink spec on this. 😢

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

This is all getting ridiculously complicated.

My opinion:

  • Whatever this ends as I don't see it going into 5.1. It's too late for such insanity.
  • I'm unconvinced there is a reasonable way to fix this problem without either firmware side changes and/or spec changes

@jnomikos

Copy link
Copy Markdown
Contributor Author
* I'm unconvinced there is a reasonable way to fix this problem without either firmware side changes and/or spec changes

At this point, I agree with you and I think closing this PR is probably the best move.

I am a bit uncertain on next steps. The problem is that ArduPilot already shipped firmware using the new message with this behavior. I am thinking of adding in issue in MAVLink about this, and discussing ways we can improve it in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.