What is the mavlink message that contains the failsafe information and is sent from the firmware to QGC?

I am looking for the mavlink message containing the failsafe information passed from the firmware to QGC.


< Figure1 > Set Low Battery Failsafe Trigger in Vehicle Setup of QGC and check failsafe operation with PX4_SITL gazebo simulation.

At first, I guessed that QGC pops up that warning message and returns the aircraft to handle failsafe

(Which class of QGC handles failsafe(Low battery and RC Loss)?), so I searched for “Failsafe activated …” in QGC files, but couldn’t find it.

(The popup window only found what was defined in the src > ui > MainRootWindw.qml file. However, I don’t know yet which path the text is delivered to that popup window.)

You can’t find it because it doesn’t exist. The firmware handles failsafe. In general QGC is just either a vehicle setup tool or a telemetry display tool. It doesn’t do much to actively control the vehicle. Except for simple things like say changing a flight mode through user interaction.
said by Don Gagne 2022.11.14

According to the answer obtained from the DronecodeFoundation’s discord channel, that text is sent from Firmware, not QGC.


< Figure2 > code to send the text “Failsafe activated due to …” to QGC?

Indeed, I was able to find “Failsafe activated due to …” text in one of the FIRMWARE files.
I looked at the Firmware code for about 1 minute for the first time today, and I can only assume that somewhere here, the mavlink message containing the failsafe information and text will be packaged and sent to QGC.


< Figure3 > failsafe included in HIGH_LATENCY mavlink message

https://mavlink.io/en/messages/common.html#HIGH_LATENCY

There was only one mavlink message with a failsafe field. I guess this message contains failsafe information. (but I can’t guess what the name of the message means)


< Figure 4 > qDebug( ) print for Debugging to find failsafe messages

I expect that when Low Battery FailSafe occurs in PX4_SITL simulation, a mavlink message with MAVLINK_MSG_ID_HIGH_LATENCY id will come into QGC.
I put the qDebug() output code to check it, but contrary to my expectations, it did not enter this conditional statement even though low battery failsafe worked. (I don’t know other debugging methods due to lack of debugging experience)
When the firmware activates failsafe and sends that situation to QGC, does it send some other kind of message instead of sending the HIGH_LATENCY message (which is supposed to contain the failsafe information)?


< Figure 5 > MAVLINK_MSG_ID table
ref) Messages (common) · MAVLink Developer Guide &
https://groups.google.com/g/mavlink/c/1zgHUM67E-A?pli=1

If all messages from Firmware to QGC are in the table above (I wonder if all those messages are actually used) and if a message other than HIGH_LATENCY is used to signal a failsafe situation, which of these messages is it?