Shape-induced obstacle attraction and repulsion during dynamic locomotion