mavlink / qgroundcontrol

Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)
http://qgroundcontrol.io
3.31k stars 3.63k forks source link

Quick Flight mode change cause error since 4.3 versions #11844

Open maxsky17 opened 2 months ago

maxsky17 commented 2 months ago

Expected Behavior

With previous version <= 4.2.9, we can switch quickly between different flight mode without issue.

Current Behavior

Since 4.3, switching quickly between different flight mode cause this error : Unable to send command : Waiting on previous response to same command Vehicle did not respond to command MAV_CMD_DO_SET_MODE

Steps to Reproduce:

switch quickly between different flight mode (<1 second)

System Information

When posting bug reports, include the following information

Detailed Description

Since 4.3, switching quickly between different flight mode cause this error : Unable to send command : Waiting on previous response to same command Vehicle did not respond to command MAV_CMD_DO_SET_MODE

Some changes have been made on 4.3 :

// We can't send commands to compIdAll using this method. The reason being that we would get responses back possibly from multiple components
    // which this code can't handle.
    // We also can't send the majority of commands again if we are already waiting for a response from that same command. If we did that we would not be able to discern
    // which ack was associated with which command.
    if ((targetCompId == MAV_COMP_ID_ALL) || (isMavCommandPending(targetCompId, command) && !_commandCanBeDuplicated(command))) {
DonLakeFlyer commented 2 months ago

This is correct behavior. Most likely caused by the fact that you are running an older Ardupilot firmware which does not support MAV_CMD_DO_SET_MODE. This causes that command to timeout and then fall back to doing it the old way using the SET_MODE message. Are you not using latest Ardupilot firmware?

maxsky17 commented 2 months ago

hi, if I switch slower (>1sec), it works fine. I've tested with some ardupilot with no difference (4.2.2,4.4.2 ...) If I downgrade QGC to 4.2.9 it works fine too.

I've this issue only when I'm using QGC in versions >= 4.3.0