mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 14:30:34 +08:00
mavlink_mission: restore old sequence number when a new mission is infeasible
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user