I have a Raspberry Pi where I run Visual Inertial Odometry (VIO) and obtain X, Y, and Z position data.
However, on the PX4 system, I already have a distance sensor installed and I prefer to rely on it for altitude (Z-axis).
So I don’t want to send the Z value from VIO to PX4.
My goal is to feed only the local X and Y position to PX4.
This way, I can provide position estimation without using GPS or optical flow and enable position control.
In this scenario, I would appreciate your suggestions on:
Which MAVLink message is suitable for sending only X and Y position?
Will omitting or fixing the Z value affect PX4’s stability?
I would feed it in and then assess what the EKF actually does before trying to change things. Then, you might have to check how/where the EKF reads in all the values and once you understand that code, you can change it in a way that it suits your data.
I tested UWB indoor positioning on a drone. As a PX4 beginner, I avoided modifying the PX4 source code by using the UWB module’s NMEA output to simulate GNSS data. This approach worked well in actual flight tests.
However, there are some important considerations when using this method:
EKF2_GPS_CTRL: Be cautious in selecting reliable data outputs (I only used latitude and longitude). If other data such as velocity or heading is unreliable, it’s recommended to disable GPS fusion for those fields.
EKF2_HGT_REF: Avoid selecting GPS as the height reference unless the computed altitude data is highly reliable.