A system including an autonomous lawn mower with at least one movement sensor, a base station and a boundary wire forming a closed loop and being connected with the base station, the autonomous lawn mower and the base station being capable to interact with each other such that the autonomous lawn mower can determine whether it is in its home position, the autonomous lawn mower further comprising a memory, for storing measured values from its at least one movement sensor and a processor to generate a trajectory based on the measured values, wherein the processor is further configured to calculate a total error between the position and orientation according to the trajectory and the home position after reaching the home position again and to correct the position and corresponding orientations of the trajectory by a position error and an orientation error respectively in two successive computational steps,
- wherein correction of orientations along the trajectory is performed before correction of the positions along the trajectory is performed on positions calculated on the basis of the corrected orientations, and
- wherein correction is performed by weighting each orientation and position according to some criteria, including orientation changes, acceleration or a combination of multiple criteria.