Text this: An Optimal Control Method for Trajectory Tracking Error Detection of Autonomous Vehicles