RoboGen on the Web

The app can be found here: robogen.org/app.

Tip: When using RoboGen Online, if the software is not working, the first thing to try refreshing page. Important: All data for online being saved a virtual filesystem within your web browser. If you want to save anything later use, sure download it hard drive!

View the shape and behavior of the robot

You visualize one example by clicking its icon on the front page. To other robots

    1. Click the “Advanced” tab at the top screen.
    2. “Start simulation” button.
    3. Provide an appropriate robot description file (.json or .txt).
    4. Provide an appropriate configuration file.
    5. “OK” button.

You can now play the simulation, move backwards and forwards in time and change the rendering perspective.

Note: if the specified output directory already exists the software will (by default) create a new directory with incrementing integer suffixes on each invocation. If you really want to write to the specified directory, potentially overwriting any data that already exists in that location you must additionally tick the “Overwrite the output directory” checkbox.

Finally, you can also tick the “Generate WebGL log files” checkbox to additionally output a webGL.json file in the output directory, which can be used to visualize your robot in the online visualizer, and easily shared with others.

Artificial evolution of robots

The main part of RoboGen is the co-evolution of the brains (controllers) and bodies (morphologies) of robots. Each evolutionary run first has to be configured using an evolution configuration file (pay attention: this is different from the simulator configuration file!), which contains the evolution parameters such as the selection method and various mutation parameters. An example of such a configuration file is provided, “myEvolConf.txt” in the examples directory.

Once you have an appropriate configuration file created, you can begin evolving robots as follow:
    1. Click on the “Advanced” tab at top of screen.
    2. Click the Start an evolution button.
    3. Provide your evolution configuration file.
    4. Provide the name of your output directory to write results to.
    5. Provide a seed (integer value) for random number generator.
    6. Press the “OK” button.

The artificial evolution engine should now launch, and you should see the progress of each generation. When a generation is complete you can click “Visualize” to directly view the best individual from that generation. Additionally, the directory with your chosen name should appear in the “Advanced” tab. That directory contains “BestAvgStd.txt”, which is a file containing fitness statistics, and also contains a copy of the evolution configuration files, and will contain the best individual for each generation as evolution proceeds.


RoboGen with Command Line

Note: On Linux and Mac you should run all commands starting with “./” as is shown below. On windows, you should omit this. The present working directory for windows should be Robogen Windows\run and for Linux should be robogen/build

View the shape and the behavior of a robot

You can visualize the shape and behavior of a robot using the robogen-file-viewer software using the following command:

./robogen-file-viewer <robot .json or .txt file> <scenario configuration>.txt

With the example files:

./robogen-file-viewer ../examples/simpleRobot.txt ../examples/conf.txt

Use ‘p’ to pause the simulation, and ‘q’ to quit.

If several starting positions are defined, you can add another parameter to specify which one is to be used. To do that, simply append at the end an integer from 1 to n, where n is the number of specified starting positions:

./robogen-file-viewer ../examples/simpleRobot.txt ../examples/conf.txt 2

This command will start the robot from the second defined starting position.

For each file viewer run, it is possible to output all files necessary to reproduce the run as well as statistics of the run, i.e. Sensor and Motor history. In order to do this, you must use the –output option of robogen-file-viewer, e.g.:

./robogen-file-viewer simpleRobot.txt conf.txt --output OutputData

where OutputData can be any name you choose. A folder “OutputData” is then created, which contains the output files. You can then plot the content of those files using “robogen/octave/robogenPlot.m”, which can be executed in Octave or Matlab. This folder will also contain a NeuralNetwork.h file, which is what you will use for uploading the robot’s brain onto the Arduino for use on a physical robot.

Additionally, you can combine the –output option with –webgl option to additionally output a webGL.json file in the output directory, which can be used to visualize your robot in the online visualizer, and shared with others.

./robogen-file-viewer simpleRobot.txt conf.txt --output OutputData --webgl

Note: by default running the file viewer with –output multiple times in a row, will cause the software to create a new directory with incrementing integer suffixes on each invocation. If you really want to write to the specified directory, potentially overwriting any data that already exists in that location you must additionally specify option –overwrite

./robogen-file-viewer simpleRobot.txt conf.txt --output OutputData --overwrite

The robogen-file-viewer has many other options, which can be seen by running:

./robogen-file-viewer --help

Artificial evolution of robots

The main part of RoboGen is the co-evolution of the brains (controllers) and bodies (morphologies) of robots. Each evolutionary run first has to be configured using an evolution configuration file, which contains the evolution parameters such as the selection method and various mutation parameters. An example of such a configuration file is provided, “evolConf.txt” in “robogen/examples”. As the RoboGen simulator (also called “the server”) is implemented as a separate executable from the evolution engine, we need to launch them both. First, launch the simulator by executing in a separate command line window:

./robogen-server 8001

Where 8001 is the suggested port for communication between the evolution engine and simulator. The simulator should signal its readiness by outputting “Waiting for clients…” to the console. (NOTE: If the execution crashes or you get an error stating “cannot bind port 8001” use other port numbers such as 8002 or 8003. You should also update this port in the last line of evolution configuration file ).

Once the simulator is ready, launch the evolution engine using:

./robogen-evolver <seed, INTEGER> <output directory, STRING> <evolution configuration file, STRING>

where “seed” is a seed for the pseudo-random number generator, “output directory” is a path to a directory where the output files should be written, and “evolution configuration file” is the location of the evolution configuration to use. With our example (verify that the directory contains evolConf.txt, conf.txt, obstacles.txt and startPos.txt):

./robogen-evolver 1 results/my_first_evolution_experiment ../examples/evolConf.txt

You can read more about the evolution configuration here. The artificial evolution engine should now launch, and a folder titled “results/my_first_evolution_experiment” should appear in the execution folder. That folder contains “BestAvgStd.txt”, which is a file containing fitness statistics, and also contains a copy of the evolution configuration files, and will contain the best individual for each generation as evolution proceed.