Monday, February 20, 2012

Autonomous Maze Traversal

To find the flame, we had to program the Squarebot to move towards each room so that it can call it detect flame function. We used a combination of simple drive calls in conjunction with the ultrasonic sensor.


void searchRoom1()
{
  goForward(340);
  goRightSlowly(63);
  goForward(268);
  goRightSlowly(63);
  goForward(170);
  roomNum=1;
}

void searchRoom2()
{
  goLeftSlowly(67);
  goLeftSlowly(67);
  uSonicMove(7);
  goLeftSlowly(63);
  goForward(450);
  goLeftSlowly(67);
  uSonicMove(7);
  roomNum=2;
}

void searchRoom3()
{
  goRightSlowly(67);
  goRightSlowly(67);
  uSonicMove(7);
  goRightSlowly(63);
  goForward(170);
  goLeftSlowly(63);
  goForward(180);
  goLeftSlowly(63);
  uSonicMove(7);
  roomNum=3;
}

void searchRoom4()
{
  goRightSlowly(67);
  goRightSlowly(67);
  uSonicMove(7);
  goLeftSlowly(63);
  uSonicMove(7);
  goRightSlowly(63);
  uSonicMove(14);
  goRightSlowly(63);
  roomNum=4;
}

We successfully navigated on both our attempts. Our problem was that the squirt gun did not fire due to technical difficulties of the water pump. Overall, we had a blast and are looking forward to the next firefighting competition.

  

No comments:

Post a Comment