Encapsulated trajectory tracking control for autonomous vehicles