Download presentation
Presentation is loading. Please wait.
1
Maze Running Robots EGR106 Project Spring 2004
2
Project Goal Computer control (through a Matlab program) of a Lego robot to: 1.Explore a maze (start to end) 2.Recognize the final room to drop cargo 3.Return the robot to its starting place
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 90 o 2 turn right by 90 o 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
11
Programming Notes 4 parts: 1.Search/wander the maze 2.Build a map of what you see 3.Drop the cargo; analyze the map 4.Return to start
12
1.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
13
2.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 …..
14
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
15
Example Map 123456789101112 1 2 3 4 5 6 7 8 9 10 11 12 Legend: white = not adjacent red = closed wall green = open wall
16
3.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…..
17
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”
19
Path identified by tracing from “start” to “end” following decreasing costs Result: room path 1, 2, 6, 10, 11, 7, 8, 12 forward
20
4.Return to start –Convert reverse path to robot commands 12, 8, 7, 11, 10, 6, 2, 1 reverse
21
12 8 7 11 10 6 2 1 robot(1) robot(0) robot(2) robot(0) robot(2) robot(0) robot(1) robot(0) robot(1) robot(0) robot(2) robot(0)
22
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)
23
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
24
Schedule Today: –meet your team (Preassigned)Preassigned –brainstorm issues and ideas, ask questions Homework (due this Thursday): –team name
25
Schedule (continued) April 15, 20, 22, 27 & 29 –in-class work time –Quiz 3 on the 20 th –weekly reviews with me (5 minute schedule per team)schedule May 4: –Presentations including maze running demos
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.