Based on Robot's intelligent behavior of exploring the unknown environment, a fuzzy controller is built to complete the local path planning. Because of walking around swing and going into local minima problems, a method based on particle swarm optimization for fuzzy controller is proposed. The method utilizes the PSO algorithm to optimize the threshold of the fuzzy membership functions thus the parameters can be adjusted in different environments. Simulation results demonstrate that the robot has the ability of path planning, the local minimum problem is effectively been solved and the path is smoother.