An Introduction to AI Course with Guide Robot ...

2 downloads 0 Views 3MB Size Report
Mar 9, 2011 - cided to use the “symbol signs” designed by AIGA and the. U.S. Department of Transportation for use in airports and other transportation ...
An Introduction to AI Course with Guide Robot Programming Assignments Nik Swoboda

Juan Bekios-Calfa

Luis Baumela

Universidad Politécnica de Madrid Boadilla del Monte, Spain

Universidad Católica del Norte Antofagasta, Chile

Universidad Politécnica de Madrid Boadilla del Monte, Spain

[email protected]

[email protected]

[email protected]

Javier de Lope Universidad Politécnica de Madrid Madrid, Spain

[email protected] ABSTRACT

gence (AI) class.1 The following is a list of qualities which were considered to be desirable in the design of the course:

In this paper we describe a collection of course materials designed to be used in an undergraduate introduction to artificial intelligence (AI) course. These materials include three programming assignments, each touching upon core AI topics, which require that the students build the main functionalities of a guide robot. These assignments were carefully designed to allow the same solution to work both with a robot simulator and an inexpensive web-cam as well as with real robots. An overview of the course and the assignments is given along with references to online versions of the resources developed to teach the course.

• Hardware neutral with the possibility of simulation – Rather than focus on a particular hardware platform, R R we like the use of the popular LEGO Mindstorms

, have selected programming tools which are hardware neutral and allow for the use of robot simulators. Furthermore, due to limited lab space and hardware availability we wanted students to be able to effectively work outside the robot lab and using their own computers. (By doing this we also hoped to address the problems reported in [9] as being possibly due to the lack of a simulator, see Section 1.2 for further discussion.)

Categories and Subject Descriptors K.3.2 [Computers and Education]: Computer and Information Science Education—Computer science education; I.2.9 [Artificial Intelligence]: Robotics—Commercial robots and applications

• Off the shelf robots – Unlike many courses which begin by having the students build a robot, which is the case R R in many courses using LEGO Mindstorms

(e.g., [14]) we have chosen to use pre-fabricated robots to focus more of the student’s work on the basic subject matter of an AI course.

General Terms

• Integrated assignments – Rather than have the students complete a number of independent assignments we have opted to include assignments which integrate and later combine to accomplish a single more complex task (much like the “egg hunt” assignments given in [5]). This is to provide continuity between the assignments and motivation for the students to continue with the course work.

Human Factors, Algorithms

Keywords Course Design, Artificial Intelligence, Robots

1.

INTRODUCTION

Following the same principle presented in [16], the basic premise of this project is to use robotics as an underlying theme for the design of an introduction to artificial intelli-

• Student failure recovery – The assignments are further designed to allow the student to produce a functioning (though inferior) system even if they are unable to complete some of the assignments. • Real world environment – A good number of the existing proposals for teaching AI with robots include the need for a specially constructed environment for the

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. SIGCSE’11, March 9–12, 2011, Dallas, Texas, USA. Copyright 2011 ACM 978-1-4503-0500-6/11/03 ...$10.00.

1 It should be noted that this is also not all that different from Russell and Norvig’s use of agents as the basis of their popular AI text book Artificial Intelligence: A Modern Approach [23].

231

robot [15, 3, 5], which require a large dedicated lab space and also make the problems less realistic. The assignments we propose use the hallways and rooms in the vicinity of the robot lab as the workspace of the robot.

few statistically significant results were achieved with respect to student motivation with the exception of the fact that students in robot-based courses had less extrinsic goal orientation, i.e., that they were less motivated to learn for the purpose of achieving rewards, like for the sake of getting a better grade. Also, the work in [17] shows more homework submissions and higher grades in sections taught with robots. Despite the existence of some published negative reports, our experience coincides with that of many authors who, in general terms, describe the experience of using robots in the classroom as being a positive one.

