In this study, we designed a localization and obstacle avoidance system for humanoid robots in the Federation of International Robot-soccer Association (FIRA) HuroCup united soccer competition event. The localization is implemented by using grid points, gait, and steps to determine the positions of each robot. To increase the localization accuracy and eliminate the accumulated distance errors resulting from step counting, the localization is augmented with image pattern matching using a system model. The system also enables the robot to determine the ball’s position on the field using a color model of the ball. Moreover, to avoid obstacles, the robots calculate the obstacle distance using data extracted from real-time images and determine a suitable direction for movement. With the integration of this accurate self-localization algorithm, ball identification scheme, and obstacle avoidance system, the robot team is capable of accomplishing the necessary tasks for a FIRA soccer game.