Use GPS for offboard global position control FW

Hi everyone,

I am trying to make command a GPS position to a fixed-wing from offboard. For the altitude PX4 seems to be using the barometer measurements instead of GPS. I found the parameter EKF2_HGT_MODE and set it to GPS:1, which I hoped would change the feedback to the control to mainly use GPS. The description of the param says “Determines the primary source of height data used by the EKF”. I also double-checked the parameter through mavros and it was set correctly. However, when I set the parameter, the control still seems to follow the barometer altitude estimate, which is quite off from GPS. I tried it in simulation starting the fixed-wing plane, sending global position commands and switching to OFFBOARD mode. Result, see image.

Is there a different param that I have to set, to make offboard global position control use GPS? Why does the position control not use the global position estimate in the first place?

Thanks for your help!

Does nobody know how to control position to the (RTK) GPS altitude instead of the pressure sensor?

I’m still stuck with the same issue. I will try to reformulate, maybe that helps.

Goal
I want to command the plane from offboard to fly to a certain GPS position (longitude, latitude, altitude) that I get on my RTK GPS setup.

Problem
The plane (real & simulation) flies to an altitude based on the pressure sensor (vfr_hud/altitude/monotonic, see here). I want it to fly to the altitude I get from the RTK GPS, which is more reliable between flights and days.

Questions
Can i command the plane to a global GPS position (including GPS altitude) from offboard? Is there a parameter that I have to change that I am missing?

Hi.
Which version of PX4 are you using?
If you are using LPE, you can turn off barometer in LPE_FUSION.
It normally used for MOCAP, but it might work for you.

I am using PX4 v1.10 with EKF2. Looking at the estimator documentation, I saw that LPE does not estimate the wind sadly. For our application, we rely on that estimate. I will give it a try anyway, just to see if it helps. Thanks for the tip. Do you have another idea of how to make it work with EKF2?