This paper proposes a tracking controller for obstacle avoidance of a quadruped robot using potential functions method. The followings are done for this task. At first, a ceiling-mounted camera system is installed for image processing. The goal point and obstacles are separated and recognized by a color recognition method. Second, a path planning algorithm using potential functions method is proposed to generate the path to avoid obstacles and to plan a path for the quadruped robot to reach from start point to goal point. Third, a quadruped robot is chosen as the mobile platform for this study and the kinematic model for the robot is presented. Fourth, a tracking controller is designed for the quadruped robot to track the trajectory based on the backstepping method using Lyapunov function. Finally, the simulation results are presented to show the effectiveness of the proposed trajectory planning algorithm and the tracking controller.