Robotran: A programming environment for novices in LEGO-land

Robotran: A programming environment for novices in LEGO-land

Robots: The Friendly Motivating Machine R. Mark Meyer Canisius College Computer Science Department Buffalo, NY 1 Outline 1. Robots in the college curriculum 2. Learning goals 3. Our robots 4. Courses 5. Languages 6. Assignments 7. Experiences and conclusions 2

Robotics in the college 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) Courses Computer Science introductory and senior AI HONORS program science elective

First Year Seminar (writing course) Engineering 111 3 Goals Recruit new CS majors Retain current CS majors Make the general studies courses more accessible and fun Provide new science elective for HONORS curriculum Motivate freshmen to learn how to write better Improve early programming skills for CS majors

Introduce AI concepts to juniors/senior CS majors 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 Robots used at Canisius Lego Mindstorms RCX (approximately 30) Lego Mindstorms NXT (approximately 60)

Sony AIBO (6) [The cute white dogs, no longer made] Create from IRobot (1) [A vacuum-less Roomba] ER-1 (2) [Evolution robotics, requires a laptop] Funded by the in-house grant plus a $70,000 NASA grant 5 Our penbots (RCX) RCX penbot

LEGO Mindstorms RCX introduced in 1998, sold over one million 6 Our penbots (NXT) NXT roverbot LEGO Mindstorms NXT introduced in 2006; much different from RCX; reliability issues (failure rate is about 50%) 7

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 CSC 360 Intelligent Systems: AI, robotics, knowledge bases

CSC 391/491 Seminar, 1 credit hour special projects FYS 101 First year seminar focused on writing skills 1/3 of the labs are robots 8 Languages NXT-G -- graphical programming language Lejos and Lejos NXJ Java plus robot libraries

Robolang front end for Lejos used in Robotran NQC and Brixcc tiny C variants for engineering Python used with Create and talking to openCV (vision system) 9 NXT-G Graphical language Used in FYS 101 Not free Intuitive and easy to learn Has some problems

IDE weaknesses inherent problems with non-textual language, e.g. interruptions 10 Robotran Translator program Robolang a simple Pythonish language Translator to true Lejos Used as standalone Java app Compiles and downloads 11 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 12 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 13 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 14 Our simulator

Simulate the penbot, only one at a time, geared towards real assignments Dont get overly caught up with 3d graphics Provide functionality with both Robolang and Lejos 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 Kudos to students! David Puehn did initial design and coding of the simulator Kevin Mastropaolo took over 2 years ago and did phenomenal debugging and extending 15 Screenshot of Simulator Assignments Early courses (majors and non-majors)

CSC 109 Build robots for competition using Robolang CSC 110 Write programs to draw things using Robolang EGR 111 Write programs using bricxcc FYS 101 Write programs using NXT-G to learn programming CS 1 (usually majors) 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. Create robots (Roombas without the vacuum) 17 Activities & Assignments (CSC 111) 1. 2.

3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Robot acts like a sentry (back and forth) Robot avoids obstacles by randomly turning after bumps Robot randomly moves around (Brownian motion) Robot responds to input through the buttons Robot plays music Robot senses light values and displays numbers on LCD Robot goes forward only when flashlight is turned on Robot turns to find light if low light level is sensed Robot uses more elaborate schemes to find light source Robot remembers direction of last successful turn to find light

Robot is taught a path which it can then replay (uses arrays) Robot receives input from bumps and button presses, including binary or unary numbers 13. Robot draws a letter based on input number 18 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) 19 Strategies for worthwhile assignments (This applies only to CSC 111 assignments.) Dont 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). 20 Experiences and conclusions Surveys show a strong positive attitude on part of students The comments are lavish with praise, but a few thought the RCX robots were too primitive FYS 101 students learned to program NXTs using NXT-G in an amazingly short timeframe (2 weeks) CS 1 students said 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 21 Our experiences and conclusions (2) We need a lot of help in the labs (so we hire student helpers) Grading must be different because we cant download and test every single program Robot labs take a lot more time for students to complete; cant do as much pure CS

We need to staff after-hours lab time 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 So far, no theft and almost no breakage! NXT failure rate is alarmingly high, about 50% 22 Current and future work Finish debugging the Robotran simulator and port to NXT Use NXTs lejos NXJ in CSC 111 next spring Develop a platform for CREATEs that uses Python and OpenCV

Continue refining first year seminar using lessons learned Investigate other, more reliable robots for Engineering 23 Our Contact Information SOFTWARE tab on left: Several versions of robotran COURSES tab: the CSC 111 assignments and Robolang programs

Canisius Magazine Fall 2006 email addresses: [email protected] [email protected] [email protected] 24

Recently Viewed Presentations

  • JFK and the Cuban Missile Crisis - Northland Preparatory Academy

    JFK and the Cuban Missile Crisis - Northland Preparatory Academy

    The Cuban Missile Crisis. October 1962. US spy planes photographed the construction of Soviet nuclear missile silos being constructed in Cuba. In response, Kennedy issued a naval blockade of Cuba to prevent the Soviets from placing further weaponry there
  • Acrysof Toric IOL Implantation to Correct Post-Penetrating ...

    Acrysof Toric IOL Implantation to Correct Post-Penetrating ...

    Acrysof Toric IOL Implantation to Correct Post-Penetrating Keratoplasty Astigmatism Jonathan M. Davidorf, MD Los Angeles, CA ASCRS Annual Meeting San Francisco, CA April, 2009 I have no financial interest in the products, devices, or techniques discussed in this presentation
  • Outpatients episode volume distribution by week and cancer ...

    Outpatients episode volume distribution by week and cancer ...

    What is the challenge? 13,000 patients >50,000 consultations per year. 270, 2 week wait referrals per year. 60 New Cancers per year. Qualitative (narrative) vs Quantity
  • Securing Big Data - Kaizen Approach

    Securing Big Data - Kaizen Approach

    Big Data value. In the eye of the beholder. Value is defined through hypotheses and data modeling of the data sets. Data which had been collected in the normal course of business can now be mined and correlated to find...
  • Japan: An Ancient and Modern Adventure Summer 2015

    Japan: An Ancient and Modern Adventure Summer 2015

    Fundraising: Car wash and odd jobs letter Passports: Valid through Dec 2015 Upcoming dates/ meetings Questions/concerns Parent traveler meeting (Last 10 min) All information and slides are available at Agenda Albrecht Stacy Albrecht Jason Benson Laura Garnett Jill Haley...
  • Standing Up to Implicit Bias Karen B. Francis,

    Standing Up to Implicit Bias Karen B. Francis,

    Implicit Association Tool (IAT) Project Implicit was founded as a multi-university research collaboration in 1998 (University of Washington, Harvard University, University of Virginia). Fosters dissemination and application of implicit social cognition research.


    SIXTH FLORIDA SERVICE SYMPOSIUM. MARCH 12 - 15, 2015. ... RR's rules is the law of the land since 1876. So doesn't that make Robert's Rules the most up to date process? ... Discussion takes the form of a debate...
  • Global Hydro-Estimator CDR

    Global Hydro-Estimator CDR

    Background. The Hydro-Estimator has been run in real-time at STAR since 2005. The CONUS Hydro-Estimator algorithm is applied to data from GOES-E and -W, METEOSAT-7 and -9, and MTSAT-1, using NAM data for the adjustments where available and GFS data...