This assignment is designed to get you familiar with the code
base that you will be using for your final project.
UT
Austin Villa. The code base from the
first three assignments is based off this agent. This agent was the world
champion at
Robocup 2012 in Mexico City,
Mexico.
This team include all of the parsing, server interaction,
and individual skills (such as walking, dribbling, kicking, etc.). The high-level strategy that was used in the competitions is
missing, however. Instead, the team has a fairly
simple "placeholder" high-level strategy of just standing in place.
Your goal is to create a team (11 players) of agents that can play a full game of
soccer as follows:
Each player should be given a "home position" where it returns when
the ball is not near. You choose the home positions.
When the player thinks that no teammate could get to the ball
more quickly, it should try to get to the ball.
Once it has the ball, it should choose to dribble, pass, or shoot
(kick). In all cases you will need to specify a target.
When your team is ready, have it play 2 games and turn in the
logfiles. One game should be against a team of agents that all go to
the ball (for example 11 of your assignment 2 agents). The other should be against itself.
Running the server on a remote machine (for better game
performace)
When running a full team, and especially when running a game of two
teams against each other, it is recommended that you run the server
on a remote machine so that the server, RoboViz, and teams aren't
all competing for a single machine's resources.
In order to do this first choose a machine to run the server on from the list of available
machines:
% cshosts pub64
In one shell, start the server on the remote machine:
% ssh <remote_machine_name>
% run_server3d (be sure to check first that there isn't
already a simulator running on the remote machine following
the instructions in step 2 of assignment 1, and if so choose a
different machine to run the server on)
In another shell, start the roboviz monitor on the local machine:
You will likely see a lot of text including error messages being
printed out as the server and monitor start up but don't worry as you
can ignore these.
You might also want to run teams on remote machines as well to further
spread out the use of computational resources (at competitions the
server, RoboViz, and each team are all run on separate machines).
Using UT Austin Villa
To begin using the UT Austin Villa code, follow these steps. First, copy
the code to your account:
% cp -r /projects/cs344M.pstone/3d/utaustinvilla
Run make to compile the code:
% make
If everything worked, you should now have a player binary in the
directory called . You can run this player
like you ran your players from the previous assignments by starting
the soccer server and then typing:
% ./agentspark --host=localhost --team myteam --unum 2 --paramsfile paramfiles/defaultParams.txt&
[instead of myteam, use your own name]
[if you're running the server on a remote machine use the name of that machine for the host instead of localhost]
Alternatively, you can run the "start.sh" script to start a whole team
of UT Austin Villa players:
% ./start.sh localhost
[if you're running the server on a remote machine use the name of that machine for the host instead of localhost]
Remember to start the soccer server first!
Locally using
% rcroboviz
or remotely using
% run_server3d
Help on UT Austin Villa:
Hints : You may want to look at the following files (though you are encouraged to go through every file and understand the functionality, not necessarily every detail).
1. worldmodel.cc
2. naobehavior.cc
3. strategy.cc
The player API's are mostly in naobehavior.cc and strategy.cc. In
worldmodel.cc you will find run time information about the world.
Some really important methods for determing your position and
positions of other objects in the world from measurement calculations
by a particle
filter are given below. It is no longer necessary to parse the
vision input to get the position of objects on the field (and in fact
you shouldn't do this as the agent will be spinning its head requiring
an extra computation to make positions relative to the agent's torso).
worldModel->getMyPosition() // returns a VecPosition (use getX() and getY() methods of VecPosition to get appropriate values) of the agent's global position on the field
worldModel->getMyAngDeg() // returns the angle in degrees the
agent is facing in the X-Y plane (the orientation of the agent)
The getWorldObject() method returns a WorldObject for a particular object in the world.
WorldObjects contain useful information about the location of an object in the world.
A couple of important members of WorldObject are "pos" which is a VecPosition of an objects location and
also "validPosition" which is a boolean flag stating wheter or not the value of "pos" is valid.
worldModel->getWorldObject(WO_BALL)->pos; // position of the ball as a VecPosition
worldModel->getWorldObject(WO_TEAMMATE1 /*WO_TEAMMATE#*/)->pos; // position of teammate as a VecPosition
The methods canKick() and stopKickBall()
have been removed as they were only needed for purely reactive
agents. The kickBall() method has been changed to
kickBall(int kickTypeToUse, VecPosition target). You might also want to check out the following method for having
the agent walk to a specific location
goToTarget()
Other code bases
There are other code bases out there including one
from magmaOffenburg
written in java and
available here,
and TinMan written for the
.NET Framework. Third party code bases are not directly supported by the instructor/TAs
for the course and will be up to you to get them running and working
if you choose to use them.
Some details:
You can create your team with a single executable by having the
player's uniform number determine its home position.
Don't worry about making a goalie (player number 1) with special behavior (unless
you want to!).
There is A LOT of functionality in these code bases. You don't
need it all. But the point of this assignment is to try to become
familiar with one of the bases, so you know what you would like to
build on top of it for your final project.
IMPORTANT: IF YOU HAVE ANY QUESTIONS EMAIL THEM TO THE
LIST! Everyone is going to have to get familiar with one of
these code bases in order to come up with an interesting project.
Remember, the point of this assignment is just to become familiar with
the code so that you are prepared for the final project.
What to turn in:
2 logfiles of games as described above. The one against the team
of players that all go to the ball should be called
[yourlogin]-vs-herd.log. The one against itself should be called
[yourlogin]-vs-self.log. In both cases, run the game until a goal is
scored or for at least 120 seconds.
Your tarred, gzipped source code,
[yourlogin]-source.tar.gz. You only need include files you've
modified.
% tar -czvvf [yourlogin]-source.tar.gz <source_code_files>
To turn in your files, use the turnin
program with grader "patmac" and assignment label "prog4-3D". When the
assignment is there, send us an
email to that effect
with a brief description of what your team does.