A method for calculating a conformity between a representation of an environment and said environment, wherein said representation of the environment constitutes a representation in at least two dimensions, where a distance between two points in the representation has a known relation to the corresponding distance in said environment, wherein the method comprises - estimating, with a mathematical model of a vehicle and on the basis of stored data, a first position for a point on the vehicle in said representation of the environment and, for said first estimated position in said representation of the environment, to calculate a first set of expected parameter values, wherein said first set of expected parameter values is a set of distances from said point on said vehicle in one or more different directions to surrounding obstacles in said representation of the environment, - comparing said calculated first set of expected parameter values with a second set of stored parameter values, where said second set of stored parameter values has been determined for a second position, where said second position constitutes a position for a corresponding point in said environment that essentially corresponds to said first estimated position in the representation of the environment, wherein said second set of stored parameter values is a set of distances from said corresponding point in the environment in one or more different directions to surrounding obstacles in the environment, corresponding to the different directions to the surroundings obstacles in said representation of the environment and wherein said second set of stored parameter values is determined from one or more sensors (108, 110, 111, 112) arranged on the vehicle, and - calculating using said comparison a measure of a conformity between said environment and said representation of the environment. - estimating, with a mathematical model of a vehicle and on the basis of stored data, a first position for a point on the vehicle in said representation of the environment and, for said first estimated position in said representation of the environment, to calculate a first set of expected parameter values, wherein said first set of expected parameter values is a set of distances from said point on said vehicle in one or more different directions to surrounding obstacles in said representation of the environment, - comparing said calculated first set of expected parameter values with a second set of stored parameter values, where said second set of stored parameter values has been determined for a second position, where said second position constitutes a position for a corresponding point in said environment that essentially corresponds to said first estimated position in the representation of the environment, wherein said second set of stored parameter values is a set of distances from said corresponding point in the environment in one or more different directions to surrounding obstacles in the environment, corresponding to the different directions to the surroundings obstacles in said representation of the environment and wherein said second set of stored parameter values is determined from one or more sensors (108, 110, 111, 112) arranged on the vehicle, and - calculating using said comparison a measure of a conformity between said environment and said representation of the environment.