A 3D Simulator of Multiple Legged Robots based on USARSim

(2005/10/23)

Abstract
Discussion
The camera
Download

Abstract

This thesis presents a flexible 3D simulator able to reproduce the appearance and the dynamics of generic legged robots and objects in the environment at full frame rate (30 frames per second). Such a simulator extends and improves USARSim (Urban Search and Rescue Simulator, available at sourceforge), a robot simulator in turn based on the game platform Unreal Engine 2. This latter provides facilities for good quality rendering, physics simulation, networking, highly versatile scripting language and a powerful visual editor.

This simulator extends USARSim features by allowing for the simulation and control of legged robots and it introduces a multi-view functionality for multi-robot support. It also enhances physics accuracy and explores environment management possibilities by using "in game" console commands.

The simulator capabilities were successfully tested by mimic a virtual environment with up to five network-controlled legged robots, like AIBO ERS-7 and QRIO, running at 30 fremes per second on e middle class hardware. This test proves that physics accuracy is adequate both for a RoboCup simulation and for more general robot-robot and robot-environment interactions.

It has a wide application range, form prototyping of applications, behaviors, scenarios, etc. to robotic education allowing students to develop and experiment typical robotic tasks at home, without requiring them to use a real robot.

Discussion

Building a simulator, especially for 3D environments, is not easy. I tried many different solutions until I realized that the best way to accomplish this task was to use a game engine. Among the engines I consider the Unreal Engine far more advanced and user friendly than many others, so it was a seemly choice. In this context I found (in 2005/02) an already formed robot simulator, USARSim, built like a modification of the Unreal Tournament 2004 game. However it was (and still is) under development so that I found many bugs, especially concerning physics. It was also inadequate for any kind of legged robot simulation. I spent a great effort on its improvement, a task that turned out to be harder than I thought. This simulator is the result of my work, I also sent it back to the developer of the original USARSim, Jijun Wang of Pittsburgh university, that used my extensions and bug corrections to fix and improve its code.

The main features of the simulator are:

Adopting a game engine we have to accept some limitations:

Perhaps the biggest advantage of using an industrial game engine is due to its powerful editing tools and state of the art 3D graphics virtual machine. Morover, improvements to the Unreal Engine will directly reflect to improvements in the simulator with very few effort, while obtaining significant advantages. For example, I plan to upgrade the simulator to use Unreal Engine 3 as soon as it will be available. This will dramatically enhance rendering quality, physics simulation (that will use the AGEIA physics engine), script and net code.

The camera

A robot can be equipped with a camera that displays its view directly in the UT2004 game client. This image is grabbed, accessing DirectX frame buffer, by an image server that compresses and sends it to the controller. Since UT2004 allows to run only one client per machine it follows that we can simulate only one robot per computer. This limitation is bound to the Unreal Engine and can be overcame in two ways:

I) The first solution is to use the client/server architecture of the engine. This means that a computer will run the UT2004 server and each robot will be simulated on a client computer connected to the server. Thus n+1 computers are required to simulate n robots. Besides, if we want to run controllers on independent machines so to allocate the entire cpu to intelligence processing, we need 2n+1 computers.

II) The other way of doing multirobot is to split the client window into smaller subviews. I coded a special extension to accomplish this: the MultiView bot. It allows to use a single machine to simulate more than one robot. In this way we can use only one computer for the entire simulation leading to n+1 computer to run simulator and controllers. In the download section there are two demo showing the MultiView capabilities.

Download

In this section you can find the simulator source code, some demo movies, my thesis and power point presentation (both in italian, sorry). To compile USARSim you should have some experience with Unreal Tournament modding.