Grsim - RoboCup Small Size Robot Soccer Simulator PDF
Grsim - RoboCup Small Size Robot Soccer Simulator PDF
Grsim - RoboCup Small Size Robot Soccer Simulator PDF
Simulator
1 Introduction
Developing artificial intelligence software for mobile robots is one of the most
challenging tasks in the process of designing an intelligent robot. Robot software
development usually requires a full functional real robot, however due to the
hardware problems which experimental robots always suffer from, it’s hard to
design software during hardware development process. In addition, when a full
functional real robot exists, constraints like cost, maximum operation time and
possible damages slow down the software development process. Robot simulators
can overcome such problems.
A robot simulator is used for developing software without depending ”phys-
ically” on the actual robot, thus saving cost and time. In advanced simulators,
robots and objects are modeled as rigid bodies in a virtual world. After receiv-
ing commands from clients or controllers, a physics engine simulates actions
and sends simulated robot perception data back to the client. The virtual world
can also (but not necessarily) be visualized using a two-dimensional or three-
dimensional graphics layer.
Small Size robot soccer focuses on the problem of intelligent multi-agent co-
operation and control in a highly dynamic environment with a hybrid central-
ized/distributed system [3]. Small Size League (SSL) is one of the main leagues
T. Röfer et al. (Eds.): RoboCup 2011, LNCS 7416, pp. 450–460, 2012.
c Springer-Verlag Berlin Heidelberg 2012
grSim – RoboCup Small Size Robot Soccer Simulator 451
2 Overview
Client 1
Localization
Commands
Data
Client 2
Open
Simulator Core Dynamics
Engine
Visualization
used for encoding data is the same format used by small size league’s shared
vision system, named SSL-Vision. SSL-Vision[21] is the core software of league’s
shared vision system. As grSim and SSL-Vision use similar data format, clients
do not sense any difference between data sent from shared vision system and
data sent by grSim, thus no extra effort is needed to convert localization data.
Figure 1 shows an overall view of the simulator’s structure.
3 The Simulator
The physical environment consists of 10 robots (5 for each team), a ball, field
goals, walls, ground and sky. The dimensions and properties of all objects can
be modified in run time. The default values are optimized to comply with latest
Robocup SSL rules [7].
Wheels. In grSim each robot has four attached wheels with configurable struc-
ture. The wheels are solid cylinders attached to the robot’s chassis with an ODE’s
454 V. Monajjemi, A. Koochakzadeh, and S.S. Ghidary
Hinge joint. In order to rotate the wheels an angular motor with configurable
limited torque is attached to each joint.
Omni directional robots like small size soccer robots, use a special type of
wheels called omni (or poly) wheels. In omni wheels there are number of sub-
wheels around the circumference which are perpendicular to rolling direction.
Sub-wheels help the wheel to side-slide.
Physical modeling of sub-wheels increases the model complexity and is a ma-
jor cause for simulator deficiency. To overcome this problem we implemented a
special model for these wheels inspired by [6]. In this model the wheels have a
configurable friction with the ground surface. This friction is different for tangen-
tial and perpendicular directions (figure 3). Using this technique, the complexity
of robot’s physical model is decreased which results in less resource usage and
higher simulation speed.
Kicker and Spin-Back Device. Each SSL robot is equipped with a special
mechanism to kick the ball. This mechanism will let the robot make a direct or a
chip kick. In order to simulate the kicker, a solid cube is attached to each robot’s
front face. Whenever the kick command is received and the ball is in touch, a
proper force will be applied to the ball. The magnitude and type of this force
are configurable.
Small size soccer robots use a special actuator in front of their robots in
order to manipulate the ball while moving. This device, called spin-back or
spinner, helps the robot not to lose the ball’s possession while moving. In order
to simulate this device, the kicker’s solid cube applies a torque to the ball when
it touches it. In this way the ball rolls around itself and moves backwards, thus
sticks to the robot. In real robots, because of the specific shape of the spinner,
ball’s side movement during spin back does not happen. In order to avoid ball’s
side movement, grSim uses the same method discussed in section 3.1 between
ball and the ground, i.e. defining different friction coefficients for tangential and
grSim – RoboCup Small Size Robot Soccer Simulator 455
Normal Friction
Force Direction
Tangential Friction
Force Direction
Fig. 3. Omniwheel model in grSim (note that the sub-wheels are textures)
perpendicular directions to the spinner. All of the parameters for the kicker
and spinner, like size, maximum torque, maximum force and chip kick angle are
configurable.
3.2 Communication
Output Packets. The output packet contains the localization data, the po-
sition and direction of all ten robots and position of the ball. The packets are
generated in the same way that SSL-Vision generates packets. Both SSL-Vision
and grSim use Google Protocol Buffer (protobuf) library [11] to encode the data
packets. To generate the exact same packet, grSim uses the same protocol con-
figuration file that SSL-Vision uses. The generated packets are sent to the clients
with the frequency of 60 times per second, however it can be increased up to
100fps based on simulator rendering frame rate.
To make the simulation output data more realistic, user can specify differ-
ent kind of noise and disturbances to be added to the localization data. The
simulator can apply a two dimensional Gaussian noise to localization data with
user specified parameters. It can also add delay to output data to simulate the
loop delay which exists in Small Size teams hardware/software architecture. Fur-
thermore, It can add some vanishing effect to output data with user-specified
probability. The vanishing effect simulates the temporary loss of an object in
vision data. Like other configurations, all these parameters are configurable in
run-time.
456 V. Monajjemi, A. Koochakzadeh, and S.S. Ghidary
Input Packets. The simulator receives packets from clients using two UDP
sockets, one for the blue team and the other one for the yellow team. Blue and
Yellow are standard colors that teams use as the main identifier in SSL matches.
In order to standardize the software’s input/output protocols, the commands
must be sent using Google Protobuf (section 3.2) encoded data packets. The
protocol schema is depicted in Figure 4. The protocol schema describes how the
clients must encode their desired control commands before sending data to grSim
using Google Protobuf library. The required header and source files to encode
data using this schema is included in grSim’s software package. According to this
schema, in each cycle, the client must first specify the target team, yellow or blue.
Next, a series of control commands must be provided for all active robots.
message grSim_Robot_Command {
required uint32 id = 1;
required float kickspeedx = 2;
required float kickspeedz = 3;
required float veltangent = 4;
required float velnormal = 5;
required float velangular = 6;
required bool spinner = 7;
required bool wheelsspeed = 8;
optional float wheel1 = 9;
optional float wheel2 = 10;
optional float wheel3 = 11;
optional float wheel4 = 12;
}
message grSim_Commands {
required double timestamp = 1;
required bool isteamyellow = 2;
repeated grSim_Robot_Command robot_commands = 3;
}
Fig. 4. The grSim’s Google Protobuf schema for receiving control commands from
clients. The protocol documentation and examples can be found in the grSim’s docu-
mentation and webpage
Run-time
configuration Panel
Hierachtical
Configuration
Schema
Active Robot Panel
: Manual reset,
precise robot
location Drag & Drop Object Move
Camera Control
mouse and clicking in the scene window. An overview of some UI features are
shown in figure 5.
For easy run-time configuration of the simulator parameters, grSim uses Var-
Types library[20]. VarTypes is a feature-rich, object-oriented framework for man-
aging variables in C++/Qt4. This library stores all configurable variables and
their descriptions in a XML file. It creates a Qt Widget for easy modification of
variable values during run-time in a thread-safe manner. In this way all of the
physical parameters including friction and bounciness of the surfaces, mass of
the rigid bodies, actuator parameters and network properties are configurable
during program run.
4 grSim in Action
grSim is currently under active development by Amirkabir university’s small size
soccer robot team named “Parsian”[18]. This simulator plays an important role
in the software, control and AI development of aforementioned team.
In order to demonstrate the simulator’s accuracy and performance, one robot’s
simulated motion profile, has been compared to real world data. In the first test,
the robot traveled a 4.4m straight line along its local x-axis (its head direction).
In the second test, the robot traveled a 3.6m straight line along its local y-axis
(perpendicular to its head direction). The position of the robot during the tests
are depicted in figures 6, 7 and 8. All the tests were done using 5th generation
458 V. Monajjemi, A. Koochakzadeh, and S.S. Ghidary
Parsian small size robots [18] on a dual core PC with 4GB of RAM running
Ubuntu Linux. Both the vision system and simulator’s update rate were 62fps
during the tests.
Fig. 6. Comparison between robot’s position on the field, while traveling along its head
(left) and perpendicular to its head (right). [Blue is from real data]
Fig. 7. Comparison between global x and y components of robot’s position while trav-
eling along its head direction
5 Conclusion
In this paper we described grSim simulator, which can simulate and visualize
a RoboCup small size soccer robot game in a realistic way and in real-time.
By using a simplified robot model it can reach high simulation speeds (60fps or
more). The flexible input protocol and SSL-Vision compatible localization data
output make it easy to integrate grSim into any existing SSL software chain. gr-
Sim’s rich user interface makes it an easy to learn, useful tool in AI development
process. Our plan is to release grSim as a free and open-source application to
RoboCup small size community in near future. Updates, screenshots and videos
are available at http://eew.aut.ac.ir/~parsian/grsim/ .
References
1. OpenGL - The industry standard for high performance graphics (2011),
http://www.opengl.org/ (accessed January 2011)
2. RoboCup - official website (2011), http://www.robocup.org/ (accessed January
2011)
3. Small Size Robot League - official website (2011),
http://small-size.informatik.uni-bremen.de/ (accessed January 2011)
4. The Player Project - free software tools for robot and sensor applications (2011),
http://playerstage.sourceforge.net/ (accessed January 2011)
5. Baillie, J.: Urbi: Towards a universal robotic low-level programming language. In:
2005 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS
2005), pp. 820–825. IEEE (2005)
6. Browning, B., Tryzelaar, E.: Übersim: A multi-robot simulator for robot soccer. In:
Proceedings of the Second International Joint Conference on Autonomous Agents
and Multiagent Systems, pp. 948–949 (2003)
7. RoboCup Small Size League Technical Committee: RoboCup Small Size League
Rules (2011), http://small-size.informatik.uni-bremen.de/rules:main (ac-
cessed January 2011)
8. Cyberbotics: Webots, fast prototyping and simulation of mobile robots (2011),
http://www.cyberbotics.com/ (accessed January 2011)
9. Gerkey, B., Vaughan, R., Howard, A.: The Player/Stage project: Tools for multi-
robot and distributed sensor systems. In: Proceedings of the 11th International
Conference on Advanced Robotics (January 2003)
10. Go, J., Browning, B., Veloso, M.: Accurate and flexible simulation for dynamic,
vision-centric robots. In: Proceedings of International Joint Conference on Au-
tonomous Agents and Multi-Agent Systems, AAMAS 2004 (2004)
11. Google Inc.: Protocol buffers - google’s data interchange format (2011),
http://code.google.com/p/protobuf/ (accessed January 2011)
12. Gostai Ltd.: Urbi - The universal platform (2011),
http://www.gostai.com/urbi.php (accessed January 2011)
13. Koenig, N., Howard, A.: Design and use paradigms for Gazebo, an open-source
multi-robot simulator. In: Proceedings of 2004 IEEE/RSJ International Conference
on Intelligent Robots and Systems (IROS 2004), vol. 3, pp. 2149–2154. IEEE (2005)
14. Koenig, N., Howard, A.: Gazebo - 3D multiple robot simulator with dy-
namics (2011), http://playerstage.sourceforge.net/gazebo/gazebo.html (ac-
cessed January 2011)
460 V. Monajjemi, A. Koochakzadeh, and S.S. Ghidary
15. Laue, T., Spiess, K., Röfer, T.: SimRobot – A General Physical Robot Simulator
and its Application in RoboCup. In: Bredenfeld, A., Jacoff, A., Noda, I., Taka-
hashi, Y. (eds.) RoboCup 2005. LNCS (LNAI), vol. 4020, pp. 173–183. Springer,
Heidelberg (2006)
16. Michel, O.: Cyberbotics Ltd. Webots TM: Professional mobile robot simulation.
International Journal of Advanced Robotic Systems 1(1), 39–42 (2004)
17. Nokia Inc.: Qt - A cross-platform application and UI framework (2011),
http://qt.nokia.com/ (accessed January 2011)
18. Poorjandaghi, S., Monajjemi, V., Mehrabi, V., Nabi, M., Koochakzadeh, A.,
Atashzar, F., Omidi, E., Pahlavani, A., Sheikhi, E., Bahmand, A., Mohaimanian,
M., Saeidi, A., Shamipour, S., Karkon, R.: Parsian - Amirkabir university of tech-
nology RoboCup small size soccer team. Team Description Paper for RoboCup
(February 2011)
19. Smith, R.: ODE - Open Dynamics Engine (2011), http://www.ode.org/ (accessed
January 2011)
20. Zickler, S.: Vartypes - A feature-rich, object-oriented framework for managing vari-
ables in C++ / QT4 (2011), http://code.google.com/p/protobuf/ (accessed
January 2011)
21. Zickler, S., Laue, T., Birbach, O., Wongphati, M., Veloso, M.: SSL-Vision:
The Shared Vision System for the RoboCup Small Size League. In: Baltes, J.,
Lagoudakis, M.G., Naruse, T., Ghidary, S.S. (eds.) RoboCup 2009. LNCS (LNAI),
vol. 5949, pp. 425–436. Springer, Heidelberg (2010)