Adapting to obstacles