An insect robot controlled by the emergence of gait patterns