In this paper, a new path tracker is proposed for autonomous robots by re-designing a classical obstacle avoidance algorithm "Follow the Gap Method (FGM)". Until now, FGM is not used to track a global plan of consecutive waypoints dynamically yet. On the other hand, this is a very fundamental requirement for autonomous robots. To use the FGM as a dynamic tracker, the proposed methodology is borrowing the "Look Ahead Distance" (LAD) from geometric path tracking methods and adapting it to the local planner. The LAD is defined as the distance from the robot to the desired waypoint on the path to be tracked. In the proposed solution, a dynamic and optimized LAD for the local planner is defined which is automatically adjusted by the robot velocity. The dynamic LAD function is optimized to increase tracking, avoidance, and comfort capabilities. This study is the first one that uses FGM together with a global planner as part of a whole autonomous system. Another novelty of the paper is the optimization of LAD. In this study, the LAD is optimized by taking into account not only the tracking error but also the distance to obstacle and comfort metrics simultaneously, for the first time in literature. The optimization is performed with various weight coefficients in the cost function. Three metrics are used to compare the effect of weight coefficients on the optimization. These metrics are the Root Mean Square (RMS) values of "Distance to Path", "Distance to Obstacle" and "Magnitude of Total Acceleration". For instance according to the experiments, when the tracking coefficient is doubled in optimization, the distance to path metric comes from 0,424m to 1,23m, indicating that the robot is tracking better. Similar effects on other metrics are observed when the related coefficients are changed. Besides the simulations, real-world experiments are performed on the real autonomous wheelchair platform to show the real-time performance of the proposed approach.