Running a Simulation

From Simspark
Jump to: navigation, search

This pages shows how to start a simulation and connect an agent. The soccer simulation is used to illustrate this.

To follow the example run given here it is best to work with several console windows where you start and control the server monitor and agent separately.

Contents

Installation

If you haven't already, install SimSpark and rcssserver3d. Choose your platform:

Start the Simulation Server

To start the simulation server, type rcssserver3d on the console. You should now see several diagnostic messages fly by, starting with the following greeting:

   rcssserver3d, a monolithic simulator 0.6.x
   Copyright (C) 2004 Markus Rollmann,
   Universitt Koblenz.
   Copyright (C) 2004, The RoboCup Soccer Server Maintenance Group.
   
   Type '--help' for further information

The output ends with the confirmation that the server now listens on the default TCP port 3100 for agents and 3200 for external monitors.

   (NetControl) 'AgentControl' setting up a server on TCP:3100
   (NetControl) 'MonitorControl' setting up a server on TCP:3200
   (SimulationServer) entering runloop
   (SimulationServer) running in single thread

We are now ready to connect a monitor to the simulator.

Turn on the TV

The monitor is a separate application that connects to the server and displays the simulated scene. To start the default soccer monitor type rcssmonitor3d. By default the monitor is configured to connect to a simulation on the local machine. You can however run the server and monitor on different machines.

When the monitor starts up you should again see some diagnostic messages fly by. The output ends with the confirmation that the monitor tries to connect to the server.

   (SimulationServer) init
   (NetClient) 'SparkMonitorClient'connecting to TCP 127.0.0.1:3200
   (NetClient::SendMessage) ERROR: send returned error 'Broken pipe'
   (SimulationServer) entering runloop
   (SimulationServer) running in single thread

If successful it will then open a separate window and display the simulated scene.

View of the soccer simulation after the simulator has just been started

After the monitor started you are able to use the mouse and keyboard to navigate the scene. Take a moment to read the monitor commands to learn how to move the camera around.

Change the view by pressing ’3’ on the keyboard

Automatic Run

In case you want to run the server and the monitor on local machine, a command is created after successful installation of the SimSpark. This command automatically runs the simulator and the TV, and when the TV closes the script will automatically close the simulator too. To use this script, just run it with its name rcsoccersim3d

Hire Some Players

Connect one or more agents to the simulation. To do this please change to a separate console window and type rcssagent3d. This starts the example agent that is included with SimSpark.

An agent connected to the server

You should now see a humanoid robot appear on the field, as above. This default NAO agent does nothing useful but look around.

Moving around on the field using the arrow keys, PgUp, PgDown, and the mouse (with left mouse button pressed)

Blow the Whistle

Switch back to the monitor window and press K to kick off and start the first period of the game. The game time will start counting up and the play mode will change from BeforeKickOff to KickOff. Game on!

Press k to start the game, switching the play mode to KickOff and starting the clock
Personal tools