Inject position data to PX4


We would like to inject lat, lon and alt in PX4 but GPS_INPUT does not work.
GPS2_RAW neither.
For GPS_INPUT our setup are correct except both time_week_ms and time_week.
We set fix_type at 5 (RTK) because our system’s precision is better than GPS.

How to inject position correction data in PX4?
Can we override GPS data with mavlink messages?

Thanks for your time

What about HIL_GPS? I recall with EKF2 you can enable MAV_USEHILGPS and fake GPS data with it.

@wifibot PX4 does not support GPS_INPUT. You have to use HIL_GPS and set MAV_USEHILGPS param as @broody said.

1 Like

Thanks for your responses

We have to use both inboard GPS and fake GPS value at different moment of flight.
The UAV doesn’t react to HIL_GPS (maybe because the other GPS has more weight).

However we have already put the HIL_GPS fix type at its maximum value (MAV_USEHILGPS is set to 1)

If you have both, then you should use MOCAP or VISION topics.