West Virginia University College of Engineering and Mineral Resources. Computer Engineering 313 Spring 2010



Similar documents
Analysis of Micromouse Maze Solving Algorithms

Merging Labels, Letters, and Envelopes Word 2013

Doña Ana County, NM Interactive Zoning Map

Situation Analysis. Example! See your Industry Conditions Report for exact information. 1 Perceptual Map

FREE FALL. Introduction. Reference Young and Freedman, University Physics, 12 th Edition: Chapter 2, section 2.5

EMBEDDED C USING CODEWARRIOR Getting Started Manual

Q&As: Microsoft Excel 2013: Chapter 2

Bank Reconciliation: Improvements for the Shelby v5 Spring 2006 Release

Introducing Improved Access to Your Patient Web Results

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

ExmoR A Testing Tool for Control Algorithms on Mobile Robots

Scan Physical Inventory

Business Portal for Microsoft Dynamics GP User s Guide Release 5.1

Using Microsoft Project 2000

5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.

DATA ANALYSIS II. Matrix Algorithms

Matrix Multiplication

Tutorial 4 - Attribute data in ArcGIS

Excel 2003 PivotTables Summarizing, Analyzing, and Presenting Your Data

Excel 2013 Sort: Custom Sorts, Sort Levels, Changing Level & Sorting by Colored Cells

State of Michigan Data Exchange Gateway. Web-Interface Users Guide

A Beginning Guide to the Excel 2007 Pivot Table

Math Content by Strand 1

Microsoft Office. Mail Merge in Microsoft Word

EE 242 EXPERIMENT 5: COMPUTER SIMULATION OF THREE-PHASE CIRCUITS USING PSPICE SCHEMATICS 1

5. Binary objects labeling

ORACLE MANUFACTURING MATERIAL PLANNING FOR PROCESS MANUFACTURING

Solving Systems of Linear Equations Using Matrices

Routing with OSPF. Introduction

Representing Vector Fields Using Field Line Diagrams

2011, The McGraw-Hill Companies, Inc. Chapter 3

The following is an overview of lessons included in the tutorial.

The resulting tile cannot merge with another tile again in the same move. When a 2048 tile is created, the player wins.

Design a Line Maze Solving Robot

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

Check out our website!

Building Instructions: Maze Robot

PARALLELIZED SUDOKU SOLVING ALGORITHM USING OpenMP

Microsoft Excel 2013 Step-by-Step Exercises: PivotTables and PivotCharts: Exercise 1

Spreadsheets and Laboratory Data Analysis: Excel 2003 Version (Excel 2007 is only slightly different)

LabVIEW Day 6: Saving Files and Making Sub vis

1.2 Linear Equations and Rational Equations

Excel Unit 4. Data files needed to complete these exercises will be found on the S: drive>410>student>computer Technology>Excel>Unit 4

An Introduction to Excel Pivot Tables

Series and Parallel Resistive Circuits

Smartboard and Notebook 10 What s New

Top 10 Excel Questions WHY A TECHTORIAL?

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions.

Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

FRACTIONS COMMON MISTAKES

STATISTICS AND DATA ANALYSIS IN GEOLOGY, 3rd ed. Clarificationof zonationprocedure described onpp

KS3 Computing Group 1 Programme of Study hours per week

Lab 3 Microcontroller programming Interfacing to Sensors and Actuators with irobot

Excel 2007: Basics Learning Guide

Lesson 4.3: Using the VLOOKUP Function

Operation Count; Numerical Linear Algebra

12-6 Write a recursive definition of a valid Java identifier (see chapter 2).

CATIA Basic Concepts TABLE OF CONTENTS

Introduction to Pivot Tables in Excel 2007

PURPOSE OF GRAPHS YOU ARE ABOUT TO BUILD. To explore for a relationship between the categories of two discrete variables

Creating Web Pages with Microsoft FrontPage

RIP: Routing Information Protocol

Part 3: GridWorld Classes and Interfaces

Face detection is a process of localizing and extracting the face region from the