As we were unable to find existing proposals for teaching AI which meet these demands, we decided to strike new ground and design a series of course projects from scratch. To do this three programming assignments were created to construct the core components of a guide robot. These assignments are intended to be completed in small groups of 2-3 students and are intentionally open-ended.2 The main purpose of this paper is to present an overview of the course as well as to share the teaching materials which we have developed.

1.1

2.

Topics covered in the course

AI is concerned with the design of software systems or physical machines that interact with their environment to act rationally in order to accomplish an assigned task [7]. To achieve this goal these systems must have planning, acting and perception capabilities, among others. In this paper we present a course that covers those topics in the Intelligent Systems (IS) knowledge area of the ACM Computer Science Curriculum [7] that are essential for controlling our robotic system. The course is organized around the three modules that compose our system: a navigation module which provides acting and low-level perception, a planning module concerned with knowledge representation and search, and lastly a vision module to detect and recognize markers. The material in the course thus covers the Fundamental Issues and Basic Search Strategies core IS knowledge units. Elective IS knowledge units also covered are: Advanced Search (heuristics, genetic algorithms), Machine Learning (neural networks), Robotics (sensing, world models, planning, programming, navigation and control, software and architecture) and Perception (image formation, object detection and recognition). We do not cover the core IS knowledge unit Knowledge Based Reasoning; this is due to the fact that our students have already studied those topics in logic and statistics courses earlier in the curriculum.

1.2

Robots in the classroom

THE UNIFYING THEME OF THE COURSE: A GUIDE ROBOT

The main idea of the course is to group and orient some of the material taught in a typical introduction to AI course to the solving of a realistic, but greatly simplified, problem. It is designed to provide students with the basic skills necessary to program the core functionalities of a guide robot, a robot whose main purpose is to assist people in arriving at a given destination in a public space. One example scenario where this kind of a robot could be useful would be: Upon arriving at the Madrid International Airport, Mr. Brown is met by a guide robot which leads him to the baggage claim area to collect his luggage and then to the taxi stop for him to take a taxi to his hotel downtown. In order to accomplish tasks of this sort, we assume that the robot is provided with the following information: • An accurate and to scale map of the physical space where the robot will be moving including the locations of all fixed obstacles in that environment • The location and orientation of “markers” in the world which, when visible to the robot, will allow the robot to determine its current location and orientation within the environment • A model of the visual properties of those markers to allow the robot to recognize them in its environment Furthermore, we assume that the robot, which can be either a real or a simulated robot4 , has the following basic capabilities:

It is generally believed that using robots in the classroom provides an environment where students are more motivated and a context for addressing the complexity of real world problems. Some experimental studies have been conducted to determine the validity of these beliefs but unfortunately the results are mixed. In [9], rather negative results were presented showing lower test scores and subjective measures (calculated from student surveys) in classes which used robots.3 Limited, but somewhat more positive results can be found in [24] where it was informally shown that student demand, grades, and understanding improve in robot-based CS1 courses. While in [19]

• Devices to allow the robot to change its location and orientation (e.g., wheels, legs) • A fixed camera used to search for the presence of markers in the area in front of the robot • Sensors to detect the presence of obstacles along the heading of the robot (e.g., sonar or laser range sensors) • Sensors to allow the robot to calculate its location using dead-reckoning (e.g., wheel encoders, gyroscopes and/or accelerometers)

2

Thus the course is intended to teach “transversal” or noncomputer science skills such as learning how to work in a group and open-ended problem solving skills as well as traditional AI concepts. 3 In that work the authors hypothesize that these findings could be due to the lack of a robot simulator which forced students to work in a lab.

4 In the case of students working with a simulated robot we suggest that they use a real web-cam to test the vision module of the assignment. This will be further discussed in Section 5.3.

232

