An optimization approach to rough terrain locomotion | Synapse