You are on page 1of 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/221537727

A case study of LEGO Mindstorms'™ suitability for artificial intelligence and


robotics courses at the college level

Conference Paper in ACM SIGCSE Bulletin · March 2002


DOI: 10.1145/563517.563345 · Source: DBLP

CITATIONS READS

114 3,365

1 author:

Frank Klassner
Villanova University
58 PUBLICATIONS 992 CITATIONS

SEE PROFILE

All content following this page was uploaded by Frank Klassner on 28 April 2015.

The user has requested enhancement of the downloaded file.


A Case Study of L E G O M i n d s t o r m s 'TM Suitability for Artificial
Intelligence and Robotics Courses at the College Level

Frank Klassner
Department of Computing Sciences
Villanova University
Villanova, PA 19085
Frank.Klassner@villanova.edu

R e v i e w o f recent S I G C S E and I T i C S E literature also


Abstract shows a lack o f study o f Mindstorm's suitability for
supporting A I pedagogy. Popular justifications for this
This paper examines L E G O Mindstorms 'TM suitability as a situation have included the kit's small number o f sensors
hardware platform for integrating robotics into an Artificial and effectors, a lack o f s o p h i s t i c a t e d p r o g r a m m i n g
Intelligence course organized around the agent paradigm environment, and a lack o f support for c o m m o n college-
p o p u l a r i z e d b y Russell and Norvig. This evaluation level programming languages such as Java and C.
discusses h o w kits and projects based on Mindstorms
supported students' exploration o f the issues behind the These observations did indeed represent serious obstacles
design o f agents from three classes in Russell and Norvig's to M i n d s t o r m s ' use in A I courses at the time o f the
intelligent agent taxonomy. The paper's investigation also platform's release. However, during the last four years an
examines several popularly-perceived limitations o f the active Mindstorms hobbyist c o m m u n i t y has arisen on the
Mindstorms package for college-level robotics projects and Internet and has produced a large, informal b o d y o f work
(e.g. d e v e l o p e d p r o g r a m m i n g e n v i r o n m e n t s and
shows that most o f these "limitations" are not serious
impediments to Mindstorms' use, while certain other o f experimented with sensor-management techniques at the
these "limitations" do indeed present challenges to the platform's bytecode programming level) to ameliorate some
platform's u s e . o f these and other perceived shortcomings.
In addition to this development, two practical reasons
recommend that the Mindstorms platform be re-examined
1 Introduction
for viability in college-level artificial intelligence projects:
Recent publications show that robotics-oriented problems
• A single Mindstorms kit costs approximately $200 and
can be used s u c c e s s f u l l y as a p e d a g o g i c a l tool for
thus is one-quarter the cost o f a HandyBoard-based
grounding abstract topics in certain c o m p u t e r science
robot kit and one-tenth the cost o f an ActivMedia-
c o u r s e s (e.g. i n t r o d u c t o r y p r o g r a m m i n g [7,10]) In
based robot kit.
particular, K u m a r and M e e d e n showed [5] that it was
feasible to use a combination o f the HandyBoard [6] and • The Mindstorms kit is a suite o f reusable snap-together
L E G O building blocks as the basis for an effective robotic sensors (touch, rotation, light, temperature), effectors
laboratory for artificial intelligence (AI) course topics at (motors, lights, infrared emitters) building blocks, and
undergraduate liberal arts institutions. Since the late 1990's, a programmable control unit that can serve as the basis
several undergraduate c o m p u t e r science and c o m p u t e r for a wide variety o f robotics projects. Platforms o f
engineering programs [3] have started robotics labs built equivalent price to Mindstorms often require soldering
a r o u n d the H a n d y B o a r d / L E G O c o m b i n a t i o n or the and other one-shot construction methods that make
ActivMedia platform [1 ]. their reuse across course offerings e c o n o m i c a l l y
impractical.
In 1996 L E G O Ine released the M i n d s t o r m s r o b o t
d e v e l o p m e n t and p r o g r a m m i n g kit for m i d d l e s c h o o l For these reasons, this p a p e r reports on a t w o - t r a c k
students. Though related to the HandyBoard's design, the investigation into the Mindstorms platform's suitability for
Mindstorms platform has not been explored as a viable integrating robotics into two semester offerings o f the
platform for college-level projects until quite recently [4]. Villanova University A I course organized around the agent
paradigm popularized by Russell and Norvig [11]. The first
Permission to make digital or hard copies o f all or part of this work for track examines the sophistication o f the robotics projects
personal or classroomuse is granted without fee provided that copies are that the course kits supported. It also examines several
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 popularly-perceived limitations o f the Mindstorms package
otherwise, or republish, to post on servers or to redislribute to fists, for college-level robotics projects and shows that m a n y o f
requires prior specificpermission and/or a fee.
SIGCSE'02, February27- March 3, 2002, Covington,Kentucky,USA.
Copyright2002 ACM 1-58113-473-8/02/0002...$5.00.
these "limitations" are not serious impediments to the lack o f procedure support with a macro definition
Mindstorms' use, while certain other o f these "limitations" facility for "inline procedures."
do indeed still present challenges to the platform's use. The NQC was selected for use in CSC 4500 in spite o f its
second investigation track examines the p e d a g o g i c missing C features because it did provide a high-level
outcomes observed from student evaluations. Mindstorms API that students could quickly learn, allowing
As b a c k g r o u n d for interpreting the projects and them to develop control programs that were much more
Mindstorms' evaluations, this paper first describes the sophisticated than those achievable through the L E G O -
students who participated in the CSC 4500 offerings, the supplied G U I p r o g r a m m i n g environment. N Q C also
course's relationship to other courses in the Villanova provided students with a more powerful API for using the
computer science program, and the LEGO equipment used Mindstorms hardware's multithreading capabilities.
by the students. The paper then describes the L E G O The Spring 2001 offering also used NQC as the primary
projects and student performance. The last two sections of programming tool, although a primitive Lisp interpreter for
the paper discuss the observed strengths and limitations of remotely controlling Mindstorms robots was used in one
the Mindstorms platform and course projects and propose project (see project VI in Section 4).
guidelines for using the platform in other environments

4 Course Projects
2 Student Backgrounds and Course Context
In both course offerings students worked on a number o f
The elective AI course at Villanova (CSC 4500) has no team projects, some based on Mindstorms and N Q C
formal p r o g r a m m i n g prerequisites.. C o m p u t e r science coding, others based on Lisp coding. The following
majors typically take CSC 4500 in their fourth year, by Mindstorms-based projects were developed for the c o m e :
which time most computer science majors have taken a
Programming Languages course that briefly introduces L Simple-Reflex Robot Design. This 1-week project's goal
them to Lisp, the language most often used in CSC 4500. was to show students how robots with simple stimulus-
response rules and a v e r y limited model of the environment
The course is also open to cognitive science minors and (the second-simplest design in Russell and Norvig's agent
computer engineers, who generally have no programming design taxonomy) could achieve effective behaviors.
experience in Lisp and at most one semester o f introductory
programming in Java. This project asked students to design a robot based on a
tread-wheeled "'Pathfinder" model described in L E G O ' s
The course offerings examined in this paper were held in user manual. Students were required to start with this basic
Fall 1999 and Spring 2001. design in order to reduce time spent on distracting
mechanical engineering issues, but they were encouraged
3 Mindstorms Equipment to mount sensors as needed.

From the outset, robotics projects in CSC 4500 were Students first built a robot that ran a random walk, ignoring
intended to be team-based active-learning projects. Each environmental stimuli. The walk consisted of traveling
team's kit for constructing L E G O robots contained the forward for a random number of seconds, then randomly
following hardware: turning 30 degrees left or right, and repeating these two
actions forever. We then ran these first-stage robots
(a) 3 Mindstorms Robotic Invention Systems packages through a short obstacle course with narrow passages, and
(b) 3 more light sensors beyond the three in (a) timed their progress.
(c) 3 more touch sensors beyond the six in (a) Students next added one or more threaded tasks to monitor
either (a) whether, via feedback from the Mindstorms'
(d) 3 more motors beyond the six in (a)
built-in infrared sensor or mounted light sensors, a robot is
(e) 2 rotation sensors too close to a wall, or (b) whether, via feedback from
(f) 24 rechargeable batteries mounted light or touch sensors a robot was wedged in a
corner. The monitor task was to override the default
(g) 1 large lockable toolbox to hold all o f the above as
random walk by turning 30 degrees away from the
well as a partially-completed robot.
observed stimulus (either left or right, as necessary). We
A search was conducted for a Common Lisp programming then allowed these second-stage robots to run in the same
environment for Mindstorms, but none could be found for obstacle course, and students observed a significant
the Fall 1999 offering. Each team in that offering therefore (though not as large as they generally expected!)
used the NQC (Not Quite C) programming environment improvement.
developed by David Baum [2] to program their robots. The
1I. Sensor Accuracy and Functional Simulation. This
language has C syntax, but lacks the following C features:
project's goal was to show students how (in)sensitive each
pointers; recursive procedural invocation, and procedures
o f their sensors were to various stimuli, and to discover
with return values or parameters. NQC compensates for
how some sensors can simulate other sensors' capabilities.

9
The first part o f the project required each team of students dependent: as the contest progressed, robots could switch
to expose their sensors (touch, light, infrared, and rotation) strategies based on their current state (e.g. estimated score,
to as wide a variety o f stimuli as they could generate to position on field). Since robots were permitted to "attack"
learn the range o f meaningful response values the sensors other nests and scatter or steal balls, there was a very wide
could generate. They were also asked to explore what v a r i e t y o f a p p r o a c h e s that a t e a m c o u l d e x p l o r e ,
responses were generated when two or more sensors were minimizing the risk o f teams unintentionally duplicating
connected to the same input port. The experiences students their efforts.
gained in this project were invaluable in helping t h e m V. Team-based Capture-the-Balls. This 1-month project
decide how to choose and arrange sensors on robots for the was the same as project IV, except that each student team
more complicated projects described later. was allowed to field up to three robots as a team. This
The second part of the project asked teams to design simple project's pedagogic goal was to help students understand
robots that used only touch, infrared, and/or light sensors to the issues behind the design o f cooperative, communicating
duplicate the accuracy and sensitivity o f rotation sensors. agents.
This duplication effort was intended to familiarize students VI. Robotic 8-Puzzle Solver. This 2-week project had the
with the concept o f functional emulation - a key concept in goal o f showing students that k n o w l e d g e representations
understanding h o w abstract AI tools like planners and (data abstractions) that speed up search-based p r o b l e m
search algorithms can (partially) emulate each other. solvers can produce solution representations that axe not
Ill. Robot Odometry. This 2-week project's goal was to easily translated into control programs for hardware.
help students u n d e r s t a n d the m a j o r factors that can The project had two stages. In the first stage students had
introduce error into a r o b o t ' s internal representation o f to develop a k n o w l e d g e representation and Lisp search
where it believes it currently located in the world - an program to solve the 8-Puzzle. The team developed a set
important issue in any navigation process. o f four operators that involved conceptually m o v i n g the
Each team was required to design and build a robot that "space" up, down, left, or right, rather than 32 operators for
would measure the perimeter o f a black shape on a light moving each o f the numbered tiles up, down, left, or fight.
background on the floor. The reported measurement (over T h e s t u d e n t s o b s e r v e d that this d e s i g n d e c i s i o n
160 cm) had to be accurate to within +/- 5 cm, and had to dramatically reduced the branch factor o f the search tree (4
be obtained within 6 minutes from the time the robot was vs. 32), leading to a faster execution time for the game-
started. The project allowed use o f dead-reckoning and solver.
landmark-based navigation techniques. Although all teams The second stage required students to write a second Lisp
succeeded in this project, all were surprised at h o w short program that i n v o k e d functions in an ad h o c library
the 6-minute time limit soon appeared in light o f the d e v e l o p e d b y the instructor to send r e m o t e - c o n t r o l
accuracy constraint. m e s s a g e s to a M i n d s t o r m s robotic a r m m e c h a n i s m
IV. Capture-the-Balls Contest. This 1-month project's goal (designed by the instructor construction details available
-

was to help students tie the skills they developed in projects upon request) to m o v e pieces in an 8-Puzzle according to
I-III with search-state-based and hill-climbing-based agent the solution developed b y stage l ' s programming. It was in
designs (the third level o f Russell and N o r v i g ' s taxonomy). this stage that students discovered that the search space
reformulation trick ultimately cost them in the complexity
Each t e a m was required to design and build a robot no
o f the translation their second program had to perform on
larger than 1 cubic foot. The robot's task was to play in a
the " m o v e space" operator list to " m o v e tile at (2,2) to
4 5 - m i n u t e contest (based on [3], but adapted to fit
M i n d s t o r m s ' capabilities) against other t e a m s ' robots. (2,1)'" types o f commands.
Contestants had to play in a 20x9 sq. ft. walled playing area
in which each team had a 1 sq. ft. nest area, colored dark 5 Course Organization
purple. All other portions o f the playing field were light-
yellow colored. Scattered throughout the field were black, The Fall 1999 offering had 17 students: 15 c o m p u t e r
white, and yellow ping pong balls. For each ball that was in s c i e n c e m a j o r s , l p h y s i c s m a j o r , and 1 c o m p u t e r
a t e a m ' s nest at the end o f the contest, the following points engineering major. Projects I-V described in Section 4 were
were awarded: white +1, yellow +5, b l a c k - 1 . The playing assigned to 6 teams (three teams o f 3 and two teams o f 4).
field was marked with a black l x l - f o o t grid whose lines The Spring 2001 offering had only 4 students: 3 computer
were 1 cm wide. science majors, and 1 cognitive science minor (psychology
T e a m s were encouraged to try a wide variety o f g a m e major). The reduced class size led the instructor to decide
strategies, s o m e o f w h i c h r e q u i r e d l a n d m a r k - b a s e d to m a k e all four students w o r k on a single team w h o s e
navigation via the grid, others o f which required state-space Project Manager position rotated a m o n g the m e m b e r s for
h i l l - c l i m b i n g , and still others o f w h i c h relied on each project. In this offering the team worked on Project V I
probabilistic observations about the environment. Teams and III (in that order). The small size in the second offering
were also encouraged to make their use o f strategies time- is attributable to two factors: our department offered five
elective courses that semester instead o f the usual four

10
(leading to a dilution o f students across a larger number of students spend on design o f robot chassis. When asked to
courses) and the Spring 2001 CSC 4500 offering was rate their agreement with the statement "The design o f
scheduled as an evening course (which historically have hardware for an intelligent agent is every bit (if not more)
depressed enrollments at Villanova). To address potential important as the design o f software for an intelligent
reader concerns that the course's workload or design agent," at the beginning o f the robotics courses, the
unduly discouraged students from signing up, it should be respondents' average was 5.7 (1 being strongly disagree, 10
noted that as o f N o v e m b e r 2001 there are 24 students being strongly agree). After the course this same question
(computer science, astronomy, mechanical engineering, received an average agreement level o f 7.1.
biology, and computer engineering majors) enrolled for the Based on these observations from the (admittedly small) set
Spring 2002 offering of the course (one o f 4 CSC electives of students in the two course offerings, I argue that the
available, in a late-morning time-slot). robotics projects were a more positive than negative
influence on students' learning o f AI concepts, and a more
6 S t u d e n t and Project Evaluation positive than negative influence on students' appreciation
of the issues behind design of"hardware+software" agents.
As seen in students' p e r f o r m a n c e on e x a m i n a t i o n
problems, the robot projects did give them a strong
understanding o f the concepts highlighted in the project 7 Mindstorms Evaluation
goals in Section 4. In timed exams students were asked to While one may be able to conclude that this report's project
describe how (hardware or software) agents in all o f the
evaluations lend some more support to the claim that
Russel and Norvig taxonomy (including those not explicitly
robotics-oriented problems can be used successfully as a
e x p l o r e d in robot p r o j e c t s ) m i g h t be realistically
pedagogical tool for grounding abstract topics in computer
implemented for various environments. This type o f
science courses (at least, in artificial intelligence), several
abstract question was generally poorly answered in CSC
questions must be addressed before one can claim that
4500 offerings prior to Fall 1999. In the two robot-oriented
L E G O Mindstorms is a good platform for supporting
offerings students scored 20% higher.
projects of enough sophistication to produce these benefits.
Based on other exam questions, students in the robotic-
A commonly-cited criticism o f Mindstorms for use in
based CSC 4500 offerings were able to demonstrate their
college courses is that L E G O ' s GUI-based programming
understanding of the concept of "emergent behavior" better
support for the platform is too grade-school oriented. While
with very concrete robotic examples than those in earlier
true, I assert that the existence o f p r o g r a m m i n g
offerings. To be objective, however, it must be noted that
environments such as NQC and RCX-Ada [4] counter this
robotics students were more susceptible to making the
problem reasonably well. In the summer since the Spring
mistake o f believing that "emergent behavior" only refers
2001 c o u r s e o f f e r i n g , o p e n - s o u r c e p r o g r a m m i n g
to behavior that arises from errors in the interaction
environments for the Java [9], C++ [8], and Lisp [12]
between pieces o f a complex system rather than any
languages h a v e been developed for the M i n d s t o r m s
behavior (positive or negative) that arises from interactions platform. These languages should make Mindstorms more
between pieces o f a complex system.
e a s i l y integratable into any p r o g r a m m i n g - o r i e n t e d
Although it is not a stated goal o f the AI course, the computer science course as an alternative platform for
multitasking programs that students wrote in the robotics- exploring programming problems.
based offerings gave them much more confidence in
Another common criticism o f the Mindstorms kit is that it
working with multithreading issues, according to course
does not allow one to build sophisticated robots. Indeed, it
exit surveys (10 of 21).
might seem that the fact that this p a p e r ' s own robotics
All student survey respondents, while generally viewing toolbox (Section 3) needed the contents o f three individual
the robotics problems as positive influences on their Mindstorms kit is evidence in favor o f this claim. I hasten
learning, felt that the AI course should be expanded to a 4- to clarify this problem by observing that the only project
credit (4-hour/week) course to better reflect the workload. that required the material in more than one kit was Project
A large number (16 o f 21) o f student survey respondents V - T e a m - b a s e d Capture-the-Balls. It was, in fact,
also indicated that their impression of the difficulty o f anticipation of this project that led to the expansion o f the
sensing the environment and correctly interpreting sensors' basic team toolbox.
environmental measurements was mixed: h a l f felt the I do accept the criticism that the Mindstorms kit does not
problem was more difficult because the L E G O sensors contain an adequate number o f sensors to solve some
were inaccurate, while the other half felt that the problems interesting problems. In particular, the rotation sensor (aka
they had encountered were just indicative o f the nature o f "angle sensor") is crucial to any robust solutions to the
the general sensor interpretation problem. robotic navigation problem, yet it is not included in the
Along the same lines of "hardware evaluation," 12 o f the basic Mindstorms kit. I highly recommend that anyone
21 survey respondents felt that more planning should be contemplating use o f Mindstorms for college robotics
done by the instructor to reduce the time computer science projects add this sensor to their development budget!

11
While it is also true that the Mindstorms' platform only consideration b y any small college as a c o m p l e m e n t a r y
supports three input ports, this does not limit the platform's programming environment to tradtional PC programming.
sensory capability as m u c h as it would seem. In m y As more work is done in the open source community to
experience and m y students' experience, it is possible to ameliorate the unaddressed criticisms in Section 7, the
"stack" m o r e than one touch or light sensor on the same Mindstorms p l a t f o r m ' s p e d a g o g i c a l viability will only
port and to interpret the port's measurements appropriately. improve. To this end, I plan to work on extending the basic
That is, b y configuring (through an N Q C program) a port to L E G O firmware to include support for targeted message-
be in "raw mode," one will obtain an integer value between p a s s i n g and to d e v e l o p a s y s t e m for distributing
0 and 1024 that can be a n a l y z e d through r e p e a t e d computation within a robotic network.
experimentation to determine when one, two, or no sensors
on the same port have been activated. In some situations Acknowledgment
that I will discuss in m y lecture, one can even determine This material is based upon work supported by the National
which particular sensor in a stack has been activated. Science F o u n d a t i o n u n d e r G r a n t No. 0088884. A n y
When one is restricted to using the firmware supplied by opinions, findings, and conclusions or recommendations
L E G O in a M i n d s t o r m s robot, I believe f r o m m y expressed in this material are those o f the author and do not
experiences that it is a valid criticism that control programs necessarily reflect the views of the NSF.
are somewhat limited in size and capability. Primarily, this
is due to the firmware's lack o f support for a procedure call References
stack and dynamic m e m o r y allocation. However, now that
tools such as LeJOS (a native J a v a Virtual Machine for [1] ActivMedia Robotics, http://www.activrobots.eom
M i n d s t o r m s ) [9] and L e g O S (a C + + k e r n e l for [2] B a u m , D. N o t Q u i t e C ( N Q C ) , J u n e 2001,
Mindstorms) [8] exist, this criticism has less vigor. http://www.enteract.eom/-dbaum/nqe/index.html
It is still a valid criticism as well to claim that the [3] Beer, R. D., Chiel, H. J., and Drushel, R. F. "Using
Mindstorms' 32KB onboard m e m o r y represents a serious autonomous robotics to teach science and engineering,"
restriction for artificial intelligence instructors (like myself) Communications of the ACM, Vol. 42 (6) June 1999, pp. 85
who want to give students experience in working with real- - 92.
time schedulers and planners situated within robots. One [4] Fagin, B., Merkle, L., and Eggers, T. "Teaching basic
possible solution to this problem would involve designing a computer science concepts with robotics." In Proceedings
framework that offloads most o f the computation in these of the 32 "a SIGCSE Technocal Symposium on Computer
systems to a desktop, and then periodically issues remote- Science Education (2001).
control commands to the Mindstorms robot.
[5] Kumar. D., and Meeden, L. A robot laboratory for
A major criticism I do agree with is that the platform (and, teaching artificial intelligence. In Proceedings of the 29th
for now, even open-source enhancements) does not support SIGCSE Technical Symposium on Computer Science
useful wireless protocols over its built-in infrared port. All Education (1998).
Mindstorms programming environments that depend on the
standard L E G O firmware are limited to using a broadcast [6] Martin, F., The M I T H a n d y B o a r d Project, 2000.
protocol that does not support targeted message-passing http://lcs.www.media.mit.edu/groups/el/Projects/handy-
a m o n g robot teams or between a central control desktop board/, Sept. 6, 2001.
and a remotely-controlled set o f robots. This was a serious [7] Mazur, N. and Kuhrt, M. "Teaching p r o g r a m m i n g
problem for students working on Project V. concepts using a robot simulation," Journal o f Computing
A personal criticism m y students and I have in regards to in Small Colleges, Vol. 12, (5) 1997, pp. 4-11.
using the Mindstorms platform in m y Lisp-based AI course [8] Noga, Markus. LegOS, June 2001,
was that because there was no C o m m o n Lisp programming http://www.noga.de/legO S
environment for the platform, m y students had the added [9] Solorzano, Jose. LejOS, May 2001,
overhead o f learning N Q C in addition to Lisp. However, http://lejos.sourceforge.com
with new developments in W i c k et al.'s L e g o / S c h e m e
c o m p i l e r [12] and m y o w n future w o r k in a Lisp [10] Stein, L. A., Interactive programming: revolutionizing
Mindstorms remote-control library, I expect this criticism introductory computer science," A C M Computing Surveys
to disappear soon. 28A(4), December 1996.
[11] Russell, S. and Norvig, P. Artificial Intelligence: A
Modern Approach. Prentice Hall, 1995.
8 Conclusions and Future Work
[12] W i c k , A., K l i p s c h , K., and W a g n e r , M.
Based on the sophistication o f the projects in Section 4 and
LEGO/Scheme c o m p i l e r , v. 0.52, ( J u n e 2 0 0 1 )
the observations in Section 6 and Section 7, I claim that the http ://www.cs.indiana.edu/-mtwagner/legoscheme/
L E G O M i n d s t o r m s p l a t f o r m has g r o w n since its
introduction to b e c o m e a cost-effective platform worthy o f

12

View publication stats

You might also like