We divide the core functionality of the robot into three modules: • Navigation – A reactive or low-level planner with the capacity to move from one known location in the environment to another while avoiding obstacles provided that there are no convex obstructions in that path. • Planning – A global planner with the capacity to use a map of the environment to determine the shortest path from a given location to a goal. • Vision – A marker recognition system with the capacity to recognize to determine the relative location and orientation of markers in the environment of the robot. Lastly, to increase the feasibility of the project we make some general simplifying assumptions: • The robot always begins the task with a marker in its field of view (thereby allowing the robot to localize at startup). • The floor space where the robot roams is all in the same plane.

Figure 1: A robot guided by an evolved ANN in a simulation: the robot must visit a list of way-points by following a free-collision trajectory

• The human and the guide robot do not need to interact directly.

initial values for the weights and bias, the fitness function, etc. It should be noted that this assignment bears some similarity to that presented in [11] which uses different kinds of neural net topologies and Bayesian networks to learn the detection of obstacles using infrared and light sensors.

• The robot can execute the task without needing to recharge.

3.

COURSE OVERVIEW

We assume that approximately four weeks of in class time is spent in presenting the material related to each of the three modules taught in the course. Further class time is alloted to an introduction to AI, the programming environment, and the robots as well as to sessions where students discuss problems they have encountered with the assignments and share experiences. We now present further details of the three modules.

3.1

3.2

The Planning Module

The planning module is responsible for finding the shortest path from the robot’s current location to a goal location. To do this the module applies a search algorithm to the information contained in the map of the environment of the robot. In this section of the course there is a strong emphasis on the trade-offs involved in selecting a knowledge representation and a search algorithm based upon the desired properties of the resulting system. Students are presented with a number of methods for representing 2-D space along with search algorithms and begin working with a somewhat naive implementation of an occupancy grid spatial representation and a dynamic-programming search algorithm. Then students are given the “open-ended” assignment of improving upon this implementation. To give the students some basic direction, the following suggestions are made:

The Navigation Module

The navigation system is responsible for guiding the robot to a desired position by following a collision-free path. The students are given the assignment of developing the navigation system through the evolution of an Artificial Neuron Network (ANN) [20]. The ANN’s inputs are the robot’s perceptions (sonar readings and robot heading) and the ANN’s output is the robot’s angular speed. Optionally, the robot’s linear speed can also be obtained by applying a similar procedure. Figure 1 shows the expected robot behavior in a simulated environment. A simple perceptron is suggested as the ANN model and students are encouraged to try more complex models if the results are not successful. Several conventional activation functions are also provided. An evolutionary strategy for training the ANN must be designed as a part of this assignment. Students receive an initial scheme of this evolutionary strategy that must be adapted and optimized for this particular problem. Also, we recommend that they experiment with changes in several of the scheme’s parameters and features such as: the size of the population, whether elitism improves the solution, the

• Use a watershed-like algorithm to segment the occupancy grid to construct a labeled topological graph (also sometimes called the Voronoi graph). • Implement the A∗ search algorithm to plan routes through the topological graph. Even if the students follow these suggestions there are still a number of important decisions which need to be made including: deciding upon the number of way-points used to represent the path and the principles used to select those way-points.

233

4. 4.1

COURSE DETAILS Student prerequisites

We assume that students taking the course have a solid background in basic Computer Science concepts and have had at least two or three courses including intensive programming experience. A typical CS undergraduate would take a course of this nature in his or her third or fourth year.

4.2

We use Pyro (Python Robotics) [6] as the programming platform for the assignments. Though we do not assume that our students have Python programming experience, we have found that after a brief introduction to Python programming they quickly become able programmers. Pyro and its robot simulator work well in Linux, Windows and in MacOsX. Furthermore Pyro includes an interface to Player thereby allowing the same code to control a simulated robot as well as all robots supported by Player (see [22] for a list of supported hardware). Player itself is designed to only run on Unix systems, but as we assume that students will be working with the physical robots in a laboratory and with the simulation at home, this was not problematic. For image capture and processing we use OpenCV [21], which is also cross-platform and somewhat hardware neutral with respect to video capture.

