Efficient, stable locomotion in legged robots