Shop OBEX P1 Docs P2 Docs Learn Events
Script on how to make a boebot go through a maze — Parallax Forums

Script on how to make a boebot go through a maze

SafetyMooseSafetyMoose Posts: 6
edited 2011-01-07 18:27 in BASIC Stamp
I want to make my boebot go through a maze for my cat to play i read the book accept i dont know which scripts to put in there. and i dont have all the time in the world can someone help thanks

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-01-04 17:36
    Please do not cross-post (post essentially the same question in more than one forum). It's against forum rules.

    Doing mazes is a complex problem. The BoeBot has to sense paths to the side and front of the BoeBot. You are likely to need additional sensors. A PING))) with the associated servo bracket could work. To find its way, the BoeBot also has to remember what branches it's tried so far so it won't repeat something it's tried and failed at. There's limited memory available for storing this map, so the information has to be encoded in some compact form. This is not something you're going to be able to do quickly and it's not something you're going to find ready-made. Even if you could find someone else's program, you're going to have to modify it for your maze structure.
  • SafetyMooseSafetyMoose Posts: 6
    edited 2011-01-06 11:28
    alright how can i make my boe bot go in a oval shape?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-01-06 11:39
    Think about it this way ... You've got two wheels, one on either side of the BoeBot. If they go at the same speed, but in opposite directions, the BoeBot should go forward in a straight line. If one wheel goes slower than the other, the BoeBot will turn in the direction of the slower wheel. For an oval, you want the BoeBot to first turn relatively quickly, then gradually turn slower, then more quickly, then slower again, then more quickly, etc. For a smooth oval, you'd need to use a sine table to figure out the speed of the slower wheel as the BoeBot goes around the circle. The Stamp does have a SIN operator.

    First get the BoeBot to go in a straight line for a short distance, then go in a clean circle, then exit into a straight line for another short distance. The two straight lines should line up.
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-07 14:23
    Don't give up on the maze! It doesn't need to be that complicated. I like the easy "right hand rule." In its simplest form, think of it as a "hand" on the right wall at all times and move forward. if you get to a point where your hand isn't on the right wall turn until it is, then walk forward. (it always turns right when possible) As you know, the hands can be represented by IR sensors already on Boe-Bot. This should follow 3 cases: 1. There is a wall to your right and no wall in front of you. 2. There is a wall to your right and a wall in front of you. 3. There is no wall to your right. Program simple subroutines to handle these cases.
  • $WMc%$WMc% Posts: 1,884
    edited 2011-01-07 18:27
    Like Mr.Green stated about the SIN operator.
    '
    I would start with circles and then move to ovals.
Sign In or Register to comment.