Autonomous vehicle's technology is expected to be disruptive for automotive industry in next years. This paper proposes a novel real-time trajectory planner based on a Nonlinear Model Predictive Control (NMPC) algorithm. A nonlinear single track vehicle model with Pacejka's lateral tyre formulas has been implemented. The numerical solution of the NMPC problem is obtained by means of the implementation of a novel genetic algorithm strategy. Numerical results are discussed through simulations that shown a reasonable behavior of the proposed strategy in presence of static or moving obstacles as well as in a wide rage of road friction conditions. Moreover a real-time implementation is made possible by the reported computational time analysis.