Morten, Lars and Thomas.
Goal:
To create a control program for the autonomous bat, using a behavior based architecture with a suitable array of behaviors whose interaction will mimic the overall behavior of an autonomous Pong bat.
Plan:
To make use of our previously developed arbitrator and develop the needed behaviors.
As a minimum we will need the following behaviors:
- a light following behavior
- an idle behavior
- an exit switch
Earlier in the course we developed an improved arbitrator. This arbitrator works on objects implementing the behavior-interface, but we do not use the suppress-method. Instead we start the behaviors in threads, and let it be the behaviors responsibility to check if the thread has been interrupted. The arbitrator interrupts the current thread when a new behavior will get control. The arbitrator starts a new thread when it switches behavior, and when the current behaviors thread dies.
Developing the light following behavior proved to be very simple, as we had already developed the basic behavior while testing the construction. We did however need to add some normalization of the input values, to make the robot less sensitive to the background lighting conditions. The Light following behavior also utilizes the Proportional part of a PID-controller, as the one mentioned on
The inspiration for developing the idle behavior is the observation that the bat will not be able to detect the light source for at least half of the actual time played. With this in mind, it makes sense to try to position the bat where it's most likely to detect the light again. By centering the bat in the middle of the playing field, we optimize the chance of detecting the light when the ball returns. The centering mechanism is actually very similar the light following behavior. This behavior uses input from the ultrasonic sensors pointing in the direction of the playing field walls. Where the light follower seeks to minimize the difference between the light sensors, the idle behavior will minimize the difference between the two distance-readings, thus centering the robot in the middle of the field. The only assumption the behavior needs to achieve this, is that there is a playing field with parallel walls within the range of the ultrasonic sensors, which is not really a devastating assumption for a game of Pong.
Experiments
The experimenting during this phase mainly consisted of tuning the thresholds of the light-following behavior and then testing whether the new setup posed an improvement to the behavior. Through this testing we came up with a threshold of 25 meaning that the bat should only move when the normalized difference between the readings is larger than 25, this ensures that we only move when actually spots the ball.
References:
Rodney Brooks, a robust layered control system for mobile robots
Tom Dean, Introduction to Machina Speculatrix and Braitenberg Vehicles
Tom Dean, Notes on construction of Braitenberg's Vehicles, Chapter 1-5 of Braitenbergs book
Ingen kommentarer:
Send en kommentar