Graduate Project, Computer Science
![]() | Welcome |
This is the homepage for the graduate project A Simple Robot Simulator written by Gunni Rode and Rasmus Friis Kjeldsen in 2004, at the Department of Computer Science, Faculty of Science, University of Copenhagen, made available online including source code as of February 2011. Project keywords include Car—Like Robot; Robot Simulator; Robot Simulation; Optimal Path; Point—To—Point Motion Task; Path Follower; and Java 6.
The project describes how to simulate a car—like robot, and how to find (and follow) the shortest path between two positions for a car—like robot. A position, p, is defined as the triple
of the cartesian coordinates (x,y) and the orientation, o: p = (x,y,o). The path—finding algoritm
is based on the work of L. E. Dubins: On curves of minimal length with a constraint on average curvature, and
with prescribed initial and terminal position and tangents and J.A. Reeds & R.A. Shepp: Optimal paths for a car that goes both forward and backwards,
and it points out and corrects several errors in the formulas stated by Reeds & Shepp. Finally, it solves the Point—to—Point Motion Task by letting the robot follow the shortest path, or a non—optimal
path for that matter, using several different path—following algoritms. This screen shot shows the Swing—Simulator - Overall layout: menus, status bar, render area, and console.
Two simulators have been developed, originally written in Java 1.4, now crudely ported to Java 6:
- A simple Shell—Simulator that can read a simulation configuration and perform a corresponding simulation from a command shell.
- An elaborate Swing—Simulator with rather extensive gui with easy access to different types of configurations and output (see screenshots below). It can also render the robot during simulation, including its composite chassis with attached axles and wheels; the path currently followed and whether or not it is an optimal path; the actual and estimated robot trail; the state of the robot gadgets and sensors, such as the robot controller, path follower, positioning system, tachometer, etc.; and much more...
Rasmus Friis Kjeldsen even ported part of the software to a real robot for his Master's Thesis and to participate in RoboCup, where the code proved its worth! Rasmus even has a video of the very first run using the ported software.
Unfortunately, the report is in Danish, but the figures/diagrams/formulas are understandable even if you dont understand Danish. The source code and JavaDoc is in UK English. Try running the report (see the download section below) through Google Translate; at least the translation to English is is somewhat understandable... :)
That is it! Enjoy & regards.
Gunni Rode
February 2011
![]() | Screenshots |
Below is a few screen shots from the Swing—Simulator; click on a screen shot to the view it full—size. If your intriged, try running the simulator then... :)
The first two screen shots simply show a bit of the Swing—Simulator. The first screen shot illustrates the simulation rendering area, where the robot and paths are rendered. An optimal path is rendered in dark blue, while the optimal path currently followed is rendered in red. A non—optimal path is rendered in light blue, and a non—optimal currently path followed is rendered in light red (see screen shots three and four below). The status bar to the left shows the current robot configuration, such as the used controller, path follower, sensors, etc., as well as the overall simulation status, e.g. simulation time, positional error, etc.
The second screen shot simply illustrates the "Simulation Draw Menu", from where the simulation rendering can be specified, such as which paths to render; if the robot orientation should be rendered; zoom; robot actual and estimated trail; outline of robot components; etc.
The next two screen shots show how the robot has calculated and followed a given route with five intermediate positions. The black trail is the estimated path of the robot. In the first screen shot, the robot has followed optimal paths all the way, while the second screen shows an alternative route chosen.
The final screen shots illustrate the use of various types of configuration files for relatively easy simulation setup. The first shows a simulation configuration file, which specifies the overall behaviour of a simulation. It delegates part of the configuraton to other types of configurations, such as controller configurations, logger configurations, and robot configurations — the latter being the type of configuration file shown in the last screen shot.
![]() | Simulator |
Once the source code is downloaded, simply unzip it, and import it into a new project in Eclipse, for example, and run/debug the dk.rode.reblag.robotsim.simulator.SwingSimulator class for the Swing—Simulator or the dk.rode.reblag.robotsim.simulator.ShellSimulator class for the Shell—Simulator.
To load a simulation configuration file, click on the "File Menu" in the Swing—Simulator, then "Simulation", then select either "New configuration" or "Open configuration...", or click on the simulatation name in the status bar on the left side of the simulator. In the Shell—Simulator, you will be promted for a path to the simulation configuration file to use. The source code comes with a resources directory where several sample configurations can be found, some even with a bit of comments...
Note: for the best simulation results, use a successive point path follower in your robot controller!
![]() | Report |
The report is available for download as a pdf file. As stated, the text is in Danish, but the figures/diagrams/formulas are understandable even if you dont understand Danish. Try running it through Google Translate and see what happens...
![]() | Source Code |
The source code is written in UK English. For the Java 6 version, the main IDE (and compiler) used is Eclipse 3.6. The source code was originally written in Java 1.4, but has now been ported to Java 6; the 1.4 source code is not available.
The port to Java 6 is fairly crude, and its Java 1.4 legacy can be seen several places throughout the design, such as static String and int constants in place of enums. The code contains numerous known bugs, and cannot be considered a bonafide finished product — still, for the most parts it is fully functional... :)
However, the code related to the use of Swing is rather messy as we never really got around to read about how to design a Swing application the proper way; compared to the overall scope of the project, the time spent developing Swing related code was atrocious.
A couple of interesting bits (pun intended):
- The dk.rode.reblag.robotsim.route package: a standalone package that calculates optimal paths and routes.
- The dk.rode.reblag.robotsim.model.* and dk.rode.reblag.robotsim.simulation.model.* packages: the model and corresponding implementation for the simulation.
- The dk.rode.reblag.robotsim.implementation.* packages: implementation of different controller and gadgets.
- The dk.rode.reblag.robotsim.simulation.solver package: the numerical solvers for the physical equations.
The source code is available for download, but note the ubiquitous license terms.
![]() | Google Code |
Coming soon: The project and source code will also be available via Google Code. However, we do not plan to update this project anytime this millenium, but you are certainly welcome to do so... :)
![]() | JavaDoc |
The source code is fully documented using JavaDoc, in UK English, including all non—public members. The generated documentation can be browsed online or downloaded.
The JavaDoc is sometimes quite verbose, and discusses issues not necessarily covered in the report. It is recommended to keep it close while reading the report.
![]() | Download |
The following files are freely available for download, but note the license terms for the source code:
- Report: robotsim.pdf (~700 kb)
The final version of the report. The text is in Danish. - Source Code, including Sample Configurations: robotsim-source-code.zip (~350 kb)
The complete Java 6 source code, fully documented, all in UK English. The source code compiles in Eclipse 3.6 using Java 6. Feel free to use the developed source code as you see fit, but note the license terms! - JavaDoc: robotsim-javadoc.zip (~1.7 mb)
Generated JavaDoc, including all non—public members. The documentation is in UK English. - Report, Source Code, and Sample Configurations: robotsim-bundle.zip (~850 kb)
A single zip file containing the report, the developed source code, and numerious sample configuration files.
![]() | License Terms |
Licensed under the Apache License, Version 2.0
The original project and ported Java 6 source code are available at rode.dk/robotsim.





