Remote Ball Control

[2006.10.20]

Controlling the ball
Using auto-reposition

Controlling the Ball

Now, when you open the Soccer map, you don't have the ball anymore. You have to create it (spawn) like any other robot. So, you can use this command:

INIT {ClassName USARBot.SoccerBall}{Name SB}{Location 0,0,-0.04}

This will create the ball in the middle field. The location is expressed in meters. The Name parameter is optional, however I suggest to use it.

Important: When the ball is created, you can spawn the AIBO robots. If you spawn AIBOs before creating the ball, they will not see it.

Setting location

The command to set the ball location is:

SETBALL {Location x,y,z}

X, Y, Z are in meters and Z will typically be -0.04. Examples:

Kicking

The command to kick the ball is:

SETBALL {Kick <Y/B>}[{Speed s}]

Y stands for yellow goal and B for blue goal. Speed is an optional parameter that controls the ball speed. It can range from 1 to 3. Examples:

Using auto-reposition

The SoccerBall is smart enough to position itself in the middle field (or other location) if one of these 2 events occur:

  1. The ball goes out of the field.
  2. The ball is still for some time in the field.

The reposition feature can be controlled by a bunch of parameters in the [USARBot.SoccerBall] section of the USARBot.ini file:

enableReposition=[false|true], enables or disables the reposition feature.
outRepositionTime=T (seconds), time to wait before reposition if the ball is out of the field.
inRepositionTime=T (seconds), time to wait before reposition if the ball is in the field and not moving.
movementTolerance=S (uu), movement tolerance of the ball in uu.
frontierX=S (uu), frontierX defines the filed X extension (-frontierX<-> frontierX).
frontierY=S (uu), frontierY defines the filed Y extension (-frontierY<-> frontierY).
targetPos=(X,Y,Z) (uu), where the ball will be repositioned.

The default values are:

enableReposition=True
outRepositionTime=1
inRepositionTime=10
movementTolerance=5
frontierX=700
frontierY=500
targetPos=(X=0,Y=0,Z=10)

movementTolerance and inRepositionTime are related and can be interpreted this way:

Vt = movementTolerance / inRepositionTime

If the ball speed is greater then Vt than the ball is moving, if the speed is below Vt then it's considered still and will reposition after inRepositionTime seconds.