def reconstruct_angular_velocity(headings, time_interval):
    """
    Reconstructs the angular velocities based on the headings and time interval.
    return in rad/s(in world coordinate), with positive value turning left and negative value turning right
    """
    # Calculate the angular velocities
    angular_velocities = np.diff(headings) / time_interval
    # Append the last angular velocity to match the length of headings
    angular_velocities = np.append(angular_velocities, angular_velocities[-1])
    return angular_velocities

    Reconstructs the angular velocities based on the headings and time interval.
    return in rad/s(in world coordinate), with positive value turning left and negative value turning right
    
metadrive/utils/waypoint_utils.py