The invention relates to a device for detecting an environment, wherein the device includes at least one sensor unit, as well as at least one evaluation unit, wherein the sensor unit includes at least one distance sensor, as well as at least one position sensor, by means of which position sensor the spatial position of the at least one sensor unit, or the at least one distance sensor in relation to a horizontal plane can be determined, and wherein distance data from the distance sensor are only recorded when the at least one position sensor registers an acceptable position of the at least one distance sensor, or the distance data of the at least one distance sensor are only transmitted to the at least one evaluation unit when the at least one position sensor registers an acceptable position of the at least one distance sensor, or the distance data determined by the at least one distance sensor are recorded together with the associated position data, and the evaluation unit generates at least one virtual image of the environment recorded by the at least one distance sensor based on the distance data, taking the position data into account, if applicable.