CompSci-61B, Data Structures Final Exam

ACCESS 2007 BASICS. Best Practices in MS Access. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

Commission Formula. Value If True Parameter Value If False Parameter. Logical Test Parameter

Interactive Excel Spreadsheets:

Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C

Efficient Data Structures for Decision Diagrams

Microsoft Using an Existing Database Amarillo College Revision Date: July 30, 2008

CALIBRATING YOUR SYSTEM. Follow our guidelines carefully to ensure proper system function. EQUIPMENT

HOW TO VIEW AND EDIT PICTURES

Lab 1: The metric system measurement of length and weight

In This Issue: Excel Sorting with Text and Numbers

Excel Basics By Tom Peters & Laura Spielman

Create Charts in Excel

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

BASF D6Direct. User s Manual

I PUC - Computer Science. Practical s Syllabus. Contents

Arithmetic and Algebra of Matrices

Lab 7.1.9b Introduction to Fluke Protocol Inspector

Instructions for creating a data entry form in Microsoft Excel

CUSTOMER+ PURL Manager

6 Series Parallel Circuits

2x 2x 2 8x. Now, let s work backwards to FACTOR. We begin by placing the terms of the polynomial inside the cells of the box. 2x 2

DATA STRUCTURES USING C

Autonomous Advertising Mobile Robot for Exhibitions, Developed at BMF

Internet Control Message Protocol (ICMP)

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Drawing a histogram using Excel

Data Visualization. Prepared by Francisco Olivera, Ph.D., Srikanth Koka Department of Civil Engineering Texas A&M University February 2004

Using Formulas, Functions, and Data Analysis Tools Excel 2010 Tutorial

Introduction to Microsoft Access 2010

