  This paper regards the relative localization problem in sensor networks. We
study a randomized algorithm, which is based on input-driven consensus dynamics
and involves pairwise "gossip" communications and updates. Due to the
randomness of the updates, the state of this algorithm ergodically oscillates
around a limit value. Exploiting the ergodicity of the dynamics, we show that
the time-average of the state almost surely converges to the least-squares
solution of the localization problem. Remarkably, the computation of the
time-average does not require the sensors to share any common clock. Hence, the
proposed algorithm is fully distributed and asynchronous.
