  In this paper, we present a novel solution for real-time, Non-Linear Model
Predictive Control (NMPC) exploiting a time-mesh refinement strategy. The
proposed controller formulates the Optimal Control Problem (OCP) in terms of
flat outputs over an adaptive lattice. In common approximated OCP solutions,
the number of discretization points composing the lattice represents a critical
upper bound for real-time applications. The proposed NMPC-based technique
refines the initially uniform time horizon by adding time steps with a sampling
criterion that aims to reduce the discretization error. This enables a higher
accuracy in the initial part of the receding horizon, which is more relevant to
NMPC, while keeping bounded the number of discretization points. By combining
this feature with an efficient Least Square formulation, our solver is also
extremely time-efficient, generating trajectories of multiple seconds within
only a few milliseconds. The performance of the proposed approach has been
validated in a high fidelity simulation environment, by using an UAV platform.
We also released our implementation as open source C++ code.
