LPE with optical flow rejects position control

I managed to build firmware branch https://github.com/PX4/Firmware/tree/crazyflie_optflow
for crazyflie board.
The drone is equipped with pmw3901 optical flow sensor for indoor position control.
Position control has been working with ekf2 estimator however experience toilet bowl effect due to bad magnetomer reading.
So I decided to give it a try using local position estimator(lpe).

Below is the parameter I set.

In nsh I checked local position estimator running.

Optical flow direction is set as below
fwd: +y, bwd: -y, left: +y, right -y

I see orb_message LOCAL_POSITION_NED is outputting data but not according to its movements.
I think this is the reason why lpe rejects position control.

It would be great if I can get flight logs but crazyflie is not equipped with any storage and I couldn’t attach log data.
Any advice or suggestions would be much appreciated.

1 Like