This paper addresses both path tracking and local trajectory generation for autonomous ground vehicles. An optimisation based two-level control framework is proposed for this task. The high-level control operates in a receding horizon fashion by taking into account real-time sensory information. It generates a feasible trajectory satisfying the nonlinear vehicle model and various constraints, and resolves possible short term conflicts through on-line optimisation. The low-level controller drives the vehicle tracking the local trajectory in the presence of uncertainty and disturbance. It is shown that the time varying controller proposed in this paper guarantees stability under all possible trajectories. The two-level control structure significantly facilitates the real-time implementation of optimisation based control techniques on systems with fast dynamics such as autonomous vehicle systems. The proposed technique is implemented on a small-scale autonomous vehicle in the lab. Both simulation and experimental results demonstrate the efficiency of the proposed technique.