A method for position tracking includes using first and second field generators located at respective different first and second locations to generate respective first and second magnetic fields in a vicinity of first and second objects. The first and second fields are measured using first and second position sensors respectively associated with the first and second objects. First and second potential relative coordinates of the first object relative to the second object are calculated responsively to the first and second magnetic field. The potential relative coordinates are processed in order to determine a correct relative coordinate of the first object relative to the second object.