Robot Lab
-
Upload
gillian-castillo -
Category
Documents
-
view
20 -
download
6
description
Transcript of Robot Lab
Slide 1
Robot Lab
William RegliDepartment of Computer Science
(and Departments of ECE and MEM)Drexel University
Slide 2
Robot Lab “Curiosity, earnest research to learn the hidden laws of nature, gladness akin to rapture,
as they were unfolded to me, are among the earliest sensations I can remember.”– Frankenstein, Mary Shelly
• General objectives for this class…– To explore the interaction between software & information and the physical world
by animating, via software, a robotic “creature”…– To use cyber-infrastructure to obtain and share the information needed to execute
the class
You
YourRoomba
Slide 3
Course Goals and Objectives
• Play with Roombas• Introduction to basic problems in robotics
– Experience them 1st hand with Roombas
• Document experiences in GICL Wiki for– Use by future generations of students– Development of outreach materials (I.e. K-12)– Development of demonstration materials
Slide 4
Topics to be covered in lectures
• Intro to Roomba
• Intro to Robotcs– Basics of robotics systems, sensor, etc– Basics of kinematics/dynamics– Robot Motion Planning & Path Planning
• Intro to multi-agent (multi-robot) coordination– Teamwork, distributed constraints, etc
Slide 5
Assignments
• This is a lab-intensive course, you’ll need to budget time to work on the Roombas
• Roomba assignments– Intro Roomba (what 600 freshman did)– Map making– Roomba coordination– Hunt the Wumpus (tentative)
• (possibly) Non-Roomba assignments– Path planning
Slide 6
Class Structure
• Supervisory Professor: WC Regli
• Recitation Lecturers:– Mr. Michael Grauer– Mr. David Wilkie– Mr. Evan Sultanik
• Teaching Assistant and Hardware Tsar– Ms. Megan Thurber
Slide 7
Grading
• If you finish all of the assignments, you get an “A”– If not, the proportion of finished
assignments will be determined by the class instructor team
Slide 8
What is Cyber-Infrastructure?
• Cyber-Infrastructure: – organized aggregate of technologies that enable us to
access and integrate today’s information technology resources to facilitate science and engineering goals.
• data and storage, computation, communication, visualization, modeling, simulation, networking, scientific instruments, expertise and people
• Analogy to other kinds of “infrastructure”, typically created for the general public good– Interstate Highway System, Power Grid, Panama Canal, etc
• Drexel University is the national leader in CI– Only institution w/ 4 active NSF Cyber-Infrastructure Grants
SCI-0537370, SCI-0537125, OCI-0636273, OCI-0636235
Slide 9
Drexel’s CI-TEAM
• Lead Institution: Drexel University– PI William Regli, co-PI Michael Piasecki
• University of Maryland @ College Park– SK Gupta
• University of North Carolina @ Chapel Hill– Ming Lin and Dinesh Manocha
• University of Wisconsin @ Madison– Nicola Ferrier, Vadim Shapiro, Krishnan Suresh
Slide 10
About the Team
• W. Regli– CS, ECE and Mech E– 1997 NSF CAREER
• M. Piasecki– Civil
• SK Gupta– Mech E– PECASE, CAREER,
and ONR YIP
• M. Lin– CS– CAREER
• D. Manocha– CS– PYI, ONR YIP, Sloan
Fellow
• N. Ferrier– Mech E– NSF CAREER
• V. Shapiro– Mech E, Math & CS– NSF CAREER
• K. Suresh– Mech E
Slide 11
Examples of Cyber-Infrastructure
• Networks– Internet, DragonFly
• Data & Knowledge– IMDB to MedLine
• Software Tools– Firefox, MediaWiki,
Skype, Apache, etc.• Communities/People
– SourceForge, Flickr, discussion boards, email lists, …
• Resources & Repositories– SourceForge, GNU, etc
Slide 12
Role of Cyber-Infrastructure(in this class)
• Class Wiki– http://gicl.cs.drexel.edu/wiki/Robot_Lab_%28Spring_2007%29
• Project materials and “How-To” Wiki– http://gicl.cs.drexel.edu/wiki/Category:Roomba_Design_Lab_%28Winter_2007%29
• “Roomba Questions” email list– Subscribe at
http://face.cs.drexel.edu/mailman/listinfo/spring2007-roomba-lab
• Other web resources– Accessible from the Roomba Wiki
Slide 13
Introducing the Roomba
• Introduced in 2002 by iRobot– Company founded by MIT AI legend
Rodney Brooks
• Roombas manufactured after October 2005 contain an electronic and software interface that allows you to control or modify Roomba's behavior and remotely monitor its sensors– The iRobot Roomba Open Interface is
intended for software programmers and roboticists to create their own enhancements to Roomba.
– “Roombatics”: the general science of modifying or programming your Roomba
Slide 14
Highlights from the History of Robotics
Fiction:– Jewish folklore, a golem ( גולם ) is
an animated being created from inanimate matter.
– “Robot”, from the Czech/Slovak word robota, labor or work.
– The word robot first appeared in Karel Čapek's science fiction play R.U.R. (Rossum's Universal Robots) in 1921.
– Fritz Lang’s Metropolis (1926)– Word was brought into use by Isaac
Asimov.– Patron Saint: the HAL 9000
Non-Fiction– Tesla’s remote
controlled boat– SRI’s Shakey– NASA
• Voyager• Pathfinder• Spirit/Opportunity
– Sony Aibo– Honda ASIMO– DARPA Grand Challenge
http://robotics.megagiant.com/history.htmlhttp://en.wikipedia.org/wiki/Robotics
Slide 15
The Future for Robotics
• Existing Applications– Exploration
• Space, undersea
– Haz-Mat Duties• Disaster recovery, inspection
• Nuclear waste management
– Manufacturing• Mining, assembly, welding
– Military• Unmanned Ground, Aerial,
Sea, Undersea Vehicles
• Emerging Applications– Aging Societies
• Over the last century, the age distribution of the U.S. population changed from relatively young to relatively old.
– Medical• Surgical robotics• Tele-medicine• Prosthetics
– Consumer• Electronics, automotive,
entertainment, toys, games
Slide 16
Sprawl robot: SprawlitaMulti-University Research InitiativePI: Mark R. Cutkosky (Stanford University)
JPL Serpentine Robot
Tuna robot: VCUUVDraper Laboratory, Cambridge, MA
Slide 17
Tour of the Roomba
Slide 18
Tour of the Roomba
Slide 19
Tour of the Roomba: The Vitals
• Roomba Serial Port• MiniDIN male-male
cable• USB adapter
Slide 20
Tour of the Roomba: The Vitals
• IR Wall Sensors
– You may want to use these to implement wall following behavior
Slide 21
The Roomba Challenges
1. The Chutes
2. The Maze
3. The Great Escape
4. Name that Tune
NIST Rescue Robot LeagueMaze (2004)
Slide 22
Roomba Challenge #1:The Chutes
“The legal and philosophic aspects of obedience are of enormous importance.”
--- "The Perils of Obedience”, Stanley Milgram
• Problem: Given a detailed and exact layout of the world, with single exit path and no possible wrong turns or shortcuts, implement a set of instructions (i.e. a path) for the Roomba so it can navigate the start to the finish
• Objective: minimize time, minimize distance to finish line
Slide 23
Roomba Challenge #1:The Chutes Example
ST
AR
T
FIN
ISH
10m.
3m.
1m
.
3m
6.0508m1m
.
3m
3m
.
3m.
1m.
1.5
m
Slide 24
Roomba Challenge #1:Implementation Challenges
• Getting Roomba/computer set up working• The path/world is explicit; you are doing manual path
planning with complete information---how will you get the robot to follow the path you select?
• Could solve this without the use of sensors by– Dead reckoning– Hard coding (bump-turn-bump-turn etc)
• Error will be introduced by the movement of the vehicle, friction, uncertainty in orientation and initial set up
Slide 25
Roomba Challenge #2:The Maze
"You are in a maze of twisty little passages, all alike“--Colossal Cave Adventure Game, 1976
• Problem: – The night before the competition, we will release the
dimensions/configuration for a different maze of chutes– The Roomba is placed in a maze in a pre-determined starting
location; there will be only one path out, but there may be dead-ends and detours
– Your job: implement an algorithm to find a path out of the maze• Modify existing code for pre-set maze that night OR• Write code for general maze solving
• Objective: minimize time and minimize distance within the maze to the finish line
Slide 26
Roomba Challenge #2:The Maze Example
ST
AR
T
FIN
ISH
How to find the
shortcut?
Slide 27
Roomba Challenge #2:Implementation Challenges
• You need to use the Roomba sensors– Develop a different strategy because robots may
encounter dead-ends, non-right-angled walls, etc– There may be short cuts that are hard to ‘sense’
• Might not be able to get out without some additional info from sensors or a combination of sensing and hard-coding
• Should be able to get most of the way with hard-coding and dead reckoning
Slide 28
Roomba Challenge #3:The Great Escape
"I'm making this up as I go.“--Indiana Jones, 1936.
• Problem: – The Roomba is placed in an arbitrary maze in an arbitrary
starting location; there will be only one path out, but there may be dead-ends and detours; the maze may be reconfigured between trials
– Your job: implement an algorithm to find a path out of the arbitrary maze
• You will not have time to modify existing code, you’ll need to write code for general maze solving and test it
• Objective: simply exit the maze
Slide 29
Roomba Challenge #3:Escape Example
ST
AR
T
FIN
ISH
x
Slide 30
Roomba Challenge #3:Implementation Challenges
• This is a tricky assignment– We will not give you the maze; maze config may
change between trials; starting point may change
• You need to implement some kind of maze exit strategy– This will take some work…
• You will not be able to hard-code• Mazes will change
– Hence, cannot change code during the day
Slide 31
Roomba Challenge #4:Name That Tune
“I sing the Body electric;”--Walt Whitman (1819–1892), Leaves of Grass.
• Problem: Program the Roomba to play one or more of the following tunes– The Drexel Ode– Fanfare for the Common Man, A. Copeland– Thus Spake Zarathustra, R. Strauss– The Imperial March (Darth Vader's Theme), John Williams
• Objective: Play the tune– Bonus!!: a chorus of many Roomba doing the Drexel Ode together!! Get your lab-mates together…
Slide 32
Roomba Challenge #4:Implementation Challenges
• Find the sequence of notes/keys– The set of notes can be shared, posted to the
discussion board, etc.– MIDI files, sheet music are available on the web
• Setting up the Roomba-Midi encoder– http://todbot.com/blog/2006/05/03/roombamidi-
roomba-as-midi-instrument/
• This one shouldn’t be that hard and should be a lot of fun– Feel free to get carried away!
Slide 33
Implementation Tools
Slide 34
• Hacking Roomba: ExtremeTech – by Tod E. Kurt
• Published Dec 2006!• Exercises are derivative of
those in this book• A mere $17! • All code, examples, etc are
available at http://hackingroomba.com/NOTE: you don’t really need the
book, all info is available via the cyber-infrastructure…
Slide 35
Everything is on the Wiki!http://gicl.cs.drexel.edu/wiki/Category:Roomba_Design_Lab_%28Winter_2007%29
Slide 36
Summary of Module Instructions
• Subscribe to mailing list• Connect the Roomba to Your Computer
– Cable, bluetooth, etc• Set up Processing
– An open source programming language and environment for people who want to program images, animation, and sound. Simple programming, no compiling; cut-and-paste examples.
• Install RoombaComm– RoombaComm is a Java library created by Tod E. Kurt that
allows users to communicate with Roomba through a high-level language (Java); Processing uses it.
• Roomba Program 1– A “Hello Roomba” program
Slide 37
Summary of Module Instructions
• Subscribe to mailing list• Connect the Roomba to Your Computer
– Cable, bluetooth, etc• Set up Processing
– An open source programming language and environment for people who want to program images, animation, and sound. Simple programming, no compiling; cut-and-paste examples.
• Install RoombaComm– RoombaComm is a Java library created by Tod E. Kurt that
allows users to communicate with Roomba through a high-level language (Java); Processing uses it.
• Roomba Program 1– A “Hello Roomba” program
DO
BE
FO
RE
YO
U C
OM
E T
O
RE
CIT
AT
ION
Slide 38
Processing• What it is
– A simple, interactive, programming language, with full access to Java & Java classes and class libraries
– Simple IDE (Integrated Development Environment), with source code editor, compiler, debugger
– It’s free and open source (if you don’t like it you can modify it)
• Why use it– Quick implementation and testing, perfect for trying out ideas– Lightweight programming environment, just edit source and run– Look ma, No Compiling!– Cross Platform Capability
• Assures same version Java VM– Produces applications for OSX, Windows, Linux
• Note: you are welcome not to use it in favor of C/C++/Java/C#/Perl/Python... etc… but you are on your own.– Tools do exist for roomba hacking in these other languages
Slide 39
Processing: Example Commands
• spinRight(float "degrees") • spinLeft() • goForward() • goBackward() • updateSensors() • playNote() • bump() • bumpLeft() • bumpRight() • wall()
Slide 40
Processing: Example Program
// **WALL FINDING** // - Simple loop that reiterates until it sees a wall // - When it hits left bump sensor, it turn 45 degrees right, and// - vice versa; When it finds a wall, it exits loop, and code can// - be implemented afterwards for another behavior while( ! roombacomm.wall()) // while its not seen a wall { roombacomm.goForward(); // keep going forward until… if (roombacomm.bumpLeft()) { roombacomm.spinRight(45); } else if (roombacomm.bumpRight()) { roombacomm.spinLeft(45); } roombacomm.updateSensors(); }
Slide 41
Processing: Example Program
// **WAGGLE** // - This is a behavior used by the roomba when it is search for// - something. It is seen when roomba is wall-following in// - cleaning mode. roombacomm.drive(velocity, radius) -->// - measurements in millimeters done = false; while ( ! done ) {
roombacomm.drive(200,600); roombacomm.pause(250); roombacomm.drive(200,-600); roombacomm.pause(250);
}
Slide 42
Suggested Approach
• Read the Wiki before you come to recitation• Review the Hacking Roomba website
– Many useful things there• Have software set up on your laptops and ready to go• Familiarize yourself with editing the program elements
– Some basic ‘bump-then-turn’ code may be useful• Be prepared to debug issues such as
– Port conflicts, I/O issues, can’t talk to USB devices, etc.– These will all be situation dependent, and specific to your individual laptop– Suggestion: bring more than one laptop
• You may want to build a test-rig for work outside of class• TAs and Co-ops will be available to help set up
and configure BUT … getting skills in downloadand configuring hardware-software systems is one of the goals of this module!
Slide 43
To Do Before Recitation
• Subscribe to mailing list • Connect the Roomba to Your Computer
– Cable, bluetooth, etc• Set up Processing
– An open source programming language and environment for people who want to program images, animation, and sound. Simple programming, no compiling; cut-and-paste examples.
• Install RoombaComm– RoombaComm is a Java library created by Tod E. Kurt that
allows users to communicate with Roomba through a high-level language (Java); Processing uses it.
• Roomba Program 1– A “Hello Roomba” program
DO
BE
FO
RE
YO
U C
OM
E T
O
RE
CIT
AT
ION
Slide 44
Expected Module Pitfalls
• Computer-Roomba configuration– Getting software installed, talking to the Roomba, getting “hello world” to work– This is very environment centric, part of the assignment is for teams to work
this out for at least one machine in your group• Program construction
– Format or syntax problems, unexplained errors, understanding commands– Give yourself time to learn, explore, test & debug. You will not succeed if
you try everything the night before!• Roomba anomalies
– Roomba doesn’t go exactly straight, commands not exact, etc– Welcome to the real world! Dealing with these problems is part of the
assignment.• Software/Algorithm Design
– Don’t make matters too complex. Most of the credit can be gotten via brute force hard coding. However, to fully solve the challenges will require some more sophistication and use of the sensors on the robot.
Slide 45
Suggested Ways to Handle Pitfalls
• Use the mailing list and post questions– At least one member per-team should subscribehttp://face.cs.drexel.edu/mailman/listinfo/roomba-07-questions
• Share insights and information with others– You are scored based on the competition, not based on
configuration of your laptop
• Post hacks, tricks, suggestions and ideas to the list and message board– Major issues will be addressed by the faculty, most
problems are going to be configuration-related
• Use the web and the wiki
Slide 46
The First Assignments
• The Chutes– Fixed maze, in the recitation room
• The Maze– Fixed maze, availability TBD
• The Great Escape– Not a fixed maze, but a family of reconfigurable
ones, set up on the day of the contest and periodically changed during the day
• i.e. you’ll need to implement a maze solver (wall follower or similar) to get out of this
Slide 47
Contest Scoring
• All about time to completion• You must complete the event
– Partial completions will not count (unlike for grading)
• Roomba’s will be timed• No remote control allowed• Objective:
– Complete all the events – Have the lowest cumulative time
Slide 48
Questions?
Unsuccessful Project Successful Project
Slide 49
OK, Great, so we get to program robots to exit mazes… where is the Science and Engineering?
Slide 50
Roomba Challenges #3 & #4:General Maze Solving Algorithms
http://en.wikipedia.org/wiki/Maze#Solving_mazes• Wall Follower• Pledge algorithm• Random mouse• Tremaux's algorithm
Slide 51
Roomba Challenges #3 & #4:General Maze Solving Algorithms
http://en.wikipedia.org/wiki/Maze#Solving_mazes• Wall Follower (a.k.a. Depth First Search)• Pledge algorithm• Random mouse• Tremaux's algorithm
Slide 52
Graph Theory
• History– Leonhard Euler and the
Seven Bridges of Königsberg (1736)
• Problem areas– Subgraphs– Graph Coloring– Network Routing– Network Flow– Visibility– Covering, Embedding
The Bridges of Königsberg
Slide 53
Graph Theory Today
• Graphs are everywhere!• Examples:
– Google’s PageRank algorithm was developed by Page and Brin in an undergrad CS class
– Network communications is about least-cost paths
– Logistics plans for WalMart, FedEx, UPS rely on route planning and map data
– Recommender systems, social networks, etc … all graphs!
– Molecular modeling, computational pharmacology, protein folding all use graphs as their basic data structure
Slide 54
An example
Slide 55
Graph Theory and Mazes: A Change of the Representation
• The physical topology of the maze can mapped into a Graph
• A Graph G can be represented as an ordered pair of setsG = <V, E> where V is the set of vertices and E is the set of edges
• Note that each edge is really a pair as well– i.e. ei = <vk, vj > means that there is an edge
between vertices vk and vj
Slide 56
Slide 57
Slide 58
Slide 59
The Basic DFS Algorithm
dfs( v ) process( v ) /* do what needs to get done*/mark v as visitedfor all vertices i adjacent to v not visited
dfs( i )
• Typical application questions– How to traverse the successor vertices?– How to order/process vertices in your output
• Pre-order (Polish notation) … the above is pre-order.• Post-order (reverse Polish notation)
Slide 60
Depth First Search
Slide 61
Depth First Search
Slide 62
Depth First Search
Slide 63
Depth First Search
Slide 64
Depth First Search
Slide 65
Depth First Search
Slide 66
Depth First Search
Slide 67
Depth First Search
Slide 68
Depth First Search
Slide 69
Depth First Search
Slide 70
Depth First Search
Recurse back up the tree…
Slide 71
Depth First Search
Slide 72
Depth First Search
Slide 73
Depth First Search
Slide 74
Depth First Search
Slide 75
Depth First Search
Slide 76
Slide 77
Properties of DFS: Time
• DO NOT measure time with a clock!
• Doing DFS on a graph G with vertices v1, v2, … vn and edges e1, e2, … em
– What is the Time Complexity? (i.e. # of discrete computational steps)
• Best Case?• Worst Case?• Average Case?
Slide 78
Properties of DFS: Time
• Doing DFS on a graph G with vertices v1, v2, … vn and edges e1, e2, … em
– What is the Time Complexity? (i.e. # of computational steps)
• Best Case: you go right to the solution, no backtracking, and the solution is close by
– d steps, where d is the length (i.e. depth) of the shortest path to the soln from the start state
• Worst Case?• Average Case?
Slide 79
Properties of DFS: Time
• Doing DFS on a graph G with vertices v1, v2, … vn and edges e1, e2, … em
– What is the Time Complexity? (i.e. # of computational steps)
• Best Case: d• Worst Case: check every node in the tree
– n steps
• Average Case?
Slide 80
Properties of DFS: Time
• Doing DFS on a graph G with vertices v1, v2, … vn and edges e1, e2, … em
– What is the Time Complexity? (i.e. # of computational steps)
• Best Case: d• Worst Case: n• Average Case: … depends on the structure of the
“tree”…. Not answerable without more info.– Theoretically very difficult problem involving graph theory,
combinatorics and statistics
Slide 81
Properties of DFS: Space
• How much computer memory is needed?• Doing DFS on a graph G with vertices
v1, v2, … vn and edges e1, e2, … em
– What is the Space Complexity? (i.e. how many nodes in memory?)
• Need to store – All nodes on the longest path
– All nodes that “branch” from that path
• This is path-independent– Best Case Scenario and Worst Case Scenario are the same!
Slide 82
Properties of DFS: Space
• One needs Best Case Scenario and Worst Case Scenario are the same– Storage needs,
where d is the longest path and b is the “branching factor” (i.e. the maximum # of edges or degree for a vertex), are d·b
….
“width” of the tree is named b, for “branching factor” b
d
Slide 83
Other Applications/Assignments
• Mapping
• Navigation
• Hunt the Wumpus
Slide 84
Example: MappingThe CMU Millibots
• Modular DesignPlanning & Control
Computation
Motor control
Localization
IR obstacle detection
Communication
Payload:• sonar• camera
• Plug & Play interface
Common Bus:• communications• power12x7x14 cm
Communication
Localization
Motor control
IR
Interface
Interface
Interface
Interface
Interface
...
Slide 85
• Occupancy certainty grids with Bayesian integration:
• Integration of multiple sensor readings
• Integration of multiple local maps
T
T SSFS2
1 ).(Prob),.(Prob).(Prob
0% (Free)
50% (Unknown)
100% (Occupied)
Application: Collaborative Mapping
OccupancyProbability
new sensorreading
Integration of multiple readings
Slide 86
Accumulating Knowledge
• ‘bots communicate to commander agents to create view of the world
• View is propagated back to ‘bots
• ‘bots coordinate their activities to refine world view
Slide 87
Collaborative Exploration
• Robot Agents store global map and determines exploration frontiers
• Robots Agents explore nearest frontier that is not yet being explored by other robots
• Exploration finishes when no more unexplored frontiers exist
Explorationfrontier
Currentgoal
Slide 88
Questions?
Unsuccessful Project Successful Project