Gait emergence by discrete leg motion period control using contact signals and CPGs