Corrected the cross track error forumla. The perpendicular should not be calculated from the vehicle pose but the midpoint of the front wheels. The response is much better now. The error actually converged to 0 after a max divergence of 20 cm. The code was able to handle minor glitches in code (caused mostly due to Gazebo getting stuck). The error shot up instantly but came close to 0 quite soon. Complete and proper PID tuning can improve this much further.