In the paper, an algorithm for the multiple-obstacle avoidance and a procedure of the role reassignment for multiple-robot formation control based on this algorithm are proposed. In this algorithm, an edge detector is utilized to determine the position of vertical edges of the obstacle in the nearby environment. A role reassignment procedure is also developed for formation control of multiple mobile robots by calculating the character cost of each robot. The character cost is related to the degree of difficulty for a robot been assigned a specified character in a formation. The developed algorithm and procedure are applied to the formation control of robots. Simulation and experiment are performed to verify the proposed algorithm and the results show that the performance of the proposed algorithm for obstacle avoidance and procedure for role reassignment are efficient for robot formation control.