fix(mavlink): reset mission sequence on platform restart#27045
Open
fix(mavlink): reset mission sequence on platform restart#27045
Conversation
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 72 byte (0 %)]px4_fmu-v6x [Total VM Diff: 64 byte (0 %)]Updated: 2026-04-10T12:35:24 |
Contributor
|
Have you considered the possibility of the device rebooting mid-mission? Would this lead to undesired behavior? |
Contributor
Author
After a reboot the device would be in a non-mission flight mode, disarmed state, no immediate auto continuation of the mission etc. There's a trade-off between safety and shortcuts. I think more intuitive is a fresh mission start rather than resuming a stale waypoint from the previous session. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solved Problem
Fixes #14981
After a platform reboot, PX4 could restore the previously persisted
mission_state.current_seqfrom Dataman and continue reporting the old active mission item. As a result, the vehicle could resume a stale waypoint from the previous run, for example a landing waypoint, instead of starting the mission again from the first waypoint.Solution
Reset the persisted
mission_state.current_seqto0duringMavlinkMissionManagerinitialization on startup, before the mission state is republished.This keeps the uploaded mission itself intact:
With this change, after a reboot the platform starts with the same mission, but with the current mission item reset to the first waypoint.
Changelog Entry
For release notes: