3D print and assembly guide

Once you have a robot that behaves the way you would like in the simulator, it is time to build it. For this you will need some electronic components, a set of standard 3D printed parts, and a set of custom parametrized parts that you will need to 3D print. More details on how to get a hold of these parts are available below. After your evolution runs are complete, you can determine the components required to build your robot through the text file that describes the tree representation of robot body parts.

Once you have all of your parts, it is time to assemble! We have prepared a series of video tutorials demonstrating how to assemble RoboGen robots.

Pay close attention to the orientation of the parts relative to each other when building the robot. For the active hinge, there are two possible orientations of the part that will give the same degree of freedom but opposite behaviors! To be sure, check the my_robot text file: the orientation of the part is described as a number following the part name. The format of this file follows the rules set for describing a robot body mentioned on page Guidelines for writing a robot text file.

For reference, here is the numbering of the faces of the core component:

  • Face 0 is the side of battery rack
  • Face 1 is opposite the battery rack
  • Face 2 is opposite the usb slot
  • Face 3 is the side of the usb slot
cube faces

Standard parts

The parts you will need to assemble your robot are listed in the table below, along with where to get them and how many to get.

Part Reference Where to find it Amount Link
Mini-USB Cable Pololu or any electronics store or online 1 https://www.pololu.com/product/130
NanoWii Microcontroller Hobbyking 1 http://www.hobbyking.com/hobbyking/store/__22322__MultiWii_NanoWii_ATmega32U4_Micro_Flight_Controller_USB_GYRO_ACC.html
Battery Turnigy nano-tech 260mah 2S 35~70C Lipo Pack Hobbyking 1 http://www.hobbyking.com/hobbyking/store/__26742__Turnigy_nano_tech_260mah_2S_35_70C_Lipo_Pack.html
BEC Hobbyking 1 http://www.hobbyking.com/hobbyking/store/__36305__5V_5A_UBEC_2_5S_Lipoly_7_2_21v_EU_warehouse_.html
Servos Turnigy XGD-11HMB Digital Servo Hobbyking One per active hinge http://www.hobbyking.com/hobbyking/store/__25455__Turnigy_8482_XGD_11HMB_Digital_Servo_DS_Mini_Servo_3_0kg_0_12sec_11g.html
3D printed parts The Shapeways Robogen shop https://www.shapeways.com/shops/robogen
or 3D printed at home on an FDM printer (see below) https://github.com/lis-epfl/robogen/tree/cutting_edge/printing-3D
Light sensor Vishay BPW85B Mouser or Farnell http://www.mouser.ch/ProductDetail/Vishay/BPW85B/?qs=%2fha2pyFaduj%252bHVLgq8OWHYgvolmVhQxKGwJm0YsJU3o%3d
Ir Sensor VL6180X Time-of-Flight Distance Sensor Carrier Pololu https://www.pololu.com/product/2489
Header pins Pololu 14-20 https://www.pololu.com/product/965
Wires Pololu ~20 of different colors https://www.pololu.com/product/2632
Servo cable extensions Pololu optional https://www.pololu.com/product/2184
Female Crimp Pins Pololu optional https://www.pololu.com/product/1930
Crimp Connector Housing Pololu optional https://www.pololu.com/product/1900
Screws DIN 7981 ST 2,2 L 4,5 mm Bossard or hardware store minimum 2 per joint https://eu.shop.bossard.com/group/en/10257/self-tapping-screws-self-drilling-screws-thread-forming-screws/self-tapping-screws/bn-994_phillips-pan-head-tapping-screws-form-h-with-cone-end-type-c#
Quick-set Epoxy Hobby or craft store optional
Heat shrink Hobby or electronics store optional

In addition to these parts, you will need the following tools :

  • Wire cutter and wire stripper
  • Soldering iron and solder
  • (optional) Heat gun
  • (optional) Lighter

3D printed parts

If you have access to a desktop fused deposition modelling (FDM) technology printer, you can download the .stl robot part files here and print them for yourself. In this case, the geometries that can be printed without use of support material are different. For this reason, some of the .stl files are specific to FDM as indicated in the file name. For example, the core component as it appears in the simulator is not printable with FDM. In order to make it printable, it should fulfill the requirements of the 45 degree rule. That is why the Core_FDM part does not look exactly like the cores in the simulator.

If you have any questions, please don’t hesitate to ask them on our google group.

Parametrized components

The parametrized components your robot needs are a result of the evolution, and need to be generated specifically for your robot. For this, you need to adapt template CAD files for the two halves of the part according to the parameters given by the algorithm, then compile these to STL format for 3D printing.

You can find the files ParametricPartATemplate.scad ParametricPartBTemplate.scad here.

Adapting the Files for Your Robot

The parameters of the parametric parts can be found in the .txt file of the robot body, and should be entered into the code of the template files.

The parameters are as follows (copied from the page Guidelines for Writing a Robot Text File)

For the parametrized joint the parameters are, in correct order:

  1. Length: (in meters, between 0.02 and 0.1)
  2. Rotation-Angle: rotation angle in transverse/horizontal plane, relative to parent, in degrees between -90 and 90
  3. Inclination-Angle: currently rotating out of the transverse plane is disallowed, so this value must be 0 (parameter not used)

Parameters 1 and 3 should be put into the file partA, and parameter 2 in partB. Modify the parameters accordingly in the following lines:

partA(0.03,0); //the first parameter is the length of the joint in meters, the second parameter is the angle beta (only for non-planar robots)

partB(20); //the parameter is the angle of the parametric part in degrees

Generating the STL Files

There are 2 options for this step:

1. Install openscad and use the software to compile the parts.

Once the file is loaded in the UI, click Preview (F5), Render (F6) then Export as STL.

2. Compile them online at: http://openscad.net/

Choose edit->inputSyntax: tick OpenSCAD

Hit F4 to generate file, then click Design->Export as STL/DXF

3D Printing the Parts

The 3D printing procedure is described here. If anything is unclear, please let us know here.

Arduino Programming Guide

Desktop Version: Generate NeuralNetwork.h

To generate the files needed for the Arduino you must run the File Viewer with the --output option:

 ./robogen-file-viewer evolved_robot.json conf.txt --output evolved_robot

The resulting file NeuralNetwork.h will be inside evolved_robot/.

Web Version: Generate NeuralNetwork.h

  1. Start a new simulation.
  2. Enter the working directory to be the directory containing your evolution results.
  3. Enter the robot description file. (A copy of robot description file will be automatically available inside this directory)
  4. Enter the configuration file. (A copy of configuration file will be automatically available inside this directory)
  5. Tick on the Generate Log files text box and specify output directory
  6. Click on “Reload” on the advanced tab and navigate to the folder to find NeuralNetwork.h file


Download the Arduino IDE and download and extract the Arduino package from the Robogen website. For the Arduino IDE, you will need a java installation. This should be taken care of on Windows and Mac, but on Ubuntu, you should sudo apt-get install default-jre.


  1. Make sure the Arduino IDE is closed.
  2. From the results folder, copy NeuralNetwork.h into arduino/RobogenArduino/.
  3. You can now open RobogenArduino.ino folder in the Arduino IDE.
  4. Select Tools > Board > Arduino Leonardo to specify the Robogen’ Compatible arduino board.
  5. Click verifyArduino to verify the Arduino program.

Connect and Upload

To correctly connect our sensors and actuators, consult “NeuralNetwork.h”. Then, unplug the battery from the BEC and the actuators from the Arduino before connecting the Arduino to the PC. IMPORTANT: Make sure that the BEC is not connected to the battery when the robot is not used, as else the BEC will consume battery power.

After connecting the Arduino to the PC, you should be able to use the upload uploadArduino button of the Arduino IDE to upload the compiled program to the robot. Once the program has been uploaded, you can disconnect the PC from the Arduino and reconnect actuators and battery. Your robot should now behave according to the neural network.

Calibrating the IMU

The IMUs of all boards are slightly different and need calibration and for this, there is a calibration procedure that relies on collecting values for few seconds with the board lying flat without any movement. Then the values collected can be set into the code and need not be set again. To complete the calibration, uncomment the line below in the main Arduino file(RobogenArduino.ino):

// uncomment to perform imu calibration

Compile and execute your code on the microcontroller and obtain the calibration values in the console. Note down the values and update the following lines in the same file:

#define ACCEL_OFFSET_X (1353)
#define ACCEL_OFFSET_Y (895)
#define ACCEL_OFFSET_Z (1596)
#define GYRO_OFFSET_X (138)
#define GYRO_OFFSET_Y (-110)
#define GYRO_OFFSET_Z (133)