Everyone who thinks robots are going to take over the world might be getting a lot more frightened: Scientists have created a machine that's able to have babies. Sort of.

In an experiment designed to show how robots can learn and evolve, researchers in Cambridge and Zurich programmed a robot arm—or "mother"—with an algorithm to create a device made out of blocks containing motors—its "child".

The blocks are assembled into a structure by the robot arm, and the motors are turned on. A camera detects how far the blocks are able to travel. The robot arm sees this, and then modifies the next "baby" to try to make it go further, learning from the mistakes and good traits of the last one.

This is all done without human intervention. The research was published in the journal PLOS One.

Luzius Brodbeck, one of the researchers from the Institute of Robotics and Intelligent Systems at ETH Zurich, said the robots are normally programmed to do one just thing.

"Machines usually build the same thing and what it will do and it will do it over again. What we did here was use a genetic algorithm so each operation is different," Brodbeck told CNBC by phone.