Confused with guided mode in QGroundControl using mavlink v2 protocol

#1

Hello everyone.
Sorry for my poor English.

I’m working on a custom autopilot for quadrotor, which uses mavlink protocol to communicate with GCS. I would like to use free GCS and decided to try QGroundControl.
I’ve managed to pass telemetry parameters from my autopilot to QGroundControl, but failed with mission start.

I passed all mission items to my autopilot from QGroundControl, but when tried to start mission from GCS using slider, I’ve seen error message “Guided mode not supported by vehicle”.

In heartbeat message from autopilot to QGroundControl I set parameter “base_mode” to “MAV_MODE_FLAG_GUIDED_ENABLED | MAV_MODE_FLAG_SAFETY_ARMED” and parameter “autopilot” to “MAV_AUTOPILOT_GENERIC”, but it doesn’t help.

  1. Passing mission items from GCS to autopilot - success:

  1. Try to start mission:

  1. Error message in the top:

In the source code of QGroundControl I’ve found class Vehicle with method called “guidedModeSupported” in file Vehicle.cc:

bool Vehicle::guidedModeSupported(void) const
{
    return _firmwarePlugin->isCapable(this, FirmwarePlugin::GuidedModeCapability);
}

Here will be called method isCapable from base class FirmwarePlugin or from one of the inherited classes APMFirmwarePlugin or PX4FirmwarePlugin.

But what if my autopilot is neither ArduPilot nor PX4? If I’m right, will be called isCapable from base class FirmwarePlugin :

bool FirmwarePlugin::isCapable(const Vehicle *vehicle, FirmwareCapabilities capabilities)
{
    Q_UNUSED(vehicle);
    Q_UNUSED(capabilities);
    return false;
}

This method will return false. And GCS will show error.
For example, here is method isCapable from class APMFirmwarePlugin:

bool APMFirmwarePlugin::isCapable(const Vehicle* vehicle, FirmwareCapabilities capabilities)
{
    uint32_t available = SetFlightModeCapability | PauseVehicleCapability | GuidedModeCapability;
    if (vehicle->multiRotor()) {
        available |= TakeoffVehicleCapability;
    } else if (vehicle->vtol()) {
        available |= TakeoffVehicleCapability;
    }

    return (capabilities & available) == capabilities;
}

So, can someone tell me, am I right that my problem caused by these methods? Or I simply forgot to set appripriate parameters in my autopilot?

Thank You

1 Like
#2

Did you ever figure this out? I saw the same problem.