Evolving a soft robot

Let’s see who is the fastest soft robot :). GitHub Link: https://github.com/JiaweiChenC/Robot-evolving

Goal

Generate a set of soft robots from scratch, evolve them with EA, then find the fastest soft robot.

What we need

  1. A physical simulator
  2. Basic computer graphics to rendering the soft robot.(build with OpenGL)
  3. A effective EA strategy(how to mutate and crossover).
  4. Some technique to make it faster.(C++ & CUDA)

Physical simulator

Basic primitives

Masses:

  • Point masses(no volume)
  • Have position, velocity and acceleration

Springs:

  • Massless
  • Connect two masses
  • Have a rest length and stiffness
  • Apply restoring forces on the masses
    Figure 1: Bouncing Cube

    Figure 1: Bouncing Cube

Basic simulator

  1. Choose a discrete time step dt
  2. At each time step:
    • T = T + dt
    • Interaction step:
      • Compute and tally all the forces acting on each mass from springs connected it
    • Integration step: h - Update position and velocity of each atom using Newton’s laws of motion F=ma.
Combine together

Combine a lot of cubes together, we can get a physical engine!

Figure 1: Bouncing Cubes

Figure 1: Bouncing Cubes

Evolutionary Algorithm

In computational intelligence (CI), an evolutionary algorithm (EA) is a subset of evolutionary computation,a generic population-based metaheuristic optimization algorithm. An EA uses mechanisms inspired by biological evolution, such as reproduction, mutation, recombination, and selection. Candidate solutions to the optimization problem play the role of individuals in a population, and the fitness function determines the quality of the solutions (see also loss function). Evolution of the population then takes place after the repeated application of the above operators.

Wikipedia

Competition

Figure 1: Bouncing Cubes

Figure 1: Bouncing Cubes

  1. At the beginning, all the robots were just “trembling
  2. After some time the robots can move a little bit
  3. After a lot of generations, the robots developed their strategy to move “FAST”

a FAST robot

Robots will use very interesting strategy to be faster, e.g., this robot have a big head so it can fall on the ground quickly and move faster than others.

Figure 1: A fast robot

Figure 1: A fast robot

CUDA

Another interesting part is using CUDA to accelerate the process.

Figure 1: Using CUDA

Figure 1: Using CUDA

If we have 10000 robots, the algorithm will be 18 times faster than the original one!