Figure 2: Detecting the “Ground Transportation” [1] marker

3.3

Programming environment

The Vision Module

The goal of the vision module is to provide the robot with sensing capabilities to detect and estimate its position relative to a set of known landmarks. In order to use realistic markers and to continue in the airport metaphor, we decided to use the “symbol signs” designed by AIGA and the U.S. Department of Transportation for use in airports and other transportation centers (see [1]). This problem may be solved using publicly available software, e.g., Artoolkit [13, 2]. Nevertheless, we decided to use a more general, albeit computationally more demanding, approach to familiarize the student with a set of key concepts related to object recognition and robust estimation. Representing objects using local descriptors of the object’s appearance is one of the most successful recent results of work in Computer Vision, with SIFT (Scale-invariant feature transform) [18] being the most prominent representative of this approach. Applications include object and place recognition, robotic mapping and navigation, image stitching, 3D modeling, gesture recognition, video tracking, and match moving, among others. To detect and recognize landmarks we introduce the student to the problem of scaleinvariant blob detection, using the scale-normalized determinant of the Hessian, and description, using SURF (Speeded Up Robust Features) [4]. This solution is based on the SURF implementation available in OpenCV [21]. A screen shot of the system detecting the “Ground Transportation” marker can be found in Figure 2. Once detected and recognized, we can compute the relative position of the the robot to the landmark by fitting a homography to the known planar structure of the landmark. If the camera intrinsics are known, then the relative positions of the landmark and robot can be immediately obtained from the estimated homography [12]. Here again we use OpenCV [21] to calibrate the robot camera and robustly fit the homography using the RANSAC algorithm (Random Sample And Consensus) [12].

4.3

The programming assignments

Students begin the semester with a working prototype of the guide robot system. This prototype includes “toy” implementations of all of the core modules which provide the basic functionality needed to solve the task using a simulated robot. Throughout the semester students replace each of these modules with code of their own to improve its functionality and robustness. Though it might seem counter-intuitive to provide the students with a working prototype from the start, this was done for a number of reasons. In addition to building the core modules, a lot of work is required to program a working system, and much of this work is not directly related to the material covered by the course. By providing a working system the students have access to the complete system if needed, but in most cases they can treat large portions of code as “black boxes”. Also by providing trivial implementations of the modules that the students will need to develop, students are able to see how those modules interact with the other parts of the system and again this simplifies the work expected from the student. A screen-shot of the initial system is shown in Figure 3. We will now describe the initial system at more length. For its navigation module a simple algorithm is given to move the robot from one location to another. In a nutshell, this algorithm works by rotating the robot until approximately the correct “as the crow flies” heading is achieved and then advances while making small heading corrections. This algorithm does not deal with obstacles in the path, nor does it produce very fluid movements (the robot stops completely to make hard turns). The given planning module consists of our own modifications to the occupancy grid implementation included in Pyro, see Section 4.2, along with Pyro’s naive implementation of a dynamic-programming path searching algorithm

234

Figure 4: The Erratic robot realizing the task

or on their own laptops connected to the robot using SSH through WIFI. In this manner they can run Pyro and all task processing on-board the robot. An image of the Erratic robot realizing the task can be found in Figure 4. The decision to use robots in a course of this nature does entail a good deal of additional work for the faculty involved. Assuming that students will share the robots, maintaining these machines with their on-board PC’s is similar in many ways to maintaining a laboratory of desktops. Problems including account creation, system updates, and hardware failures need to be addressed. Furthermore, measures might need to be taken to supervise the laboratory to prevent the theft of robots or their parts.

Figure 3: A screen-shot of the initial system

