Rover2
   
      A two wheeled rover is used for navigation inside the target building. It’s purpose is to explore
the building while broadcasting video of it’s search via its onboard camera and transmitter. The
rover uses basic navigation protocols for general movement and a complex mapping algorithm to
ensure efficient and complete building exploration. Obstacle avoidance is done with a simple and
low cost array of infrared sensors, one of which is angled to allow for stair detection. Since
the rover is incapable of climbing back up a set of stairs it is necessary to explore all areas of
a floor before proceeding down to the next one.
      The rover’s mapping algorithm navigates by creating a set of waypoints on an x-y coordinate grid,
with the origin being the starting place of the rover after landing inside the building. The rover
will attempt to find the center of the room it currently is in by measuring the distances from
parallel walls via a long range sonar sensor and driving to stop halfway between them. Once in the
center of the room the rover will create a new waypoint with x and y coordinates. It uses an onboard
compass and encoder system to measure the distance and direction the rover traveled. Once in the
center of the room and the waypoint is created the rover will spin in the center to search for doors
in the room wall. During the full scan of the room new waypoints are generated for each door from
the compass and sonar readings of the rover. Once the room scan is finished the rover will determine
the next waypoint to travel to and proceed into another room to repeat the process until all
unexplored waypoints have been explored.
      To determine which waypoint is the next target, the rover searches through possible routes
for the shortest available path to an unvisited waypoint. The rover adds the starting waypoint to
an array and checks if it has been visited. If it is visited the next connecting waypoint is added
to the array and it repeats the process until running into a dead end or finding an unvisited
waypoint. In the event of multiple connecting waypoints, branches are made by recursively calling
the path planning function with the starting waypoint as the different connections, and the shortest
of these branches is added to the original array. Once finished the path to the next unvisited
waypoint is the list of waypoints in the array, and because the center of all rooms are visited
as soon as they are created, the unvisited destination is guaranteed to be a door to a new room.
Once all unexplored waypoints are explored the rover is then free to travel down any stairs it has
found and marked with a waypoint.