The method involves detecting an object (6) in a direction of movement of a vehicle (2) using a sensor (1) i.e. laser scanner, which is arranged on the vehicle, where the sensor is directed onto a plane i.e. track plane (3). A distance of the sensor from a measuring point is determined using a control unit such that an actual value of the determined distance is compared with a reference value. A difference value is delivered for evaluation either as an object or as a measurement error when the actual value deviates from a desired value.