def reconstruct_velocity(waypoints, dt):
    """
    Reconstructs the velocities based on the waypoints and time interval.
    """
    diff = np.diff(waypoints, axis=0)
    velocitaies = diff / dt
    # Append the last velocity to match the length of waypoints
    velocitaies = np.append(velocitaies, velocitaies[-1].reshape(1, -1), axis=0)
    return velocitaies

    Reconstructs the velocities based on the waypoints and time interval.
    
metadrive/utils/waypoint_utils.py