CPE 471 

03/18/15

 

Final Project Proposal - Robot mouse in maze simulator

 

Introduction

A graphical simulator which can read a maze file and generate a three dimensional maze. The program will then place a three dimensional mouse in one of the corners of the maze. The mouse can then be controlled using the keyboard arrow keys. The program will also have an application program interface(API) where another process running on the same computer can move the mouse and also extract sensor information from it. The end goal is, a secondary process will use the sensor information from the simulator to create its own map of the maze and solve it. Here is a link to the demo

 

 

General Information

Keyboard Mapping

Up       —> Move forward

Right   —> Rotate right

Left     —> Rotate left

M        —> Camera from mouse perspective

B         — >Moving Camera always facing mouse

C         —> Free Camera

        A         —> Strife Camera left

        D         —> Strife Camera right

        W        —> Move Camera forward

        S         —> Move Camera backward

P        —> Turn sensors off

O        —> Turn sensors on

 

API

MoveForward(float x)

Move mouse forward by x units

RotateCW(float x)

Rotate mouse clockwise by x degrees

RotateCCW(float x)

Rotate mouse counter clockwise by x degrees

CheckSensor(string location)

Read sensor output from locations(left, top-left, top-right, right) and send it back as a digital value

 

 

Graphic technologies

Collision detection - I have used collision detection to make sure mouse can’t go through walls. /The basic just of it is, before the mouse moves, I calculate the new pixel location of the mouse, then I obtain the walls that are around the mouse at the movement and check to see if the new pixel co ordinate is within those bounds.

 

Sensor reading - Very similar to collision detection, however I needed the exact location of the wall, so I calculate the vector from each of the sensor protruding outward, then increment it gradually till I hit the wall or go beyond the visible limit. When the projected sensor ray is inside the bounds of any wall, I return the scale factor of the vector at that point.

 

 

To get it working

Setup your openGL as usual using cMake or whatever, then make sure to match the source directory with the exact same contents as the attached zipped source folder. Run the executable as usual.

 

To interface with AI program

Navigate to source/maze_source in terminal run the make command this will generate binary. Run the openGL simulator this will open a socket called maze_simulator ready to receive connections. Then from source/maze_source in terminal run the command ./flood_fill maze_simulator. Sit back and watch the program solve the maze.

Link to source

​Actual run from previous year