If you would like to work remotely and have a slow connection, you should look into installing the RoboCup 3D Soccer Server System on your local machine. We will be using rcssserver3d-0.6.6 and simspark 0.2.3 for this class. Note that if you'd like to install the server on your laptop or home machine, there are links to instructions on how to do this in the middle of the page at http://simspark.sourceforge.net/wiki/index.php/Main_Page . You will also probably want to install RoboViz 3D soccer monitor for which you can find installation instructions here.
export PATH=/projects/cs344M.pstone/3d:$PATHYou will need to open a new terminal or type the command bash into existing terminals for this change to take effect.
% ps aux | grep rcssIf someone is on, you will see a line with the word "rcssserver3d" in it. (For future reference, there IS a way to run multiple servers on the same machine.)
% rcrobovizThe above command is a script that starts both the simulator server (rcssserver3d) and monitor (roboviz). You will likely see a lot of text including error messages being printed out as the simulator starts up but don't worry as you can ignore these.
% cshosts pub64In 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 an earlier step, and if so choose a different machine to run the server on)In another shell, start the roboviz monitor on the local machine:
% export RCSS_HOST=<remote_machine_name> % run_robovizYou 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.
% cp -r /projects/cs344M.pstone/3d/nao-agent .Then build the agent
% cd nao-agent % makeThen start the agent running
% ./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]The agent should appear in the center circle of the field.
left_mouse_botton - look a, left_arrow - move left d, right_arrow - move right w, up_arrow - move forward s, down_arrow - move backward page_up - move camera up page_down - move camera down 1-8 - jump to fixed viewpoint space - camera follows ballAdditional camera controls and other simulator commands can be found on the RoboViz controls page.
selectSkill()method. You should see that it returns an enumerated value type of
SKILL_STAND. Change this return value to be
SKILL_KICK_LONG_RIGHT_LEGand save your changes to strategy.cc. Now recompile the agent with the make command:
% makeThen start the simulator and agent running again as before. After the agent appears in the center circle type 'k' to kickoff again. This time instead of just standing there the agent should kick the ball forward toward the opponent's goal. Go ahead and quit the simulator and agent processes again as before.
selectSkill()method is called almost every cycle of the simulator and its return value determines what skill or action the agent will perform next. In addition to standing and kicking the agent has many other skills which we have designed for it including walking. For walking we use an omnidirectional walk engine allowing us to specify walk direction, rotation, and speed all at the same time. Try having
getWalk(0, 0, 1)to see the agent walk forwards (this time when starting the simulator type 'b' to start play with a drop ball as otherwise the agent will be penalized for touching the ball twice in a row on the kickoff). The following is a list of some the enumerated values you can have
selectSkill()return in order to perform different actions...feel free to try some of them out!
SKILL_STAND - stand getWalk(0, 0, 1) - walk forwards getWalk(180, 0, 1) - walk backwards getWalk(-90, 0, 1) - walk sideways to the right getWalk(90, 0, 1) - walk sideways to the left getWalk(0, -90, 0) - turn clockwise getWalk(0, 90, 0) - turn counter-clockwise SKILL_KICK_LONG_LEFT_LEG - long kick left leg SKILL_KICK_LONG_RIGHT_LEG - long kick right leg SKILL_KICK_MED_LEFT_LEG - medium kick left leg SKILL_KICK_MED_RIGHT_LEG - medium kick right leg SKILL_KICK_QUICK_LEFT_LEG - quick kick left leg SKILL_KICK_QUICK_RIGHT_LEG - quick kick right leg SKILL_DIVE_LEFT - goalie dive to the left SKILL_DIVE_RIGHT - goalie dive to the right SKILL_DIVE_CENTER - goalie dive to the center
beam()method in strategy.cc which "beams" an agent to a particular position at the beginning of a match. In order to change this try changing the values set in
beam()to the following:
beamX = -1; beamY = 1; beamAngle = 180;Now if you recompile and run the simulator and agent you should see the agent start in a different postition with it facing toward its own goal.
% cd /projects/cs344M.pstone/3d/logs % lsPick at least two of the games to watch.
% run_roboviz --logfile <full_path_to_game_log_file> (e.g. "/projects/cs344M.pstone/3d/logs/2012_final_second_extrahalf_UTAustinVilla_vs_RoboCanes.log")A full game is 600 seconds. The logs are halves which go for 300 seconds (5 minutes) or if they are extra time periods they go for 180 seconds (3 minutes). If the log doesn't work double check that you are providing the full (absolute) path to the log file.
$recordLogfile = trueNow repeat the sequence from "Get familiar with the 3D soccer simulator" to start the simulator and run an agent however this time make sure to run the simulator from the same directory as the rcssserver3d.rb file you edited as otherwise your change won't be processed and no log will be created. After killing the server, notice that there will be a log file in the directory from which you ran the server:
% ls *.logreplay your log:
% run_roboviz --logfile <full_path_to_log_file>Turn in the logfile as directed on the main assignments page. Note that these logfiles can often be quite large so please compress them first before turning them in with the following command:
% gzip <log_file>This will compress your log into a file called <log_file>.gz.
Page maintained by
Questions? Send me mail