MEM380 Applied Autonomous Robots Fall Breadth First Search Depth First Search A* and Dijkstra s Algorithm
Admin Stuff Course Website: http://robotics.mem.drexel.edu/mhsieh/courses/mem380i/ Instructor: M. Ani Hsieh 159 Curtis Hall mhsieh1@drexel.edu Teaching Assistants: Bill Mather thomas.w.mather@drexel.edu Location: PISB 109 Pre-requisites: Linear Algebra Linear Differential Equations 2
Admin Stuff Cont. Main Text & Software: Principles of Robot Motion: Theory, Algorithms, and Implementations Computer Unreal Tournament 2004 (UT3 At your own discrection) USARSim (Freeware) Supplemental Texts: Introduction to Mobile Autonomous Robots Probabilistic Robotics Grading: Assignments 40% Final 40% Participation 10% Teamwork 10% Misc: Assignments must be e-mailed to MEM380.grader@gmail.com Assignments are due on Mondays @ 11:59 pm unless otherwise specified. Assignments, w/ exception of code, must be submitted in electronically via e-mail in PDF format. The file MUST BE a single PDF file and must NOT exceed 5MBs. All Matlab code submission must conform to the guidelines outlined in each assignment. If we cannot run your code, it WILL NOT be graded. Late submissions WILL NOT be accepted 3
Assignments & Office Hours Assignments are individual assignments You may work together, BUT everyone MUST submit their own work. Time & Location of Office Hours Prof. Hsieh Mon 4:00-5:00pm, 159 Curtis Hall w/ exception of Week 2, Week 2 Wed 4:30-5:30pm in Hess 10F Bill Mather Thurs 3:00-5:00pm, Hess 10F Equipment Personal Laptop w/ Wireless capabilities 4
Basic Goals of Programming Coding with a purpose Utility Usability Maintainability http://en.wikiversity.org/wiki/introduction_to_programming 5
Compiled vs Interpreted Compiled Modified into binary and permanently stored Machine-readable only Interpreted Human-readable form At run-time, an interpreter modifies the content into binary as it is run 6
Common Problems Common mistakes programmers make Utility Program does not work as it is suppose to Program does not do a job better than an alternative program Usability Too complicated or too simple to be useful Maintainability You or other people cannot understand the programming behind your program http://en.wikiversity.org/wiki/introduction_to_programming 7
Motion Planning What is Motion Planning? Determining where to go 8
Historical Perspective Searched-based AI Courtesy of Howie Choset 9
Historical Searched-based AI STRIPS Action Planning (1960) Motion Planning -> More than a search Courtesy of Howie Choset 10
Live Motion Planning Experiments Person 1 walks through some obstacles Person 1, looking at Person 2, directs Person 2 through obstacles Person 1, looking at Person 2 with eyes closed, directs Person 2 through obstacles Person 1, looking at a map and not Person 2, whose eyes are still closed, directs Person 2 through obstacles Person 1, looking at an object and Person 2, whose eyes are closed, directs Person 2 to grab an obstacle How do we do the last experiment with a map? Courtesy of Howie Choset 11
What Did We Assume? Perfect sensors? What information Uncertainty Perfect control? What controls? Uncertainty Perfect thinking? Knowledge of the world? Complete? Processing the world? Everything? What Else? Courtesy of Howie Choset 12
Robots Courtesy of Howie Choset 13
Robots Courtesy of Howie Choset 14
Trends in Robotics/Motion Planning Classical Robotics (mid-70 s) exact models no sensing necessary Hybrids (since 90 s) models based at higher levels reactive at lower levels Reactive Paradigm (mid-80 s) no models relies heavily on good sensing Probabilistic Robotics (since mid-90 s) seamless integration of models and sensing inaccurate models, inaccurate sensing Courtesy of Howie Choset 15
Example of a World and a Robot Courtesy of Howie Choset 16
Basic Path Planning Problem Statement: Compute a continuous sequence of collision-free robot configurations connecting the initial and goal configurations Geometry of environment Geometry and kinematics of Robot Path Planner Collision Free Path Initial and goal configurations Courtesy of Howie Choset 17
Topics Graph Search (BFS, DFS, A*, D*) Bug Algorithms Curve Following Roadmaps Potential Functions Obstacle Avoidance 18
Preliminaries Completeness of a motion planning algorithm An algorithm is complete if, in finite time, it finds a path if such a path exists or terminates with failure if it does not. Computational efficiency of an algorithm Scalability when consider multi-robot apps 19
Motion Planning as Graph Searches Abstraction representation of a collection of items A collection of vertices & edges V 1 V 2 e 45 V 5 V 3 V 4 e 13 e 34 e 23 e 46 V 6 V e 1 45 V 5 V 3 V 4 e 13 e 34 e 46 V e 23 e 46 V 6 2 V 2 Terminology Adjacency Paths and Cycles Degree of a vertex Fully connected graphs 20
Types of Graphs Directed vs. Undirected Weighted vs. Unweighted w 13 w 23 w 34 w 45 w 46 21
Types of Graphs Cyclic vs. Acyclic Trees Root Child/Leaf 22
Graph Representation: Example A F Objective: We want to represent all possible ways to get from configuration A to B using a graph HOW? 23
Graph Representation: Example A B C D E F 24
Search in Path Planning Find a path between two locations in an unknown, partially known, or known environment Search Performance Completeness Optimality Operating Costs Space Complexity Time Complexity 25
Search Uninformed Search Use no information obtained from the environment Blind search: BFS (Wavefront), DFS Informed Search Use evaluation function More efficient Heuristic Searchers: A*, D*, etc. 26
Uninformed Search: BFS Graph search from A to N Queue A B C D E F G H I J K Pop here Push here BFS L M N 27
Uninformed Search: DFS Graph search from A to N Stack A B C D E F G Push and Pop here DFS H I J K L M N 28
Informed Search: A* Notation n node/state c(n 1, n 2 ) the length of an edge connecting n 1 and n 2 b(n 1 ) = n 2 backpointer of a node n 1 to a node n 2 29
Informed Search: A* Evaluation/Cost Function f(n) = g(n) + h(n) Operating Cost Function g(n) Actual operating cost of having been traversed Heuristic Function h(n) Information used to find promising nodes to traverse Admissible never overestimate the actual path cost Cost on Grid 30
N Start O is empty? N Pick n best frm O s.t. f(n best ) f(n) Remove n best frm O & add it to C n best = goal? Expand all nodes x who are nbrs of n best & not in C Y Y End End A*: Algorithm The search requires 2 lists to store information about nodes 1. Open list (O) stores nodes for expansion 2. Closed list (C) stores nodes which we have explored N x is not in O? Y Update b(x)=n best if g(n best )+c(n best ) < g(x) Add x to O 31
Two Examples of Running A* 32
Example (1/5) 33
Example (2/5) 34
Example 3/5 35
Example 4/5 36
Example 5/5 37
A*: Example (1/6) 38
A*: Example (2/6) 39
A*: Example (3/6) 40
A*: Example (4/6) 41
A*: Example (5/6) 42
A*: Example (6/6) 43
A*: Example Result 44
Dijkstra s Search: f(n) = g(n) 1. O = {S} 2. O = {1,2,4,5}; C = {S} (1,2,4,5) all point back to S 3. O = {1,4,5}; C = {S,2} (there are no adjacent nodes not in C) 4. O = {1,5,3}; C = {S,2,4} (1,2,4, point to S; 5 points to 4) 5. O = {5,3}; C = {S,2,4,1} 6. O = {3,G}; C = {S, 2, 4, 1} (goal points to 5 which points to 4 which points to S) 45