Real-Time Cooperative Trajectory Planning Using Differential Flatness Approach and B-Splines