Browse Source

Don't query fence/rally on high latency links (#9262)

QGC4.4
Don Gagne 4 years ago committed by GitHub
parent
commit
4bcaa8b83b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 45
      src/Vehicle/InitialConnectStateMachine.cc

45
src/Vehicle/InitialConnectStateMachine.cc

@ -293,13 +293,26 @@ void InitialConnectStateMachine::_stateRequestGeoFence(StateMachine* stateMachin @@ -293,13 +293,26 @@ void InitialConnectStateMachine::_stateRequestGeoFence(StateMachine* stateMachin
{
InitialConnectStateMachine* connectMachine = static_cast<InitialConnectStateMachine*>(stateMachine);
Vehicle* vehicle = connectMachine->_vehicle;
WeakLinkInterfacePtr weakLink = vehicle->vehicleLinkManager()->primaryLink();
qCDebug(InitialConnectStateMachineLog) << "_stateRequestGeoFence";
if (vehicle->_geoFenceManager->supported()) {
vehicle->_geoFenceManager->loadFromVehicle();
if (weakLink.expired()) {
qCDebug(InitialConnectStateMachineLog) << "_stateRequestGeoFence: Skipping first geofence load request due to no primary link";
connectMachine->advance();
} else {
qCDebug(InitialConnectStateMachineLog) << "_stateRequestGeoFence: skipped due to no support";
vehicle->_firstGeoFenceLoadComplete();
SharedLinkInterfacePtr sharedLink = weakLink.lock();
if (sharedLink->linkConfiguration()->isHighLatency() || sharedLink->isPX4Flow() || sharedLink->isLogReplay()) {
qCDebug(InitialConnectStateMachineLog) << "_stateRequestGeoFence: Skipping first geofence load request due to link type";
vehicle->_firstGeoFenceLoadComplete();
} else {
if (vehicle->_geoFenceManager->supported()) {
qCDebug(InitialConnectStateMachineLog) << "_stateRequestGeoFence";
vehicle->_geoFenceManager->loadFromVehicle();
} else {
qCDebug(InitialConnectStateMachineLog) << "_stateRequestGeoFence: skipped due to no support";
vehicle->_firstGeoFenceLoadComplete();
}
}
}
}
@ -307,13 +320,25 @@ void InitialConnectStateMachine::_stateRequestRallyPoints(StateMachine* stateMac @@ -307,13 +320,25 @@ void InitialConnectStateMachine::_stateRequestRallyPoints(StateMachine* stateMac
{
InitialConnectStateMachine* connectMachine = static_cast<InitialConnectStateMachine*>(stateMachine);
Vehicle* vehicle = connectMachine->_vehicle;
WeakLinkInterfacePtr weakLink = vehicle->vehicleLinkManager()->primaryLink();
qCDebug(InitialConnectStateMachineLog) << "_stateRequestRallyPoints";
if (vehicle->_rallyPointManager->supported()) {
vehicle->_rallyPointManager->loadFromVehicle();
if (weakLink.expired()) {
qCDebug(InitialConnectStateMachineLog) << "_stateRequestRallyPoints: Skipping first rally point load request due to no primary link";
connectMachine->advance();
} else {
qCDebug(InitialConnectStateMachineLog) << "_stateRequestRallyPoints: skipping due to no support";
vehicle->_firstRallyPointLoadComplete();
SharedLinkInterfacePtr sharedLink = weakLink.lock();
if (sharedLink->linkConfiguration()->isHighLatency() || sharedLink->isPX4Flow() || sharedLink->isLogReplay()) {
qCDebug(InitialConnectStateMachineLog) << "_stateRequestRallyPoints: Skipping first rally point load request due to link type";
vehicle->_firstRallyPointLoadComplete();
} else {
if (vehicle->_rallyPointManager->supported()) {
vehicle->_rallyPointManager->loadFromVehicle();
} else {
qCDebug(InitialConnectStateMachineLog) << "_stateRequestRallyPoints: skipping due to no support";
vehicle->_firstRallyPointLoadComplete();
}
}
}
}

Loading…
Cancel
Save