This paper presents a novel algorithm to solve the robot formation path planning problem working under uncertainty conditions such as errors the in robot’s positions, errors when sensing obstacles or walls, etc. The proposed approach provides a solution based on a leader–followers architecture (real or virtual leaders) with a prescribed formation geometry that adapts dynamically to the environment. The algorithm described herein is able to provide safe, collision-free paths, avoiding obstacles and deforming the geometry of the formation when required by environmental conditions (e.g. narrow passages). To obtain a better approach to the problem of robot formation path planning the algorithm proposed includes uncertainties in obstacles’ and robots’ positions. The algorithm applies the Fast Marching Square (FM22) method to the path planning of mobile robot formations, which has been proved to work quickly and efficiently. The FM22 method is a path planning method with no local minima that provides smooth and safe trajectories to the robots creating a time function based on the properties of the propagation of the electromagnetic waves and depending on the environment conditions. This method allows to easily include the uncertainty reducing the computational cost significantly. The results presented here show that the proposed algorithm allows the formation to react to both static and dynamic obstacles with an easily changeable behavior.