To overcome the high time consumption and poor environmental adaptability encountered during obstacle avoidance by a wheeled robot formation, we propose a strategy that combines a heuristic path planning function and an optimal formation transformation. First, we build a base of common robot formation knowledge and transformation time. Second, the optimal obstacle avoidance path is found according to the minimum time-consuming assessment value and calculated with a heuristic function and optimal formation transformation. Finally, the robot formation can pass through the obstacle areas in the topology of leader-follower. The simulation result shows that the proposed method is more effective and flexible compared with the traditional method.