Difference between revisions of "RoboCup Simulator Execution"

From RoboJackets Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The easiest way to get started using the software is to make use of the simulator, which will be most useful for developing much of the actual system. For these instructions, you will need to be in a terminal in your robocup folder (/robocup/software/trunk).  The first scenario will start a simulator with a single robot, and the second scenario will start two teams with referee control.
+
The easiest way to get started using the software is to make use of the simulator, which will be most useful for developing much of the actual system.  The first scenario will start a simulator with a single robot, and the second scenario will start two teams with referee control.
  
== Before starting the simulator ==
+
All of the commands on this page assume you are in the <i>software/run</i> directory.
To avoid flooding the network with data from your simulator, we have a script to reroute some networking processes.  You will need to follow these instructions once before running the simulator, but the setting will remain correct until you reboot.
 
  
 +
== Single-team Simulator Use ==
 +
In this case, we will only drive one team.  The other team's robots will remain stationary.
 +
 +
=== Starting the Simulator ===
 
<pre>
 
<pre>
sudo ./doc/mcast_route lo
+
./simulator [-c <config file>]
 
</pre>
 
</pre>
  
== Single-team Simulator Use ==
+
If no configuration file is given, it will use <i>default.cfg</i> in the current directory.  Currently, <i>default.cfg</i> creates two full teams.
In this case, we will only drive one team, the other team's robots will just remain stationary
 
  
=== Starting the Simulator ===
+
You can kill the simulator with Ctrl-C.
We will start the simulator to run in a terminal.  You can run the soccsim executable without parameters to get a small explanation of the correct arguments, if necessary.  Note that you can choose from the config files in the SoccSim/config/ folder to try different scenarios.
 
  
 +
=== Starting one team ===
 +
In another terminal, in the <i>software/run</i> directory:
 
<pre>
 
<pre>
cd ./SoccSim/bin
+
./soccer -sim
./soccsim -c ../config/two_teams.xml &
 
 
</pre>
 
</pre>
  
Now the simulator should report that it is runningTo stop the simulator, kill the process by typing Ctrl-C in the terminal where you started it.
+
The status indicator in the upper right corner should be yellow and show SIMULATION.
 +
 
 +
You can now issue internal referee commandsEither use the shortcut buttons at the top of the window for the most common commands (they have tooltips) or go to the Referee tab for a complete set of commands.
 +
 
 +
== Starting two teams ==
 +
Start another soccer program exactly like the first one.  Don't use the referee buttons yet - the two soccers won't stay in sync.
 +
Set the second soccer to run the blue team (<b>Field</b> -> <b>Team Color</b> -> <b>Blue</b>) and defend the opposite goal (<b>Field</b> -> <b>Defend Goal</b> -> <b>Vision +X</b>).
 +
 
 +
You must use the SSL referee box to control two soccers at once.
  
=== Starting the soccer interface ===
+
If you are not connected to a network, you must add a multicast route:
Start a new terminal to run soccer from and use the following commands. This will start the soccer engine using the simulation configuration file (soccer/config/sim.xml) and using the yellow team (use -b for blue team).
+
<pre>
 +
../util/mcast_route lo
 +
</pre>
  
 +
You can reverse this later with:
 
<pre>
 
<pre>
cd [robocup root]/soccer/bin
+
../util/mcast_route
./soccer ./soccer -y -c ../config/sim.xml
 
 
</pre>
 
</pre>
 +
but the route will typically be removed by your network manager when you get a real network connection.
 +
 +
Now start the SSL referee box:
 +
<pre>
 +
./sslrefbox
 +
</pre>
 +
 +
The referee buttons in both soccers should now be grayed out and the <i>Use external referee</i> checkbox should be checked.  If you have previously changed this checkbox manually, you will need to check it.
  
You should now see the GUI for the soccer program.  To to a simple check to ensure that everything is working, you want to enable a play to run.  Go to the plays tab and select "testBasicAttack" from the list, then click the green check button (Force Start) in the upper left of the GUI.  You should see one robot go to the goal (because goalie is enabled by default), and another robot drive at the ball and start kicking.
+
You can now use the SSL referee box to issue commands to both soccers at once.
  
== Using the Soccer interface ==
+
[[Category: RoboCup]]
There's a lot of data available in the GUI to make debugging the robots easier.  The best place to look if you want to see what the robots are doing is in the tree view tab, where all of the data logged or passed through the system is shown in realtime.
 

Latest revision as of 22:12, 13 June 2018

The easiest way to get started using the software is to make use of the simulator, which will be most useful for developing much of the actual system. The first scenario will start a simulator with a single robot, and the second scenario will start two teams with referee control.

All of the commands on this page assume you are in the software/run directory.

Single-team Simulator Use

In this case, we will only drive one team. The other team's robots will remain stationary.

Starting the Simulator

./simulator [-c <config file>]

If no configuration file is given, it will use default.cfg in the current directory. Currently, default.cfg creates two full teams.

You can kill the simulator with Ctrl-C.

Starting one team

In another terminal, in the software/run directory:

./soccer -sim

The status indicator in the upper right corner should be yellow and show SIMULATION.

You can now issue internal referee commands. Either use the shortcut buttons at the top of the window for the most common commands (they have tooltips) or go to the Referee tab for a complete set of commands.

Starting two teams

Start another soccer program exactly like the first one. Don't use the referee buttons yet - the two soccers won't stay in sync. Set the second soccer to run the blue team (Field -> Team Color -> Blue) and defend the opposite goal (Field -> Defend Goal -> Vision +X).

You must use the SSL referee box to control two soccers at once.

If you are not connected to a network, you must add a multicast route:

../util/mcast_route lo

You can reverse this later with:

../util/mcast_route

but the route will typically be removed by your network manager when you get a real network connection.

Now start the SSL referee box:

./sslrefbox

The referee buttons in both soccers should now be grayed out and the Use external referee checkbox should be checked. If you have previously changed this checkbox manually, you will need to check it.

You can now use the SSL referee box to issue commands to both soccers at once.