Difference between revisions of "RoboCup Simulator Execution"

From RoboJackets Wiki
Jump to navigation Jump to search
 
(8 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.
 
  
 +
=== 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>).
  
=== Starting the soccer interface ===
+
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:
 +
<pre>
 +
../util/mcast_route lo
 +
</pre>
 +
 +
You can reverse this later with:
 +
<pre>
 +
../util/mcast_route
 +
</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 can now use the SSL referee box to issue commands to both soccers at once.
  
== Running Under Simulation ==
+
[[Category: RoboCup]]
* Reroute the multicast packets - this is to keep your simulator from flooding any network you are on with vision packets.
 
** Starting from the software/trunk folder
 
** cd doc/
 
** ./mcast_route lo [requires root password]
 
* Start the simulator itself with a configuration to describe how many robots it starts with.  There are multiple configurations available in the SoccSim/config folder, but two_teams will provide the default for most soccer applications.
 
**cd SoccSim/bin
 
**./soccsim -c ../config/two_teams.xml
 
* At this point, there is a small wireframe display of the field with robots, but it isn't particularly interactive.  To actually do robot control and soccer playing, you will need to create instances of soccer for each team. 
 
**Starting from the previous step
 
**cd ../../soccer/bin
 
**./soccer -b -c ../config/sim.xml
 
*** This command starts soccer with the blue team (-b) flag, the robot configuration for the simulator.  To specify the other team, use -y instead of -b.  The sim config should be used whenever the simulator is used.
 

Latest revision as of 23: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.