1 / 62

Simple Maze-Solving Robots solving search in real time

Simple Maze-Solving Robots solving search in real time. On line and off line search. Robot knows start and goal locations. Robot knows coordinates. search. Off line. Robot knows description, can recognize when seen. Robot does not know the start and goal locations.

Download Presentation

Simple Maze-Solving Robots solving search in real time

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Simple Maze-Solving Robots solving search in real time

  2. On line and off line search Robot knows start and goal locations Robot knows coordinates search Off line Robot knows description, can recognize when seen Robot does not know the start and goal locations Robot knows start and goal locations Robot knows coordinates On line Robot knows description, can recognize when seen Robot does not know the start and goal locations Has a map Robot Creates a map

  3. Goals of this lecture • Illustrate real-time search in maze by a simple mobile robot • Investigate the capabilities of the NXT robot. • Can we use Mindstorms NXT for serious research in Search? • Explore development options

  4. Problem Outline • Robot is placed in a “grid” of same-sized squares • (Due to obscure and annoying technical limitations, the robot always starts at the “southwest” corner of the maze, facing “north”) • Each square can be blocked on 0-4 sides (we just used note cards!) • Maze is rectangularly bounded • One square is a “goal” square (we indicate this by covering the floor of the goal square in white note cards ) • The robot has to get to the goal square

  5. Using NXT you can build quickly all kind of robot prototypes • Uses basic “driving base” from NXT building guide, plus two light sensors (pointed downwards) and one ultrasonic distance sensor (pointed forwards) • The light sensors are used to detect the goal square, and the distance sensor is used to detect walls

  6. Robot Design, cont’d Ultrasonic Sensor LightSensors

  7. Robot Design, cont’d

  8. Search Algorithm • Robot does not know the map. • Simple Depth-First Search • Robot scans each cell for walls and constructs a DFS tree rooted at the START cell • As the DFS tree is constructed, it indicates which cells have been explored and provides paths for backtracking • The DFS halts when the GOAL cell is found

  9. Maze Structure

  10. DFS Tree Example

  11. DFS Tree Data Structure • Two-Dimensional Array Cell maze[MAX_HEIGHT][MAX_WIDTH] typedef struct { bool isExplored; (= false) Direction parentDirection; (= NO_DIRECTION) WallStatus[4] wallStatus; (= {UNKNOWN}) } Cell; • Actually implemented as parallel arrays due to RobotC limitations

  12. DFS Algorithm while (true) { if robot is at GOAL cell victoryDance(); if there is an unexplored, unobstructed neighbor Mark parent of neighbor as current cell; Proceed to the neighbor; else if robot is not in START cell Backtrack; else return; //No GOAL cell exists, so we exit }

  13. Simple example of robot traversing unknown labyrinth to get to the goal

  14. Simple example • Example 3x3 maze GOAL

  15. We start out at (0,0) – the “southwest” corner of the maze • Location of goal is unknown

  16. Check for a wall – the way forward is blocked

  17. So we turn right

  18. Check for a wall – no wall in front of us

  19. So we go forward; the red arrow indicates that (0,0) is (1,0)’s predecessor.

  20. We sense a wall

  21. Turn right

  22. We sense a wall here too, so we’re gonna have to look north.

  23. Turn left…

  24. Turn left again; now we’re facing north

  25. The way forward is clear…

  26. …so we go forward. • “When you come to a fork in the road, take it.”–Yogi Berra on depth-first search

  27. We sense a wall – can’t go forward…

  28. …so we’ll turn right.

  29. This way is clear…

  30. …so we go forward.

  31. Blocked.

  32. How about this way?

  33. Clear!

  34. Whoops, wall here.

  35. We already know that the wall on the right is blocked, so we try turning left instead.

  36. Wall here too! • Now there are no unexplored neighboring squares that we can get to. • So, we backtrack! (Retrace the red arrow)

  37. We turn to face the red arrow…

  38. …and go forward. • Now we’ve backtracked to a square that might have an unexplored neighbor. Let’s check!

  39. Ah-ha!

  40. Onward!

  41. Drat!

  42. There’s gotta be a way out of here…

  43. Not this way!

  44. Two 90-degree turns to face west…

  45. Two 90-degree turns to face west…

  46. No wall here!

  47. So we move forward and…

  48. What luck! Here’s the goal. • Final step: Execute victory dance. 

  49. Movement and Sensing • The search algorithm above requires five basic movement/sensing operations: • “Move forward” to the square we’re facing • “Turn left” 90 degrees • “Turn right” 90 degrees • “Sense wall” in front of us • “Sense goal” in the current square

More Related