Skip to content

Allow mission jump counters to be reset without changing waypoint#32722

Merged
peterbarker merged 4 commits intoArduPilot:masterfrom
peterbarker:pr/MAV_CMD_DO_SET_MISSION_CURRENT-fixes
Apr 15, 2026
Merged

Allow mission jump counters to be reset without changing waypoint#32722
peterbarker merged 4 commits intoArduPilot:masterfrom
peterbarker:pr/MAV_CMD_DO_SET_MISSION_CURRENT-fixes

Conversation

@peterbarker
Copy link
Copy Markdown
Contributor

Summary

Allows resetting the jump counters without resetting the current waypoint.

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Description

Previously it wasn't possible to reset the jump counters without also setting the waypoint, meaning you're stuck with a race condition.

This understands new meanings given in the mavlink message where "-1" for your waypoint number means "ignore".

ArduPilot MAVLink PR is here: ArduPilot/mavlink#498

 - fixes integer truncation bugs which would have param1=INT16+1 load seq=1
 - adds support for passing in -1 as the index number meaning don't-change seq but may allow for resetting the mission state

We would cast uint32_t(-1) into a uint16_t when passing into is_valid_index....
const uint32_t seq = (uint32_t)packet.param1;
if (!mission->is_valid_index(seq)) {
return MAV_RESULT_FAILED;
if (packet.param1 >= 0) {
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.

check for exactly -1?

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.

Done

@tridge
Copy link
Copy Markdown
Contributor

tridge commented Apr 14, 2026

can be merged with the -1 check

@peterbarker peterbarker force-pushed the pr/MAV_CMD_DO_SET_MISSION_CURRENT-fixes branch from e8e83ef to 8a50dcc Compare April 14, 2026 01:29
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Apr 14, 2026
@peterbarker peterbarker merged commit 65ab42c into ArduPilot:master Apr 15, 2026
113 of 115 checks passed
@github-project-automation github-project-automation bot moved this from ReadyForDevCall to Done in Peter's ArduPilot 4.8 Queue Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants