Fake GPS Data with Pixhawk6C

Hi Everyone,
I’m trying to send fake gps data, taken from DWM1001-dev for indoor positioning. I’ve send all data to my pixhawk 6c with pymavlink method gps_input_send().

lat = int(latitude * 1e7) # Deg E7
lon = int(longitude * 1e7) # Deg E7
alt = int(altitude * 1000)

gps_id = int(1)
fix_type = int(3)
satellites_visible = int(16)
ignore_flags = int(249)

hdop = int(0.6)
vdop = int(0.6)
vn = int(0)
ve = int(0)
vd = int(0)
speed_accuracy = int(0.1)
horiz_accuracy = int(1.0)
vert_accuracy = int(1.0)
yaw = int(0)
time_usec = rospy.Time.now()
time_sec = int(time_usec.secs *1e6 + time_usec.nsecs / 1000)

try:
    master.mav.gps_input_send(
        time_sec,
        gps_id,
        ignore_flags,  
        time_week_ms,
        time_week,
        fix_type,
        lat,                  
        lon,                   
        alt,                   
        hdop,                  
        vdop,                 
        vn,                     
        ve,                     
        vd,                    
        speed_accuracy,       
        horiz_accuracy,         
        vert_accuracy,          
        satellites_visible,    
        yaw                  
    )....

Next i checked if the publish rate in mission planner was 5Hz, and it was fine.
When i run the code, i get the 3d fix but i can’t arm because the altitude isn’t configure correctly, but i’m sure that i’ve set it correctly.

What i’m wrong?
Thank to everyone that will help me.

Hm, on your screen is shown that you have a battery failure and this is not allowing to arm.
Normally hight is take from baro as main source

If i plug the lipo battery the error is the same.

Which error is the same, the battery failsafe?
If you don’t provide clear information everything is just a guessing game.
Why you don’t show your any logs?

Sorry, the same error is related to: “field elevation set: 0”. I don’t understand why the FC correctly set the x and y position from the dwm1001-dev, but z no (which obviously comes from the uwb board).
I specify that all position coordinates are sent correctly. I only convert them from local to global.

With this error it’s not possible to arm.

No, “field elevation set: 0” is not an error only a message and has nothing to do with arming or not.
Normally the hight is based on the barometer. But as the barometer value depends on different external influence it is always “zeroed” if the drone is on ground.

Yes thank you, when i was testing i saw that is normal.