Robot3D Plugins

Version 0.9.2 of the Robot3D simulator is out. Time to tell a bit on the plugins that are available, so-called “component plugins” and “agent plugins”. If you want to start as quick as possible, I would recommend you to skip to the “Agent plugins” section.

Component plugins

There are three “component plugins”, namely srInterface, srDistributed, and srEvolution. You can “enable” an interface by either dropping it in the default directory /usr/lib/robot3d/components or by setting the environmental variable ROBOT3D, by e.g.: export ROBOT3D=/home/you/workspace/plugins. This directory should contain the compiled .so files.

srInterface

By default the Robot3D simulator does not contain functionality to interface with it over TCP/IP. Commonly used in robotics is YARP, Yet Another Robot Platform. This functionality can be added to the Robot3D simulator by the srInterface shared library. You can obtain it from its own branch on Launchpad and compile it in the usual way using the cmake build system:

bzr branch lp:~robot3d-team/robot3d/srInterface
sudo aptitude install robot3d-dev # if you didn't do that before
cd srInterface
mkdir build; cd build
cmake ..
make

Now, you can interface with the Robot3D simulator over YARP. You will need to create your own “yarp modules” for that. However, you can see already a series of modules that know how to interface with the yarp-enabled Robot3D simulator at Launchpad. For example, one of the modules, RobotManagerYARP, allows you to add a robot to the simulator and even provides a command-line interface to do so:

RobotManagerModule rob+ 1

Every module comes with a “scripts” directory that quickly demonstrates how to use the specific module.

srDistributed

This plugin allows the simulator to run distributed over multiple machines.

srEvolution

This plugin demonstrates how to use evolution to evolve a gait for a modular robot organism.

Agent plugins

There is currently one agent plugin, a sample agent.

sampleAgent

The sample agent code is again obtainable from Launchpad in the usual way by:

bzr branch lp:~robot3d-team/robot3d/sampleAgent

The compilation process is not different from the other plugins. You can copy the “exampleScene.xml” file to your local directory as ~/.robot3d/scene.xml and set ROBOT3D to the directory in which libSampleAgent.so appears (normally sampleAgent/build/sample/src/). This will show you a snake in a pit in a white world. This controller does nothing special and can hence function perfectly as a starting point for your own controller. Good luck!

Snake in Snow World

Snake in Snow World

Posted in Replicator, Software, Symbrion | Leave a comment

Robot3D for dummies

A new release of Robot3D is upcoming. At Launchpad, kindly provided by the Canonical folks, there are two branches of Robot3D. The simulator has undergone heavy development in the “devel” branch and right now the packages provided through the Ubuntu update system stem from this “devel” branch, rather then from the “trunk”. The updated version of the simulator should hence roll in any time.

Limitations

The simulator is now built on a more recent version of the Delta3D game engine (version 2.7.2). Regarding most recent software, the only distribution we yet cannot support is Ubuntu Oneiric because it is delivered with OpenSceneGraph 3.0. As soon as Delta3D support OSG 3.0, the Robot3D simulator will support it too.

Benefits

First, the new version of the simulator removes most of the GUI controls that were part of the old Symbricator3D simulator. The older simulator had problems separating what needed to be seen by the user versus by the cameras on the robots, having code in place that would either show or hide GUI controls, potentially slowing things down and leading to code bloat.
Second, the current simulator can still be controlled and sensor data be acquired over YARP interfacing, but there is now more liberty in providing custom plugins (shared libraries) for both components and controllers. A typical component would be an EvolutionaryEngine that initializes an arena with robots, runs it for an epoch, and collects fitness measures. A typical controller only knows as much as a controller on a robot would know and is able to obtain information via the defined sensors and actuate the wheels and other actuators.
Third, support for organisms has been extended. An XML syntax for organisms is defined. Organisms in their entirety can be loaded from a configuration file and be placed in the simulator.

Manual

A manual on using the Robot3D will be created soon. It will describe a simple component and a simple controller using the plugin system. It will also describe how to use YARP as an alternative to the plugin system. Three examples will be placed on the Launchpad bazaar code repository as separate branches. It is encourage to copy these examples and adjust them to your own wishes. Keep tight!

