13.2.1 FINDING THE STATION To enable the robot to nd the charging station it can be marked with a beacon that is visible to the robot from wherever it is likely to be while performing its duties. Another way is to give the robot the GPS (global positioning system) coordinates of the station. The robot can then use its GPS system to reach the station. In either case, the robot may have to negotiate around obstacles and avoid objects while it is making progress toward the station. Going from one spot to another while avoiding obstacles and objects was covered in Chap. 12, and we will see how to negotiate around a complicated environment, such as a house or of ce in Chap. 15. In this chapter we will assume that the robot is in the same general area as the station and will only handle moving around obstacles. 13.2.2 THE CHARGING STATION There can be many schemes to couple a robot to a charging station; the variety of methods is only limited by your ingenuity. A simple method is to place electrodes on the back of the robot at the same height as corresponding terminals on a battery charging station. In order to make it easy for the robot to make contact with the terminals you could make each terminal a 1-in2 copper or aluminum plate mounted on a spring. The spring ensures a good connection when the robot backs into the charging station until its rear bumper triggers, letting the spring-tension hold the terminals together. The 1-in2 sized terminals would allow the robot a reasonable tolerance when approaching the station. However, it is important that the robot approaches the charger at the correct angle otherwise a proper connection with the charger will not be possible. 13.2.3 ENSURING A PROPER APPROACH ANGLE There are many ways to make sure the robot approaches the charger at the correct angle. If the robot is equipped with a GPS and a compass it can approach the charging station and orient it self using the GPS and compass. In this chapter however, we are going to assume there is a line on the oor as shown in Fig. 13.3. A beacon is placed over the line so the robot can locate it. Once it reaches the line, the robot follows it until it reaches the charger. Notice how the line is shaped so that the robot will reach the charger regardless of which direction it follows the line.

In the simulation we are going to let the robot randomly roam around the room (as in Chap. 5). While roaming it will constantly monitor its battery charge level. If the battery level drops below a speci ed threshold, the robot will abandon roaming to immediately seek a charging station by triggering a goal following behavior (as in Chap. 12). The goalfollowing behavior locates a beacon serving as a marker for the station. As you have seen in Chap. 12, the robot homes in on the beacon avoiding obstacles by going around them while it is making progress toward the beacon.

Using Barcode creator for Java Control to generate, create USS Code 39 image in Java applications.

As the robot approaches the beacon, it needs to check for the line on the oor. When the line is acquired, the robot follows it (Chap. 7) until the charger is reached. Upon reaching the charger, the robot turns around and backs into the charging station for a proper docking procedure and charges the battery. Once the battery is charged, the robot returns to randomly roaming the environment until it needs to nd the charger again. 13.3.1 SUBROUTINES HIERARCHY CHART To achieve the behavior sequence described above we will use many of the subroutines developed in earlier chapters. These routines will be changed slightly to allow for the correct ow of control from one behavior to another. The changes in the routines will be to give them two additional abilities: