1 / 25

Maze Running Robots

Maze Running Robots. EGR106 Project Spring 2004. Computer control (through a Matlab program) of a Lego robot to:. Explore a maze (start to end) Recognize the final room to drop cargo Return the robot to its starting place. Project Goal.

myra
Download Presentation

Maze Running Robots

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. Maze Running Robots EGR106 Project Spring 2004

  2. Computer control (through a Matlab program) of a Lego robot to: Explore a maze (start to end) Recognize the final room to drop cargo Return the robot to its starting place Project Goal

  3. You will not be assembling the robot, but controlling it • Basic control will be through a Matlab function Typical robot circa 2002

  4. Maze Assumptions • Size is known • Start is at the lower left corner, robot pointing up/north • Drop site for the cargo is at the upper right corner

  5. The Robot Interface MATLAB function robot.m: [l,c,r] = robot(command) • one input value • three binary outputs

  6. Value for command (plus the robot always looks around): 0  drive forward one unit (room) 1  turn left by 90o 2  turn right by 90o 3  do nothing (just look around) 4  play a sound (drop the cargo) ≥ 10  initialize and run the simulator

  7. Three binary output variables: • Returned for all commands • Denote the presence or absence of wall openings from the current room/orientation • Left, Center, Right walls only • Value = 1 for opening present, 0 for no opening • Note – result is dependent upon the orientation of the robot.

  8. Output is [ L, C, R ] = [ 1 0 0 ] Output is [ L, C, R ] = [ 1 1 0 ]

  9. Robot Simulator • Useful for program development • Virtual robot, much faster than the real thing • Available 24/7 (download file) • Includes multiple practice mazes to test your programs – maze and robot progress shown in a figure window

  10. Programming Notes 4 parts: • Search/wander the maze • Build a map of what you see • Drop the cargo; analyze the map • Return to start

  11. Search/wander the maze • Make good moves – remember that the goal is to get to the upper right corner; don’t just make random turns, aim the robot • Keep track of the robot location – row and column notation makes it easy to recognize the end room • Orientation determines where the robot goes

  12. Build a map of what you see • At the beginning you know nothing of the maze; for each new room visited, you learn a bit more • Use the map to help the exploration (i.e. recognize areas/directions to be ignored, don’t revisit rooms, …) • One idea on mapping is …..

  13. A map “matrix” for a M by N maze: • Number the rooms 1 to M*N • The (m,n) and (n,m) entries (identical) describe the connection between rooms m and n using 3 values: • connection unknown • no direct connection • a direct connection

  14. Example Map Legend: white = not adjacent red = closed wall green = open wall

  15. Drop the cargo; analyze the map • Identify the end room by beeping • Use the map matrix to find a short path back to start • While many ideas could be tried, one simple analysis tool is Bellman’s flooding algorithm…..

  16. Bellman’s flooding algorithm: • Start analysis at the “end” room • Assign costs to each room of going from that room to the end • Sequentially expand to connected adjacent rooms • Stop when you hit “start”

  17. Path identified by tracing from “start” to “end” following decreasing costs • Result: room path 1, 2, 6, 10, 11, 7, 8, 12 forward

  18. Return to start • Convert reverse path to robot commands 12, 8, 7, 11, 10, 6, 2, 1 reverse

  19. 12 8 7 11 10 6 2 1 robot(1) robot(1) robot(0) robot(2) robot(0) robot(2) robot(0) robot(1) robot(0) robot(1) robot(0) robot(0) robot(2) robot(0)

  20. Team Deliverables • Working program(s): • electronic copy for testing • written description (with examples) • Written report: • details of format later • Oral Presentation to class: • each person describes an aspect of the work • Due May 4 (final class day)

  21. Scoring in the Demonstration • Sum of two parts (a lower score is better): • 1 point per forward movement while searching • 2 points per forward movement while returning • Must: • Drop the cargo in the “end” room • Return to “start” • Not cross walls

  22. Schedule • Today: • meet your team (Preassigned) • brainstorm issues and ideas, ask questions • Homework (due this Thursday): • team name

  23. Schedule (continued) • April 15, 20, 22, 27 & 29 • in-class work time • Quiz 3 on the 20th • weekly reviews with me (5 minute schedule per team) • May 4: • Presentations including maze running demos

More Related