Robots in history: Legends and prototypes from ancient times to the industrial revolution