How does px4 calculate LPOS?

Hi everyone, I have a quick question that googling can’t answer:

How does px4 calculate the LPOS log parameters? i.e. LPOS_X and LPOS_VX etc.
Does it use a combination of Accelerometers, GPS and optical flow? Or only some of those?

I ask because I am doing a series of flight tests with different configurations and I require very accurate speed measurements as I want to find out which config has the lowest drag. I am using px4tools to analyse the onboard .px4log files.

Also, how can I see the velocity measurements from only the optical flow camera?

Thanks in advance,

The estimator will use all of the sensors you mentioned if they are available. Depending on the parameter SYS_MC_EST_GROUP, different estimators will be used but they all have the capabilities to fuse GPS, flow, and IMU data.

I personally doubt that you will see data accurate enough to make statements about drag, although I don’t know how different your configurations are. A motion capture system would probably give you the best chance at capturing that data.

To get velocity estimates only from flow, to options come to mind:

  1. Fly without GPS, s.t. the estimator only has flow to estimate velocity
  2. Log/stream the flow messages and from that compute a velocity estimate externally

I have a somewhat related question. What is the difference between LPOS and GPOS? I know that one is local and one is global. But I don’t see where the difference is in the data.

I have the same question. What is the difference between LPOS and GPOS? I hope someone could clarify this.

X and VX are outputs from estimator modules you choose.
For example, you have optical flow and you use LPE, then the algorithm would give you velocity and position based on the result from the optical flow module. Although the module may only measure distance, it would estimate velocity since the velocity and position are related, vice versa.
I agree with Nicolas, that drag may not be a good way to judge the data quality.
For LPOS and GPOS, LPOS’s origin is (0,0,0) where the drone started, while GPOS is the coordinates of latitude, longitude and altitude according to WGS84 system. The topic files would be more clear.

Thanks, that makes sense. It seems a little redundant to log both LPOS and GPOS since LPOS can easily be calculated from GPOS.

Awesome, thanks for your help, everyone!
Is there a way to tell if the flow sensor is actually working without before flying and checking the logs? I’m looking for something in Qgroundcontrol about flow, but I can’t find anything