MAVLink Heartbeat from the GCS

Hi,

I’m currently developing a ground station to control my UAV in a GPS denied environment.

I need to ensure a failsafe is triggered when comms to my GCS is lost. From what I can gather the APM is set up to perfectly handle this if a loss of Heartbeat is detected.

What I can’t figure out is how to complete the message for the Heartbeat on the GCS side.

My HB message for the GCS so far is as such:
type = 6 (Operator Control Unit / GCS)
autopilot = 8 (No valid autopilot; e.g. a GCS)
base mode = [color=#FF0000]No idea what state the GCS should be in?[/color]
custom mode = 0
system status = [color=#FF0000]No idea again? should this be standby?[/color]
mavlink version = [color=#FF0000]Don’t understand where to even find this?[/color]

I’m writing LabVIEW drivers for this GCS so I need to know this information on byte level with reference to the packet that gets sent.

Any one have any idea?

Look at the source code for APM_planner on github.com/diydrones see uas.h/cc or MAVProxy

I couldn’t decipher the C++ code to understand exactly what bytes it send for system mode and base mode? My understanding of the magic byte is if I set it to “3” then it should work.

For Ardupilot it ignores the actual state. The logic triggers when there is an absence of the GCS heartbeat message for 5seconds

So I got the hearbeat working by setting the following values:

Magic MAVLink U8 = 3
Type = 6
Autopilot = 8
Everything else = 0

When I shut my GS off, the drone landed.