With the increased use of rescue robots in indoor scenarios, the requirements for indoor location services are becoming more stringent. Traditional GPS positioning cannot provide accurate location information indoors, while ultra-wideband (UWB) has been widely used for indoor positioning due to its high accuracy and penetrating power. When solving 3D positioning coordinates using UWB least squares in line-of-sight situations, the positioning accuracy is easily affected by the layout height of the base station. In this paper, we first improve the positioning algorithm and then find a better way of base station layout in the actual positioning environment to improve the tag positioning accuracy. The algorithm improvement is based on the following ideas: firstly, the initial positioning results of the tag are obtained using UWB least squares and spatial geometric relations, and the 3D coordinates of the tag are solved using Gauss-Newton iterative method, and finally combined with the Kalman filter for optimization. The base stations are laid out in such a way that adjacent base stations are not at the same horizontal height and relative base stations are at the same horizontal height.