PX4 / PX4-Flow

Firmware for PX4FLOW board
232 stars 340 forks source link

Fix gyro compensation. Enable gyro compensation by default. #110

Closed szobov closed 5 years ago

szobov commented 5 years ago

Plots:

So, before my fixes it looks like the signs was messed. Plot of gyro is opposite to plot of optical flow estimation. Also, with enabled compensation before fixes, px4 ekf_estimator reject estimation of optical_flow on every rotation of copter.

After fixes the flight with enabled optical flow became more stable and it's possible to see, that plots became more smooth, even in comparison with enabled gyro compensation.

I also enable compensation in settings. It was suspiciously changed to 0 in commit, that doesn't related to gyro compensation at all.

My environment:

Hope this changes'll help and can make px4flow great again! Thanks.

mhkabir commented 5 years ago

Gyro compensation is done on the PX4 side in the EKF. Gyro biases are otherwise not observable, making any px4flow side solution drift over time.

szobov commented 5 years ago

Thank you @mhkabir for explanation. May I rid of the code, that related to gyro compensation and histogram filter? It's quite confusing, because PX4Flow isn't plug&play thing and we need to dive deep into the code to understand, how why it doesn't work.