Scientists have created robots that can adapt and recover like an animal when damaged