Dr. Mark Meyer's talk at the NXT workshop in Ole Miss

advertisement
Robots: an educational
revelation in CS
at a Jesuit College
R. Mark Meyer
Canisius College
Buffalo, NY
1
Outline
1. Our grant
2. Our learning goals
3. Our robots
4. Our courses
5. Our languages
6. Our assignments
7. Our experiences and conclusions
2
Our grant to put robotics into curriculum
• 2006 We were awarded an in-house 3-year grant to introduce
robotics into the curriculum.
• It is called the Peter Canisius Distinguished Teaching Professorship
– Deb Burhans (CS and Bioinformatics)
– Mark Meyer (CS)
– David Sheets (Physics and Pre-engineering)
• Impact plans
–
–
–
–
Course revision
New courses, some in core curriculum and HONORS programs
Outside speakers
Training events for local high school teachers
• After 1 year, we have met many goals and are on-track
• This July we will sponsor a NXT training session for local teachers
3
Our Goals (curricular)
•
•
•
•
•
•
Recruit new CS majors
Retain current CS majors
Make the general studies courses more accessible and fun
Improve early programming skills for CS majors
Introduce AI concepts to juniors/seniors
Learning Goals: the students will know...
1.
2.
3.
4.
how to describe and define a robot
how to interface robot sensors & motors using Java
how to better program traditional loops, decisions, subprograms
how to describe some AI challenges and techniques
4
Our robots
• Lego Mindstorms RCX (approximately 30)
• Lego Mindstorms NXT (approximately 23)
• Sony AIBO (6) [The cute white “dogs”, no longer made]
• ER-1 (2) [Evolution robotics]
• Create from IRobot (1) [A vacuum-less Roomba for robot
experiments] – just got this!
• (Funded by the in-house grant plus a $70,000 NASA grant)
5
Our penbot
The Pen bot
a roverbot with
an attached pen
so it can draw,
like turtle
graphics.
(This bot was
based on other
bots described
elsewhere,
including the
2005 workshop.)
6
Our courses
• CSC 110 – A “CS 0” course
• CSC 109 – Another “CS 0” course that is solely robotics
• EGR 111 – Introduction to engineering (pre-engineers)
• CSC 111 – Our Java-based “CS 1”
1/3 of the labs are robots
• CSC 360 – Intelligent Systems: AI, robotics, knowledge bases
• CSC 391/491 – Seminar, 1 credit hour special projects
7
Our Assignments
• Early courses (majors and non-majors)
– CSC 109 Build robots for competition using Robolang
– CSC 110 Write programs to draw things
– EGR 111 Write programs using bricxcc
• CS 1 (usually majors)
– CSC 111 Use lejos for wide variety of tasks (listed later)
• Junior/Senior courses (majors)
– CSC 360 Robot competition, wumpus world, track following
– Seminar Variety of tasks: Sony AIBO, ER-1, etc.
8
Our Translator: Robotran V.1
Translator program
 Robolang – a simple
Python-ish language
 Translator to true Lejos
 Used as web applet or
standalone Java app
 Can compile and
