Shop OBEX P1 Docs P2 Docs Learn Events
Maze navigation using Infrared headlights? — Parallax Forums

Maze navigation using Infrared headlights?

chroncilechroncile Posts: 2
edited 2010-06-03 17:34 in Learn with BlocklyProp
Hi, I am trying to make my Boe-Bot navigate a maze and get to the end. I am trying to make it so if the Boe-Bot reaches a wall, it does not turn around and go back the same way it came from.

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2010-06-03 02:43
    Hi Chroncile,
    There needs to be something unique about the wall or area at the end of the maze as opposed to the rest of the maze.

    Could you maybe put one more sensor pointing down and have a black piece of tape (if white floor, or white tape otherwise), or perhaps use the photoresistor and light source? Some sensor & environment combination that would be unique to the end of the maze.

    -Martin
  • chroncilechroncile Posts: 2
    edited 2010-06-03 03:42
    I don't think there is a wall at the end of the maze; I think it's a maze where the Boe-Bot goes in and comes out and that's the point of it. My teacher told us to make a Boe-Bot that can travel through the maze. She told us to make it so the Boe-Bot does not end up making a U-Turn and end up going back the way it came from.
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2010-06-03 13:36
    OK, I'm not sure your programming skill or what level of class this is for, but you can keep track of how many times it turn in one direction, you may be able to keep it from turning back around. Take small turns, and count how many of the small turns it takes in either direction. If the number of turns in one direction (left or right) are excessively higher than the other, then maybe it needs to turn back.

    But if the maze is a majority of left turns, for example, it may cause problems for you.

    I would seriously ask your teacher for some hints, since they designed the task, they should have some ideas on how it could be accomplished.

    -Martin
  • JendaJenda Posts: 1
    edited 2010-06-03 17:34
    Hi,

    not sure what grade you are in, but for remembering the track, you should use tree type structure (oriented graph) and memorize (strored value in an array or someting) turns you did.
    It is called depth search ( http://en.wikipedia.org/wiki/Depth-first_search ). If this is too dificult for your class (grade) than you should store in the variable at least the last turn, so when you hit dead end in the maze and you go back, you can evaluate and turn in the oposite ( or different ) direction.
    Hope this helps...

    J
Sign In or Register to comment.