My RC gear does not support enough channels to manually control the retractable landing gear, so I needed APM to manage it automatically. I wrote a small library for APM. It extends the RCxx_FUNCTION parameter to #28 for landing gear. The code is based on the AP_Parachute library and configurable via GEAR_ parameters in APM Planner. It is work in progress you can find at https://github.com/timotto/ardupilot/tree/landinggear
I set the GEAR_ALT_MIN parameter to 1 meter in this video.
RC11_FUNCTION is set to 28 and I connected the servos to AUX OUT 3.