(the algorithm is based upon Thrun et al. [25]). Given a goal in the occupancy grid based representation of the robot’s environment it uses value iteration to calculate the distance from each cell to the goal. Then path planning is simply a “downhill” search from any cell to the goal. In place of the vision module, we rely upon the simulation to provide the locations of the “visible” markers relative to the robot.5 Thus, no real image processing is done by the module and therefore students must begin the semester by working with a robot simulator.6

4.4

5.2

Students are provided with a simulated world which was built to scale from architectural drawings of the area around the robot lab. Thus, working with both simulated and real robots was not very problematic though we have observed some significant differences between the behavior of the simulated sonar sensors in the Pyrobot simulator and the real sensors. These differences did cause a few problems when moving from the simulator to the real robot. For example, navigating around door frames was more difficult using the real robots than in the simulation. Despite these small problems students were able to work both at home using the simulator and in the lab with the real robots without much trouble.

Online resources

Online copies of the resources which we have developed to teach the course can be found at: http://airobotics.ucn. cl/. These resources include the initial implementation of the system given to the students, slides used in lectures to present the core concepts behind each of the modules, along with images and videos.

5. 5.1

Real vs. simulated robots

5.3

Using only simulated robots

The course can also be taught without the use of real robots. In this case students work exclusively with the robot simulator included with Pyro and use inexpensive web-cams to test the vision module. But doing this means that students are not able to integrate the vision module into the final solution. It is also possible to use images from simulated cameras in a 3-D simulator, like Gazebo [10], but that results in much less realistic images. Furthermore, many image processing challenges, like those due to illumination and noise, are almost eliminated in that setting.

COURSE EXPERIENCES On using real robots

We have taught the course using the Erratic Robot [8]. The Erratic includes an on-board PC running Linux, wheel odometry, sonar range sensors, and an optional fire-wire camera. Students work at desktop computers in the lab 5 Reasonable assumptions regarding the field of view and resolution of a typical camera as well as the maximum distance and angle for successfully recognizing markers of approximately 20x20cm are used to make the detection of markers in the simulation more realistic. 6 Artoolkit [13, 2] was used to implement a second basic image processing module but it was not used with the students due to its level of complication and a general desire to keep the initial system as simple as possible.

6.

CONCLUSIONS AND FUTURE WORK

We acknowledge that employing the assignments presented here in an introduction to AI course results in a programming intense course. By far the most common comment that we have received regarding the course was that it was a “lot of work”, but at the same time course survey results showed

235

that the course satisfied the students’ expectations. Despite the work load, we believe that using a “realistic” problem and real robots really does motivate students to learn, work hard, and to produce high quality work. The course materials which we provide should be considered to be “work in progress” and we plan to post additions and improvements to the course web page as they are implemented and tested. In the immediate future we plan to make modifications to the Pyrobot simulator to make its sonar readings more realistic and improvements to the vision module to increase the distance at which it can accurately recognize markers.

7.

[12] R. Hartley and A. Zisserman. Multiple View Geometry in Computer Vision. Cambridge University Press, second edition, 2004. [13] H. Kato and M. Billinghurst. Marker tracking and hmd calibration for a video-based augmented reality conferencing system. In IWAR ’99: Proceedings of the 2nd IEEE and ACM International Workshop on Augmented Reality, page 85, Washington, DC, USA, 1999. IEEE Computer Society. [14] F. Klassner. A case study of lego mindstorms’TM suitability for artificial intelligence and robotics courses at the college level. SIGCSE Bulletin, 34(1):8–12, 2002. [15] A. N. Kumar. Using robots in an undergraduate artificial intelligence course: an experience report. In FIE ’01: Proceedings of the Frontiers in Education Conference, 2001. 31st Annual, volume 2, pages T4D–10–14, Washington, DC, USA, 2001. IEEE Computer Society. [16] D. Kumar and L. Meeden. A robot laboratory for teaching artificial intelligence. SIGCSE Bulletin, 30(1):341–344, 1998. [17] T. Lauwers, I. Nourbakhsh, and E. Hamner. Csbots: design and deployment of a robot designed for the cs1 classroom. SIGCSE Bulletin, 41(1):428–432, 2009. [18] D. G. Lowe. Distinctive image features from scale-invariant keypoints. International Journal of Computer Vision, 2(60):91–110, 2004. [19] W. I. McWhorter and B. C. O’Connor. Do R R lego mindstorms

