This paper presents a optimization algorithm to improve the positioning accuracy of the nodes in wireless sensor networks, and introduces RSSI-based (Received Signal Strength Indicator) wireless location technology on formation of multiple mobile robots. First, the RSSI value, which is measured between mobile node and reference node, is optimized by Gaussian model. At the same time, using the classical method to calculate the positioning coordinates of each mobile node with the optimized RSSI values. Then, the position information and the RSSI values between each two mobile nodes are introduced to assist localization. A new optimization algorithm is proposed in this paper. Therefore, the location problem is transformed into a nonlinear optimization problem. The experimental results showed that this method can improve the positioning accuracy of mobile nodes and implements the goal to estimate the positions of all nodes at one time. It provides a basis for the study on positioning of dynamic network and multi-robot formation control.