Three-dimensional trajectory tracking control of an underactuated AUV