A formation control algorithm,in which both obstacle and collision avoidance are considered,is proposed for a multi-agent system with a leader.Both collision and obstacle avoidance potential functions are improved.Based on the potential method,control strategy is designed.It can be guaranteed that the system asymptotically converges to the formation on the effection of the control strategy.As a result,both collision avoidance and obstacle avoidance are realized.Finally,simulation studies are provided to verify the feasibility and effectiveness of the proposed method.