Skip to content

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

Open
jnomikos wants to merge 1 commit into
mavlink:masterfrom
jnomikos:dev-restart-mission
Open

Add "Restart Mission" checkbox to "Set Current Waypoint" action#14345
jnomikos wants to merge 1 commit into
mavlink:masterfrom
jnomikos:dev-restart-mission

Conversation

@jnomikos
Copy link
Copy Markdown
Contributor

@jnomikos jnomikos commented May 8, 2026

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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@7ff70ef). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/Vehicle/VehicleSupports.cc 0.00% 5 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          ?   26.45%           
=========================================
  Files             ?      767           
  Lines             ?    66290           
  Branches          ?    30668           
=========================================
  Hits              ?    17540           
  Misses            ?    36292           
  Partials          ?    12458           
Flag Coverage Δ
unittests 26.45% <0.00%> (?)

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

Files with missing lines Coverage Δ
src/Vehicle/Vehicle.cc 21.18% <ø> (ø)
src/Vehicle/Vehicle.h 40.62% <ø> (ø)
src/Vehicle/VehicleSupports.cc 26.82% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

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: 2 passed, 42 failed, 7 skipped.

Test Results

linux-coverage: 88 passed, 0 skipped
Total: 88 passed, 0 skipped

Code Coverage

Coverage Baseline Change
60.4% 60.4% -0.0%

Artifact Sizes

Artifact Size Δ from master
QGroundControl 216.77 MB -4.61 MB (decrease)
QGroundControl-aarch64 176.65 MB -0.02 MB (decrease)
QGroundControl-installer-AMD64 134.66 MB -0.02 MB (decrease)
QGroundControl-installer-AMD64-ARM64 77.50 MB +0.01 MB (increase)
QGroundControl-installer-ARM64 106.03 MB -0.00 MB (decrease)
QGroundControl-linux 186.86 MB -147.82 MB (decrease)
QGroundControl-mac 186.86 MB No change
QGroundControl-windows 186.87 MB No change
QGroundControl-x86_64 172.32 MB +0.01 MB (increase)
Total size decreased by 152.46 MB

Updated: 2026-05-24 19:31:05 UTC • Triggered by: Linux

@DonLakeFlyer
Copy link
Copy Markdown
Collaborator

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

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 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
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.

3 participants