Takeoff without heading estimate

Hi there,

I would like for my drone to takeoff in very bad on ground magnetic conditions (from a metal plate for instance).

The thing is that for the initialization of the EKF, a yaw estimate is needed. Furthermore, there only is one RTK GPS on the drone (so no dual antenna heading) and external vision isn’t possible.

Is there a way I can for example set manually a heading value for the takeoff ?

I’m going to tag @bresch here to see if he has an answer or link to the docs.

Hi @cdbck ,

Unfortunately I don’t think we have this option implemented. What you could however do is to takeoff in altitude mode. The yaw will then automatically align whenever possible and the GNSS fusion will start.
If you want to align before takeoff, there is also the possibility to move the drone after boot. If there is enough acceleration and a good enough GNSS lock, the yaw estimator will be able to align the navigation filter.

If both of those things are not possible for you, you could make a mavlink command to send a heading measurement, add the GUI part in QGC and I could help you do do the receiving end in PX4.

Hope that helped.

1 Like

Thank you for your answer @bresch

Yes, the ideal solution would be to send a heading measurement using a mavlink command.

It would be great if you could help me with the receiving end, or at least give me indications on how to do it.

Thank you for your help.

1 Like

You could do something similar to the external position reset command: PX4-Autopilot/src/modules/ekf2/EKF2.cpp at bfb04ddd19c4b35e5f5d671403a6f50371c4a87c · PX4/PX4-Autopilot · GitHub

1 Like

Sounds like you might be dealing with the issues of launching from the deck of a ship. If this is the case, I might be able to help. I had to deal with this problem on the Piccolo autopilot when we started doing VTOL from ships. As you guessed, the mag needs to be disabled until you’re at least 10m above the deck. Alternatively (as you mentioned) dual RTK is an option RTK GPS Heading with Dual u-blox F9P | PX4 Guide (main) .

From what I know of PX4, disabling the mag (and feeding it back in safely) requires a firmware change which shouldn’t be too difficult. I may not be able to do it but I know two groups who can.