Route selection in complex environments emerges from the dynamics of steering and obstacle avoidance