Nonparametric Belief Propagation Based on Spanning Trees for Cooperative Localization in Wireless Sensor Networks