qgroundcontrol icon indicating copy to clipboard operation
qgroundcontrol copied to clipboard

The latest QGroundControl and the latest PX4 firmware parameters do not match.

Open dagouxiong233 opened this issue 2 years ago • 13 comments

Current Behavior

1:FW_ARSP_MODE, 1:CBRK_AIRSPD_CHK image

System Information

  • Operating System: ubuntu and windows
  • QGC Version: v4.3.0
  • Flight Controller:V2.4.8
  • Autopilot (with version): PX4 [Stable Release v1.14.0]

dagouxiong233 avatar Mar 14 '24 02:03 dagouxiong233

In the latest version of the PX4 firmware, there have been changes to some parameters. The parameter FW_ARSP_MODE has been renamed to FW_USE_AIRSPD, and the CBRK_AIRSPD_CHK parameter has been replaced with SYS_HAS_NUM_ASPD. For operations without an airspeed sensor, you would set SYS_HAS_NUM_ASPD to 0. Similarly, if you do not wish to use the airspeed sensor data in the controller, you would set FW_USE_AIRSPD to 0​

dagouxiong233 avatar Mar 14 '24 02:03 dagouxiong233

https://docs.px4.io/main/en/releases/main.html

dagouxiong233 avatar Mar 14 '24 02:03 dagouxiong233

This is going to require version check on parameter access for forward/back compatibility

DonLakeFlyer avatar Apr 05 '24 17:04 DonLakeFlyer

QGC shouldn't have to worry about FW_USE_AIRSPD. What is the info you need to have in QGC, is it whether there is an airspeed sensor present on the vehicle that needs calibration? How do we do it for the other senors (accel, gyro, mag), do we just assume at least one of each is always present? SYS_HAS_NUM_ASPD could be used for that, but can we also consider relying on mavlink instead? Ideally there would be a message from the autopilot about which sensors are present (or, even better, which ones require calibration). For the meantime, there are already existing mavlink messages that can be checked to see if there is any airspeed sensor present at all, e.g. SCALED_PRESSURE has a differential pressure field, or the airspeed field of VFR_HUD.

sfuhrer avatar Apr 08 '24 07:04 sfuhrer

What is the info you need to have in QGC, is it whether there is an airspeed sensor present on the vehicle that needs calibration?

Correct.

For the meantime, there are already existing mavlink messages that can be checked to see if there is any airspeed sensor present at all, e.g. SCALED_PRESSURE has a differential pressure field, or the airspeed field of VFR_HUD.

But what happens if the airspeed sensor hasn't been calibrated yet. Will that still work?

DonLakeFlyer avatar Apr 08 '24 14:04 DonLakeFlyer

But what happens if the airspeed sensor hasn't been calibrated yet. Will that still work?

Currently yes, though we're working on enabling multi airspeed sensors which would then require an adapted workflow in QGC again. @dagar have you already given this some thoughts?

@DonLakeFlyer what do you do for the Mag calibration in QGC to figure out when to display it as "mag needs calibration"?

sfuhrer avatar Apr 11 '24 09:04 sfuhrer

Hi guys, I'm trying to build a bootloader and a firmware for Matek H743-WING v3 (using make matek_h743_bootloader and make matek_h743_default from the latest release 1.14). After I upload it to the FC, I see those messages in QGC image I tried to disable AirSpeed sensor by disabling parameters image and image I tried with VTOL and standard plane with no luck.

Due to this issue I can't calibrate AirFlow sensor - it just fails and I can't also disable it completely. Also I can't Arm the vehicle, because preflight checks are not passed: image image image [16:49:07.451] Critical: Arming denied: Resolve system health failures first

Could you pls let me know how to fix the issue either without AirFlow sensor (I was up to use Matek ASPD4525) or to make that one work? Thanks in advance.

DenysZaytsev avatar Apr 30 '24 13:04 DenysZaytsev

what do you do for the Mag calibration in QGC to figure out when to display it as "mag needs calibration"?

@sfuhrer

    _deviceIds = QStringList({QStringLiteral("CAL_GYRO0_ID"), QStringLiteral("CAL_ACC0_ID") });

const char* SensorsComponent::_airspeedBreakerParam =   "CBRK_AIRSPD_CHK";
const char* SensorsComponent::_airspeedDisabledParam =  "FW_ARSP_MODE";
const char* SensorsComponent::_airspeedCalParam =       "SENS_DPRES_OFF";

const char* SensorsComponent::_magEnabledParam =  "SYS_HAS_MAG";
const char* SensorsComponent::_magCalParam =  "CAL_MAG0_ID";

bool SensorsComponent::setupComplete(void) const
{
    foreach (const QString &triggerParam, _deviceIds) {
        if (_vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, triggerParam)->rawValue().toFloat() == 0.0f) {
            return false;
        }
    }
    bool magEnabled = true;
    if (_vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, _magEnabledParam)) {
        magEnabled = _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, _magEnabledParam)->rawValue().toBool();
    }

    if (magEnabled && _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, _magCalParam)->rawValue().toFloat() == 0.0f) {
        return false;
    }

    if (_vehicle->fixedWing() || _vehicle->vtol() || _vehicle->airship()) {
        if (!_vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, _airspeedDisabledParam)->rawValue().toBool() &&
                _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, _airspeedBreakerParam)->rawValue().toInt() != 162128 &&
                _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, _airspeedCalParam)->rawValue().toFloat() == 0.0f) {
            return false;
        }
    }

    return true;
}

DonLakeFlyer avatar Apr 30 '24 18:04 DonLakeFlyer

@dagouxiong233 @sfuhrer Can you both review the changes in QGC to makes sure I have this version specific handling correct? Specifically these two methods:

  • bool SensorsComponent::_airspeedCalSupported (void) const
  • bool SensorsComponent::_airspeedCalRequired (void) const

DonLakeFlyer avatar Apr 30 '24 19:04 DonLakeFlyer

@DenysZaytsev Once CI finishes can you test this? You can pull the install artifacts from the GitHub Actions.

DonLakeFlyer avatar Apr 30 '24 19:04 DonLakeFlyer

@DenysZaytsev Once CI finishes can you test this? You can pull the install artifacts from the GitHub Actions.

Yes, I can test with Matek ASPD4525 So far I just compiled from release branch 1.14 (previously I was compiling from the main branch) and there are no errors in QGC (cause no changes yet been made in that release), but AirSpeed calibration still doesn't work, however at least I disabled it completely and now can arm.

DenysZaytsev avatar Apr 30 '24 19:04 DenysZaytsev

@DenysZaytsev Builds are ready. What OS do you use? I can point you to the install.

DonLakeFlyer avatar May 01 '24 17:05 DonLakeFlyer

@DonLakeFlyer I've commented on the PR. Thanks a lot for addressing it! As you use already use SYS_HAS_MAG for checking if a mag cal is needed I would do it the same way for airspeed and simply check SYS_HAS_NUM_ASPD, not also FW_USE_AIRSPD.

sfuhrer avatar May 23 '24 12:05 sfuhrer