Guided mode with optical flow oscillating in altitude

Check the thread The copter does not takeoff in Guided mode and EKF_GPS_TYPE = 3 (optical flow)
Here is a working solution for working with quad indoors in GUIDED mode. But auto-takeoff still is not implemented