In this paper we argue that RoboCup is a useful tool for the teaching of AI in undergraduate education. We provide case studies, from two Swedish universities, of how RoboCup based AI courses can be implemented using a problem based approach. Although the courses were successful there are significant areas for improvement. Firstly, to help students cope with the complexity of the domain we developed RoboSoc, a general software framework for developing simulated RoboCup agents. Secondly, we propose creating close co-operation between the teachers and researchers at Scandinavian Universities with the aim of increasing the motivation of both students and teachers by providing accessible information and competence.