Browse Source

Merge pull request #6718 from DonLakeFlyer/ArduPilotMission

ArduPilot: Deal with seemingly incorrect protocol support of MAV_MISSION_INVALID_SEQUENCE
QGC4.4
Don Gagne 7 years ago committed by GitHub
parent
commit
fcc884e7ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/MissionManager/PlanManager.cc
  2. 2
      src/MissionManager/PlanManager.h

8
src/MissionManager/PlanManager.cc

@ -589,6 +589,14 @@ void PlanManager::_handleMissionAck(const mavlink_message_t& message) @@ -589,6 +589,14 @@ void PlanManager::_handleMissionAck(const mavlink_message_t& message)
return;
}
if (_vehicle->apmFirmware() && missionAck.type == MAV_MISSION_INVALID_SEQUENCE) {
// ArduPilot sends these Acks which can happen just due to noisy links causing duplicated requests being responded to.
// As far as I'm concerned this is incorrect protocol implementation but we need to deal with it anyway. So we just
// ignore it and if things really go haywire the timeouts will fire to fail the overall transaction.
qCDebug(PlanManagerLog) << QStringLiteral("_handleMissionAck ArduPilot sending possibly bogus MAV_MISSION_INVALID_SEQUENCE").arg(_planTypeString()) << _planType;
return;
}
// Save the retry ack before calling _checkForExpectedAck since we'll need it to determine what
// type of a protocol sequence we are in.
AckType_t savedExpectedAck = _expectedAck;

2
src/MissionManager/PlanManager.h

@ -71,7 +71,7 @@ public: @@ -71,7 +71,7 @@ public:
// These values are public so the unit test can set appropriate signal wait times
// When passively waiting for a mission process, use a longer timeout.
static const int _ackTimeoutMilliseconds = 1000;
static const int _ackTimeoutMilliseconds = 1500;
// When actively retrying to request mission items, use a shorter timeout instead.
static const int _retryTimeoutMilliseconds = 250;
static const int _maxRetryCount = 5;

Loading…
Cancel
Save