Parallax Serial LCD 2 rows x 16 characters Non-backlit (#27976) 2 rows x 16 characters Backlit (#27977) 4 rows x 20 characters Backlit (#27979)

Transcription:

College of Engineering and Mineral Resources Computer Engineering 313 Spring 2010 Laboratory #4-A (Micromouse Algorithms)

Goals This lab introduces the modified flood fill algorithm and teaches how to implement the algorithm using the C Programming Language. Background Maze Solving Algorithms As introduced in the first experiment this semester, a micromouse is a small robotic mouse whose goal is to solve a maze. The mouse is to be completely autonomous and must find its way from the starting position to the central area of the maze without any intervention. To solve the maze, the mice can implement one of many different searching algorithms such as the flood fill, modified flood fill, A*, etc. In the first lab this semester, you learned how to initialize the two matrices used in the modified flood fill algorithm that is used to solve the maze: wall map and maze distance values. Distance values are the number of moves that the mouse must take in order to reach its destination (one of the center six units of the maze). Flood Fill Algorithm To first introduce the modified flood fill algorithm, let s first take a look at the flood fill algorithm. The flood fill is a simple algorithm that determines the area connected to a given node in a multi-dimensional array. It sets the goal values (destination cells) to zero and floods the surrounding cells with radiating, increasing values. Figure 1 provides an example. Figure 1: Flood Fill Algorithm [1] 2

Examining Figure 1, notice that the center value is zero and all other cells are filled with values corresponding to their distance from the goal cell. After flooding the maze with values, the algorithm then searches the adjacent nodes for the smallest value to determine which cell to travel. It then continues to follow the values in descending order until it has reached the center. This algorithm is rather simple and provides a reliable method to finding the center of the maze; however, the modified flood fill algorithm can find the center more quickly so we will introduce this algorithm. Modified Flood Fill Algorithm The modified flood fill algorithm is similar to the flood fill algorithm for it also uses distance values to navigate the maze. The primary difference is that the modified flood fill algorithm does not flood the entire maze with values. It modifies only the values that need to be changed. For example, if a wall is encountered and the robot is not in the destination cell, it updates the value of that cell to 1 + the minimum value of its open neighbors. Figure 2 shows an example of this process. Figure 2: Modified Flood Fill Algorithm [1] Examining Figure 2, when the robot encounters a wall to the east and can only move north or south. The north and south cells (open neighbors) are checked and we find that the current cell s new value is 1 + the minimum value of its open neighbors or 1+3=4. 3

Once the robot has found the destination cell, it can return to the beginning of the maze using the distance values. On return, it is often a good practice to double check the wall positions. Once the micromouse has returned to the beginning, the maze is solved and the mouse can scamper off for a speed run to the center of the maze. So, the modified flood fill process for updating the distance values is: Figure 3: Updating Distance Values with Modified Flood Fill Algorithm [1] Using the algorithm from Figure 3, the modified flood fill algorithm now becomes the following and should be executed every time the mouse enters a new cell. 1. Update the wall map Activity #1 2. Update the distance values (only if necessary) (modified flood fill) Activity #2 3. Determine which neighbor cell has the lowest distance value Activity #3 4. Move to the neighboring cell with the lowest distance value Activity #4 4

Procedure Using your CodeWarrior Project and in particular your LCD functions from the previous labs, complete the following activities. Activity 1: Write a function that updates the wall map as the mouse travels through the maze keeping into consideration the direction the mouse is facing. For example, the mouse will start from position (0, 0) facing North using the directional notation shown below. To test your function, traverse the highlighted path in the figure below where the mouse starts in the bottom left cell of the maze facing the north direction. Reminder: If you chose to use the same directional notation shown above, your initialize wall function that was written in lab #1 should have been initialized as follows. Example: void UpdateWallMap (byte direction) // Based on direction of the mouse // Read each sensor value that the mouse can see. In this case, examine each wall that the mouse can see in its current orientation (Left, Right, Forward) 5

// Update the walls array You can use the following array if necessary to test your function. This wall map corresponds to the maze shown in the figure above. byte testwalls[13][6] = {{11, 0, 0, 11, 0, 0},{10, 0, 0, 10, 0, 0},{10, 0, 0, 10, 0, 0}, {2, 5, 5, 14, 0, 0}, {10, 0, 0, 3, 9, 0}, {10, 0, 0, 14, 10, 0}, {2, 9, 0, 0, 10, 0}, {14, 10, 0, 0, 10, 0}, {0, 10, 0, 0, 10, 0}, {0, 10, 0, 0, 10, 0}, {0, 6, 5, 5, 14, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}; Activity 2: Write a function that implements the modified flood fill algorithm from Figure 3. This function updates the maze's distance values as the micromouse traverses the maze. Reminder: The maze distance value initialization function should have initialized the distance values as shown in Figure 4. Originally, it may be easier to debug your function using the Instruction Set Simulator and Real-time debugger. Figure 4: Initialized Distance Values Activity 3: Write a function that checks all the potential next moves to determine which neighboring cell has the lowest distance value (being careful on the outer walls for example there is no row 1 position when at position (0, 0) in the maze. Essentially, you will want to check the following cell s distance values to determine where to move: (row 1, row + 1, column + 1, and column 1). One suggestion in how to store this information is to store the row value in the upper nibble of a byte and the column value in the lower value of a byte. 6

Activity 4: Update your mouse s new position (x, y) move to the appropriate cell. Test your functions using the maze in Figure 5. Display the position of the mouse and distance value on the LCD as you use your algorithm to traverse the maze. Figure 5: Example Maze with wall values Lab Notebook 1. Include a brief description of what was accomplished in this lab. Be sure to include all functions with comments. (40 points) 2. Explain the role(s) of the proximity sensors in the micromouse algorithm (5 points). 3. If you were building the micromouse, how many sensors would you use? Why? (5 points). 4. Identify at least two other potential micromouse algorithms? Are the advantages or disadvantages to these algorithms over the modified flood fill algorithm? Explain (5 points) 5. List any problems that you encountered in the lab and suggestions for improvement of the lab. If no problems were encountered or you have no suggestions, please state NONE. (5 points) References 1. http://www.micromouseinfo.com/introduction/mfloodfill.html 7

8