... | ... | @@ -133,15 +133,15 @@ protected void waitForACMovement() |
|
|
}
|
|
|
```
|
|
|
|
|
|
##### StayInRing
|
|
|
#####StayInRing
|
|
|
|
|
|
The goal of the StayInRing behavior is to keep the robot inside the ring by monitoring the lightsensors - an addition was added later for a total of two. When the robot detects an edge, it will immediatly (stayInRing has top priority when an edge is detected) drive backward, and depending one which side the edge was detected, turn to face away from the edge.
|
|
|
|
|
|
##### Search
|
|
|
#####Search
|
|
|
|
|
|
The goal of the Search behavior is to wander around to increase the chance of detecting the opponenent. Wander would be a more correct name for this behavior, but we decided that having behaviors named "Search" and "Destroy" trumped that. The random wander algorithm is covered in the section "Added randomness".
|
|
|
|
|
|
##### Destroy
|
|
|
#####Destroy
|
|
|
|
|
|
The goal of the Destroy behavior is to use the sonar to detect the opponent, and charge at the opponent when it is detected. Since it takes a while to get a measurement from the sonar sensor, reading the sensor is moved from the `takeControl()` function to another thread, so as to not block the arbitrator´s thread while taking the measurement:
|
|
|
|
... | ... | |