The invention discloses a method for detecting whether the distance between a subway platform shielded gate and a vehicle body is safe. According to the method, a two-dimensional
laser scanner is installed at the point where the midperpendicular of the rear surface of a railway vehicle intersects with the plane where the bottom edges of vehicle
doors are located, an angle
encoder is installed on the head of an axle, a polar coordinate storage module, a
data processing host and a mileage positioning module are installed in a compartment, spatial three-dimensional coordinates are obtained through
processing of the
data processing host by means of the distance between the
scanner and the shielded gate obtained by the two-dimensional
laser scanner and the advancing mileage of the vehicle obtained by the angle
encoder and the mileage positioning module, then specified vehicle limit coordinate values are introduced to the same three-dimensional coordinate
system, and the actual distance between the vehicle body and the shielded gate is measured and then compared with the specific safety distance so that whether the distance between the shielded gate and the vehicle meets safety requirements can be judged. According to the method, vehicle-mounted dynamic detection is achieved, detection precision is improved, operation is easy, realizing cost is low, and application and popularization are facilitated.