Skip to content

Commit

Permalink
mavlink_mission: restore old sequence number when a new mission is in…
Browse files Browse the repository at this point in the history
…feasible
  • Loading branch information
Igor-Misic committed Sep 17, 2021
1 parent fdb2625 commit 11fb67c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/mavlink/mavlink_mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,12 @@ MavlinkMissionManager::send()

if (_mission_result_sub.update(&mission_result)) {

/* If an infeasible mission is uploaded and the old feasible mission exists item count could be wrong.
* This is restoring item count from the feasible mission. */
if (_count[MAV_MISSION_TYPE_MISSION] != mission_result.seq_total) {
_count[MAV_MISSION_TYPE_MISSION] = mission_result.seq_total;
}

if (_current_seq != mission_result.seq_current) {
_current_seq = mission_result.seq_current;

Expand Down

0 comments on commit 11fb67c

Please sign in to comment.