Optimality-Based Trajectory Generation And Periodic Learning Control For Quadrocopters