A Frenet-Based Algorithm for Trajectory Prediction