#include <Pusher.h>
Inheritance diagram for Pusher:
Public Member Functions | |
Pusher () | |
int | activate () |
Static Public Attributes | |
const int | ARRIVED = 0 |
const int | CUBE_LOST = 1 |
const int | DRIVE_STALLED = 2 |
Private Member Functions | |
int | approachCube () |
bool | avoidRobot () |
bool | checkForCube (bool backup) |
int | pushCube () |
bool | chooseClusterPoint (bool forceChoiceOfClusterPoint) |
Private Attributes | |
int | minimumWaitingPeriod |
int | maximumWaitingPeriod |
Static Private Attributes | |
const int | APPROACH_CUBE_ARRIVED = 22 |
const int | APPROACH_CUBE_CUBE_LOST = 21 |
const int | APPROACH_CUBE_MET_ROBOT = 20 |
const int | APPROACH_CUBE_NEW_CLUSTER_POINT_CHOSEN = 23 |
const int | PUSH_CUBE_MET_ROBOT = 10 |
const int | PUSH_CUBE_CUBE_LOST = 11 |
const int | PUSH_CUBE_ARRIVED = 12 |
|
|
|
Activates this behavior
|
|
Makes the robot approaching the closest cube such that the robot has a good starting position to push the cube to its cluster point in a next step. If no radio communication is used: To determine a common cluster point this method also calls Pusher::chooseClusterPoint to measure the cluster density around the cube to approach. If favorable the location of the cube to approach is chosen as new cluster point (i.e. if there are more cubes in this area then at the home cluster point we start pushing cubes to here as this is faster. And if every robot pushes cubes to the larger cluster points at the end a single cluster point will remain)
|
|
Used to avoid other robots by backing up and trying to go back to the old position after a random time
|
|
Tries to retrieve or re-discover a lost cube by turning slightly left and right
|
|
If no communication is used the Pusher determines the cluster point for the robot. It does that by comparing the cube density of its own cluster with the density of the newly detected cluster. It chooses the cluster with the higher density as the new cluster point. A new cluster point is set by resetting the robot position. (0,0) is always used as cluster point position as it is easier to push cubes to that position. Thus if a new cluster point is chosen the current robot position is adapted
|
|
Makes the robot pushing the cube in front of him to its cluster point, i.e. (0,0). This methods uses Drive::driveCurveTo to push the cube to the cluster point, that means the angle from the current position (x,y,phi) of the robot to the cluster point should be less then 135 degrees, preferably less then 60 degrees. The robot uses the front infra-red sensor to check if the cube is still there. If the robot meets an obstacle it tries to avoid the obstacle and retrieve the cube
|
|
Used internally as result code for Pusher::approachCube() |
|
Used internally as result code for Pusher::approachCube() |
|
Used internally as result code for Pusher::approachCube() |
|
Used internally as result code for Pusher::approachCube() |
|
Used as result code for Pusher::activate() |
|
Used as result code for Pusher::activate() |
|
Used as result code for Pusher::activate() |
|
Determines how long the robot should wait at most before trying to continue its task after being interrupted by another robot
|
|
Determines how long the robot should wait at least before trying to continue its task after being interrupted by another robot
|
|
Used internally as result code for Pusher::pushCube() |
|
Used internally as result code for Pusher::pushCube() |
|
Used internally as result code for Pusher::pushCube() |