Method and device for meqasuring the separation between vehicles