1 Jun 2003 05:03
Re: maze solving algorithm
Bluey <Wolf_and_eagle <at> spamblock.yahoo.com>
2003-06-01 03:03:36 GMT
2003-06-01 03:03:36 GMT
In lugnet.robotics, "scott davis" <rcx2man <at> hotmail.com> wrote: > I'm using a rotation sensor and a HiTechnic Distance Sensor. > > > I'd like the robot to search the whole maze. > > It's a maze but i'd like to do something more than just follow a wall. Does the distance sensor swivel to scan the surrounding area and identify walls or passages? Ok, if you are going for the mapping and logical searching idea, then its going to be a lot more complicated. First off, to logically maneuver through a maze, you need to remember the maze that you've been through. Now, to identify the maze layout, you'll need the robot to keep a record. Typically, you'd use 5*5=25 variables (in an array), but that would restrict your variable usage a huge amount (32-25=8 ...... try navigating comfortably with that!). So instead, you can use a type of compression. Since the variables in NQC are limited to 16 bit signed integers, the number can only go up to 65536. Each square of the maze has 4 walls, which can either be there or not. So 2 options per wall ^ 4 walls = 16 possible combinations. Unless you can think of another type of compression, this is what I think you are going to have to do. Starting with the “east” wall and traveling around clockwise, we will give each wall a binary digit. So if the east and west walls were passages, and the north and south were walls, the number would be 0101 (Binary) = 5 (Decimal). Next, if(Continue reading)
RSS Feed