Posted in Replicator, Software, Symbrion | Leave a comment

Yarp Modules for Robot3D

Robot3D, the new 3D modular robot simulator easy-to-install on Ubuntu systems, has better and better support for YARP. There is a large set of YARP modules now available at Launchpad, see this overview. See for example the CollisionAvoidanceYARP module. A few code snippets will be placed over here to get some sense about how to program your own controllers.

The following code shows how we can retrieve a collection of ports defined on an individual robot:

/**
 * Retrieves all ports from the RPC port on the robot in the
 * Robot3D simulator. The function connects and disconnects
 *  automatically.
 */
void CollisionAvoidance::retrievePorts() {
	vector* ports = getRemotePorts(robotControlPort, "all");
	if (ports == NULL) {
		LOG_INFO("No ports returned");
		return;
	}

	for (size_t x = 0; x size(); ++x) {
		std::ostringstream msg; msg.clear(); msg.str("");
		msg << "Found port[" << x << "] for sensor: \""
                      <at(x) << "\"";
		LOG_INFO(msg.str());
	}
	delete ports;
}

You will then discover that there is such a port called /robot_X/wheels (which X the index of a robot). Sending a command to the wheels is really straightforward. YARP does have the concept of a “Bottle”. This is a flexible container that is able to hold a diversity of simple data types. An interesting concept is the “VOCAB”, the vocabulary of YARP commands. It is a disguised 32-bit (default) integer. Such an integer exists out of 4 bytes, each byte does have room for one character. By using a macro such as VOCAB(‘b’,'o’,t’,'h’), the user can use letters instead of numbers for commands, while under the hood still computationally inexpensive integers are used. This means you can use switch(vocab) { case VOCAB(‘b’,'o’,t’,'h’): … }. Anyway, the code below demonstrates how to make the robot move. Just send a bottle to the /robot_X/wheels port.

void CollisionAvoidance::sendWheelCommand(
                BufferedPort &port, double left, double right) {
	// Make sure you use a "&" if you get a bottle from prepare
	Bottle &b = port.prepare();
	b.clear();
	b.addVocab(VOCAB_BOTH);
	// (X, 0) means rotating
	// (X, X) and (-X, -X) means strafing, don't rotate
	// (X, -X) and (-X, X) means either forwards or backwards
	b.addDouble(left);
	b.addDouble(right);
	port.writeStrict();
}
Posted in Downloads, Other projects, Replicator, Software | Leave a comment

First Release of Robot3D

First of all, thanks to the main developer of the Symbricator3D software, Lutz Winkler from the Karlsruhe Institute of Technology, the former Universität Karlsruhe. Robot3D is a rebranding to denote the fact that this is not meant to be software only useful for the Replicator and Symbrion projects from which the name was derived originally. We might have a poll for an even more appropriate name in the future perhaps…

The first release of Robot3D can be found at a so-called PPA (Personal Package Archive) at http://launchpad.net/robot3d. You can install it very easy if you use the up to date version of Ubuntu.

sudo add-apt-repository ppa:robot3d-team/ppa-robot3d
sudo aptitude update
sudo aptitude install robot3d-dev yarp-bin delta3d-apps

This will install the Robot3D Simulator in the menu under Applications and then the category Science.

The Robot3D VM

The Robot3D VM


There are efforts to get Robot3D into Debian (and hence Ubuntu), but this process will take a while.

The screenshot shows not my machine (although it seems like it). It is a virtual machine that – in principle – can also be run from a USB stick or CD. At “Downloads” you can download the ISO file, but do not expect realistic simulation of the physical effects. It will probably run so slow that you might even run the risk of segmentation faults of the Open Dynamic Engine (of course no harm can be done). The ISO file will not be updated as regularly as the PPA, which is really the recommended way to install the simulator.

Posted in Downloads, Replicator, Software, Symbrion | Leave a comment

Screenshots

