PX4/Firmware — pull request #459 by DrTon (2013-10-11 18:52:18+00:00)
Title: independent distance to surface estimation

- Distance to surface (e.g. from sonar) now estimated independently from altitude
- Filter uses altitude estimate to fill gaps in sonar data
- Added RC switch "distance bottom" to enable / disable using distance data for altitude control
- Added vehicle_control_mode.flag_use_dist_bottom flag
- multirotor_pos_control uses distance and changes altitude setpoint to make distance setpoint constant, if distance data is not available it fallbacks to normal operation, seamless transition between sonar / baro works nice
- Optical flow used for position estimation when available. If no flow and GPS available < 1s, gaps filled using accelerometer.

WIP, not for merging, but ready for careful testing.
WARNING: on high speed when using without GPS position estimates stops after some time and copter flyes away, move only on low speeds, < 1-2m/s.