diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponent.qml b/src/AutoPilotPlugins/APM/APMSensorsComponent.qml index 05d19fb87b771d1797bea9899cdc5d01529cff6a..4d2c2596185ae1140b4ed092d40d984a3609d400 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponent.qml +++ b/src/AutoPilotPlugins/APM/APMSensorsComponent.qml @@ -170,7 +170,7 @@ SetupPage { anchors.left: parent.left anchors.right: parent.right spacing: Math.round(ScreenTools.defaultFontPixelHeight / 2) - visible: sensorParams.rgCompassAvailable[index] + visible: sensorParams.rgCompassAvailable[index] && sensorParams.rgCompassUseFact[index].value property real greenMaxThreshold: 8 * (sensorParams.rgCompassExternal[index] ? 1 : 2) property real yellowMaxThreshold: 15 * (sensorParams.rgCompassExternal[index] ? 1 : 2) diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc b/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc index b767f744e94536d59890e994483859f7cd7a8155..dbd6c164d2d54a044564ce69a8c43177a938c117 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc +++ b/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc @@ -226,7 +226,8 @@ void APMSensorsComponentController::_mavCommandResult(int vehicleId, int compone _startLogCalibration(); uint8_t compassBits = 0; - if (getParameterFact(FactSystem::defaultComponentId, QStringLiteral("COMPASS_DEV_ID"))->rawValue().toInt() > 0) { + if (getParameterFact(FactSystem::defaultComponentId, QStringLiteral("COMPASS_DEV_ID"))->rawValue().toInt() > 0 && + getParameterFact(FactSystem::defaultComponentId, QStringLiteral("COMPASS_USE"))->rawValue().toBool()) { compassBits |= 1 << 0; qCDebug(APMSensorsComponentControllerLog) << "Performing onboard compass cal for compass 1"; } else { @@ -234,7 +235,8 @@ void APMSensorsComponentController::_mavCommandResult(int vehicleId, int compone _rgCompassCalSucceeded[0] = true; _rgCompassCalFitness[0] = 0; } - if (getParameterFact(FactSystem::defaultComponentId, QStringLiteral("COMPASS_DEV_ID2"))->rawValue().toInt() > 0) { + if (getParameterFact(FactSystem::defaultComponentId, QStringLiteral("COMPASS_DEV_ID2"))->rawValue().toInt() > 0 && + getParameterFact(FactSystem::defaultComponentId, QStringLiteral("COMPASS_USE2"))->rawValue().toBool()) { compassBits |= 1 << 1; qCDebug(APMSensorsComponentControllerLog) << "Performing onboard compass cal for compass 2"; } else { @@ -242,7 +244,8 @@ void APMSensorsComponentController::_mavCommandResult(int vehicleId, int compone _rgCompassCalSucceeded[1] = true; _rgCompassCalFitness[1] = 0; } - if (getParameterFact(FactSystem::defaultComponentId, QStringLiteral("COMPASS_DEV_ID3"))->rawValue().toInt() > 0) { + if (getParameterFact(FactSystem::defaultComponentId, QStringLiteral("COMPASS_DEV_ID3"))->rawValue().toInt() > 0 && + getParameterFact(FactSystem::defaultComponentId, QStringLiteral("COMPASS_USE3"))->rawValue().toBool()) { compassBits |= 1 << 2; qCDebug(APMSensorsComponentControllerLog) << "Performing onboard compass cal for compass 3"; } else { diff --git a/src/Joystick/JoystickManager.cc b/src/Joystick/JoystickManager.cc index e32d399dba6b77162cfd98a6574e0467b0b479dd..2b1c66f3a07496d2cc2461794dc173fbd513a45c 100644 --- a/src/Joystick/JoystickManager.cc +++ b/src/Joystick/JoystickManager.cc @@ -73,7 +73,7 @@ void JoystickManager::_setActiveJoystickFromSettings(void) // Get the latest joystick mapping newMap = JoystickSDL::discover(_multiVehicleManager); #elif defined(__android__) - _name2JoystickMap = JoystickAndroid::discover(_multiVehicleManager); + newMap = JoystickAndroid::discover(_multiVehicleManager); #endif if (_activeJoystick && !newMap.contains(_activeJoystick->name())) {