A library computing the velocity is fine. But this function is taking a starting velocity, an ending velocity, and then deciding for itself what speed it should go. This shouldn't occur here. In fact, none of the fractional_progress computations should occur in the path follower. The path follower's job is narrowly defined to put the autonomous vehicle back on the desired path.

If we need to follow an acceleration profile, then we can certainly integrate that into the PathDesired variable and then have the follower act on that, using state feedback. We could even consider that acceleration is always linear, and so avoid extending PathDesired by having the follower calculate desired acceleration from the beginning and ending setpoints and velocities. But that's not what updatePathVelocity is doing here. It's computing the full velocity vector, which is an incorrect approach.