motivate students in cs1? SIGCSE Bulletin, 41(1):438–442, 2009. [20] S. Nolfi and D. Floreano. Evolutionary Robotics: The Biology, Intelligence, and Technology of Self-Organizing Machines. MIT Press/Bradford Books, Cambridge, MA, 2000. [21] The opencv wiki. Retrieved July 16, 2010 from http://opencv.willowgarage.com/wiki/ [22] Player - supported devices. Retrieved July 16, 2010 from http://playerstage.sourceforge.net/doc/ Player-2.0.0/player/supported_hardware.html [23] S. Russell and P. Norvig. Artificial Intelligence: A Modern Approach. Prentice Hall, Upper Saddle River, NJ, USA, third edition, 2009. [24] J. Summet, D. Kumar, K. O’Hara, D. Walker, L. Ni, D. Blank, and T. Balch. Personalizing cs1 with robots. SIGCSE Bulletin, 41(1):433–437, 2009. [25] S. Thrun, A. B¨ ucken, W. Burgard, D. Fox, T. Fr¨ ohlinghaus, D. Hennig, T. Hofmann, M. Krell, and T. Schmidt. Map learning and high-speed navigation in rhino. In D. Kortenkamp, R. P. Bonasso, and R. Murphy, editors, AI-based Mobile Robots: Case Studies of Successful Robot Systems, pages 21–52. MIT Press, Cambridge, MA, 1998.

ACKNOWLEDGMENTS

Nik Swoboda was funded by Spanish Ministerio de Educaci´ on through the grant 2008-05624/TIN. Juan Bekios and Luis Baumela received support from the Consolider Ingenio Program, project CSD2007-00018. Luis Baumela was also funded by the Spanish Ministerio de Educaci´ on under contract TIN2008-06815-C02-02.

8.

REFERENCES

[1] Aiga - symbol signs. Retrieved July 16, 2010 from http://www.aiga.org/content.cfm/symbol-signs [2] Artoolkit homepage. Retrieved July 16, 2010 from http://www.hitl.washington.edu/artoolkit/ [3] J. Baltes and J. Anderson. Leveraging mixed reality infrastructure for robotics and applied ai instruction. In Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence, 2010. [4] H. Bay, A. Ess, T. Tuytelaars, and L. V. Gool. Speeded-up robust features (surf). Computer Vision and Image Understanding, 110(3):346 – 359, 2008. [5] R. D. Beer, H. J. Chiel, and R. F. Drushel. Using autonomous robotics to teach science and engineering. Communications of the ACM, 42(6):85–92, 1999. [6] D. S. Blank, D. Kumar, L. Meeden, and H. A. Yanco. The pyro toolkit for ai and robotics. AI Magazine, 27(1):39–50, 2006. [7] Computer science curriculum 2008: An interim revision of cs 2001. Retrieved September 7, 2010 from http://www.acm.org/education/curricula/ ComputerScience2008.pdf [8] The erratic robot. Retrieved July 16, 2010 from http://www.videredesign.com/ [9] B. S. Fagin and L. Merkle. Quantitative analysis of the effects of robots on introductory computer science education. ACM Journal on Educational Resources in Computing, 2(4):1–18, 2002. [10] Gazebo - 3d multiple robot similator with dynamics. Retrieved July 16, 2010 from http://playerstage. sourceforge.net/gazebo/gazebo.html [11] L. Greenwald, D. Artz, Y. Mehta, and B. Shirmohammadi. Using educational robotics to motivate complete ai solutions. AI Magazine, 27(1):83–95, 2006.

236