A self-adapting algorithm based on atmospheric pressure to localize indoor devices