Evolving Soft Robots
Evolving robots using a self-written physics engine
For a project in one of my graduate classes, I designed a soft body physics simulation, which I then used to design and evolve a soft-body robot to move. The physics simulation consists of two datatypes: a mass datatype and a spring datatype. Point masses are connected to one another via springs, which may have varying spring constants as well as rest lengths. By adjusting the rest length of a spring, I simulated a morphing soft-body.
Using this simulator, I then designed a complex soft-body robot which was inspired by the anatomy of an octopus. The soft-body robot consisted of nearly 200 masses, and over 1,000 springs, all of which had their own sinusoidal equation for rest length that allowed the body as a whole to become animated. I then trained the robot to move by optimizing each spring's rest length equation through the use of genetic algorithms. In order to prevent memory allocation errors, I reevaluated the robot's representation and employed dynamic programming to efficiently represent multiple generations of robots during training.
After training the robot to move, I used a similar genetic algorithm to evolve its morphology by removing and adding masses during training. The evolution process employed was fairly simple. At each iteration one child is created for every member of the population by crossing over both masses and springs from members of the population. Then, the resulting child robot is randomly mutated. The child is then evaluated by measuring the distance it travels in 10 seconds calculated using the physics simulation (average COM speed). Selection is done using phenotypic deterministic crowding, if a child outperforms both its parents it replaces the parent with the most similar average COM speed. The algorithm was run four times for 3,000 iterations with a population size of 5. Even though this project was implemented in C++, the large number of objects per robot (approximately 1,200 springs and masses each) slows down the learning process significantly. All animations were created using OpenGL.
A dot plot of the average speed of different populations over training
Some of the final evolved morphologies from the evolutionary process