download
9
Robolang Details
• Streamlined syntax for assignments and control structures,
especially button handler methods
• Uses Java expression syntax and transparently inserts into the
final Lejos code
• Simplified robot commands:
– go forward 10 seconds
• Motor.A.start();
• Motor.B.start();
• try { Thread.sleep(10000); } catch (Exception e) {}
• Simplified function (method) syntax
10
Simple Light Follower program
program follow1
constant BLACK = 42
loop
var lightvalue = S3
display lightvalue
if lightvalue < BLACK then
stop
else
go forward
end
end
11
Light Hunter
program follow4
global constant BLACK = 42
global var turnedLeft = 1
loop
var lightvalue = S3
display lightvalue
if lightvalue < BLACK then
do findLight
else
go forward
end
end
define huntLeft() returns number
turn left sharp 25 degrees
var lightvalue = S3
if lightvalue > BLACK then
return 1
else
turn right sharp 25 degrees
return 0
end
end
define huntRight() returns number
turn right sharp 25 degrees
var lightvalue = S3
if lightvalue > BLACK then
return 1
else
turn left sharp 25 degrees
return 0
end
end
define findLight
var result
if turnedLeft = 1 then
result = huntLeft()
if result = 1 then
return
end
result = huntRight()
if result = 1 then
turnedLeft = 0
return
end
end
if turnedLeft = 0 then
if huntRight() = 1 then
return
end
if huntLeft() = 1 then
turnedLeft = 1
return
end
end
end
12
Our simulator
• Simulate the penbot, only one at a time, geared towards real
assignments
• Don’t get overly caught up with 3d graphics
• Provide functionality with both Robolang and Lejos
• Make it flexible for future implementation on NXT
• Use the lejos compiled code that makes calls to the firmware
ROM
• Create our own ROM object with same API and let the compiled
code, running in tinyVM, call it
• Then our ROM object sends updates to a graphics simulation
object
• Special credit to senior David Puehn for his exceptional
programming and design help on the simulator.
13
Screenshot of new Robotran and Simulator
Activities & Assignments (CSC 111)
1. Robot acts like a sentry (back and forth)
2. Robot avoids obstacles by randomly turning after bumps
3. Robot randomly moves around (Brownian motion)
4. Robot responds to input through the buttons
5. Robot plays music
6. Robot senses light values and displays numbers on LCD
7. Robot goes forward only when flashlight is turned on
8. Robot turns to find light if low light level is sensed
9. Robot uses more elaborate schemes to find light source
10. Robot remembers direction of last successful turn to find light
15
Activities and Assignments (CSC 111)
11. Robot is taught a path which it can then replay (uses arrays)
12. Robot receives input from bumps and button presses, including
binary or unary numbers
13. Robot draws a letter based on input number
16
Activities and Assignments (upper level)
These are used in the robot competition, which can be entered by
anyone in any class, from beginning to junior/senior level.
1. Robot follows a line on the floor, part of drag race competition
2. Robot tries to stay within a sumo ring while pushing another
robot outside the ring
3. Robot navigates a maze (needs to remember path & obstacles)
17
Activities and Assignments (CSC 360)
• LEGO Mindstorms competition last 2 years
• “In 360 we only used the Aibos this year (2007.) Students
learned how to control them using Pyro and completed basic
labs on movement and vision. Then they worked on the wumpus
world challenge with the low level operations using Pyro and
high level KR&R using SNePS with the architecture that
connects SNePS to Pyro that Alistair and I created.” (Deb
Burhans)
18
Strategies for Worthwhile assignments
(This applies only to CSC 111 assignments.)
• Don’t try to accomplish too much in one program! … keep the
time-frame in mind and how much out-of-lab time they can have.
• Reinforce structured programming (use given methods and
construct new ones; emphasize problem decomposition).
• Require use of appropriate data structures (usu. Arrays).
• Get them thinking about AI issues, especially flexible problemsolving strategies and multiple alternatives.
• Progress from simple to several more complex versions of same
problem, e.g. the light follower.
• Use the button press model to reinforce listeners and handlers
which are used in other aspects of Java (like GUIs).
19
Our experiences and conclusions
• Surveys show a strong positive attitude on part of students
• The comments are lavish with praise, but a few thought the
robots were too primitive
• CS 1 students say the robots motivate them to stay in CS
• More CS 0 students are going on to CS 1 for the fun of it,
especially the CSC 109 students
• No significant change in CS 1 final grades or other indicators of
acquisition of programming skills
• Students in 110 and 109 liked Robolang better than Lejos when
they got into 111
• In our robot competition, groups used brixcc, Lejos and
Robolang and did comparably using any language
20
Our experiences and conclusions (2)
• We need a lot of help in the labs (so we hire student helpers)
• Grading is a pain (can’t download and test every single
program)
• Robot labs take a lot more time for students to complete; can’t
do as much
• We need to staff after-hours lab time
• So far, no theft and almost no breakage!
• Students respond much more positively when each has their
own robot to program; group exercises in 110 (made necessary
by large number of students) were less gratifying
21
Our future plans
• Finish the Robotran simulator
• Port it to the NXT
• HONORS science elective on robotics in Spring 2008
– D. Burhans will teach
– LEGO robot programming will be used for concrete activities
– Readings, movies, discussions and papers will accompany
• Continue fulfilling broader goals of the Peter Canisius DT
professorship
22
Our Contact Information
• cs.canisius.edu/~robotics
– SOFTWARE tab on left: Several versions of robotran
– COURSES tab: the CSC 111 assignments and Robolang programs
• email addresses:
– meyer@canisius.edu
– burhans@canisius.edu
– sheets@canisius.edu
23
Download