Some additional screenshots of the Robot3D simulator. It nicely illustrates what kind of robots it is able to simulate.

Hexapod

Hexapod in Robot3D

Asymmetric organism

Asymmetric organism

Assymetric coloured organism

Asymetric coloured organism

The first organism is created at the University of Karlsruhe. The second and third is created at the University of Graz (source). The colours indicate hormone quantities in a so-called hormone controller implemented by the biologists in the University of Graz. The organism moves by hormone levels surpassing certain predefined thresholds.

Locomotion for the hexapod is not yet implemented. It is a very large organism; real-time simulation speed is possible, but in this case all sensors need to be turned off. Rendering a camera on each robot module increase the simulation load significantly. Delta3D provides via the dtPhysics library, which is a wrapper around the Physics Abstraction Layer (PAL) an option to use different physics engines. For now ODE is used, but it is easy to switch to Bullet or PhysX. PhysX is a free commercial physics engine which can be easily accelerated using CUDA on the graphics card.

YARP will be used to ease the simulation of the software that runs on individual robot modules. If cameras are turned on on all robot modules, the only additional effect on the simulator will be the scene rendering from the viewpoint of all those different cameras. The software that processes the images however can be placed on other machines and does not need to be placed on the machine that runs the actual simulator. For very large scenes it is possible to extend Robot3D so that it uses the High Level Architecture (HLA) capability of Delta3D. HLA is an architecture to run distributed simulations, with a Run-Time Infrastructure (RTI) underlying it. This functionality of Delta3D will be used at the end of 2012, when a total of 100 robots needs to be simulated.

Posted in Replicator, Software, Symbrion | Leave a comment

Robot3D Code Management

We are happy to announce that the Robot3D code development will take place on Launchpad. To contribute to the development mail the Robot3D Team

Launchpad uses Bazaar which has superior properties over SVN with respect to merging. It also allows for working offline in the form of commits to your local repository. Launchpad is of course also just looking more professional than Sourceforge.

Launchpad also comes with a Personal Package Archive, a PPA. This is the place where tar balls of the source can be uploaded, previously created with e.g. dh_make and debuild. The packages are built automatically using a pool of machines. You can check the list of builders and you will probably see a machine building openoffice, eucalyptus, or other packages that are maintained at Canonical’s build farm.

We are in the process of creating the proper Ubuntu Lucid packages for i386 and amd64 architectures of the prerequisite software, such as Delta3D and Yarp. The Robot3D software will subsequently be packaged by bzr-builder.

Posted in Downloads, Replicator, Software, Symbrion | Leave a comment

RoboCupRescue

Almost everybody knows the RoboCup Soccer league. Robots in the real world or in a simulator that play a soccer game together. This all with the goal to create a robot soccer team that will defeat the best human team in 2050.

There exist also a less well-known league, the RoboCup Rescue league. The embedded movie shows a successful run in the German Open 2010. Like you can see, the robots have tracks like tanks. They go from a simple arena – with slopes – to difficult arenas – with difficult challenges like staircases and debris. In the meanwhile they have to find victims, little dolls.

This movie shows that you do not want such a robot to perform rescue operations in a collapsed mine yet! The robots are too stupid. They might poke a victim in the eyes, or run over a victim! To be able to work on the artificial intelligence part, the RoboCub Rescue league people also created a 3D model of the environment.

Robot3D Rescue

RoboCupRescue in Robot3D

Robot3D in Symbricator3D

The 3D model can be used in the Robot3D simulator. In the screenshot one of the Replicator robots is shown. At the top right, its camera sees a lot of blue sky. That is because the robots is thrown in this simulator without much respect to where the debris is. It fell over.

It is quite a challenge to navigate for such a robot in this environment. It is really necessary to be with more robots to form complete organisms. In that case it will be able to overcome all obstacles just as its bigger fixed-size brother. Moreover, it will not be stopped in its tracks, because of the ruggedness of the landscape. In contrary, smart as it is, it will be able to use sometimes the blocks to its advantage.

Posted in Other projects, Replicator, Software | Leave a comment